diff options
author | James Almer <jamrial@gmail.com> | 2021-02-20 16:01:52 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2021-03-12 19:49:08 -0300 |
commit | 6e7e3a3820f0888ff92d6be44f40ff733bcce874 (patch) | |
tree | f057b934848eeb52d019213018b4fedaeafd61f6 /libavcodec/encode.h | |
parent | 2c96e6cb955af3062e78c5b0f9fb907cfb2e59e3 (diff) | |
download | ffmpeg-6e7e3a3820f0888ff92d6be44f40ff733bcce874.tar.gz |
avcodec: add a get_encode_buffer() callback to AVCodecContext
This callback is functionally the same as get_buffer2() is for decoders, and
implements for the new encode API the functionality of the old encode API had
where the user could provide their own buffers.
Reviewed-by: Lynne <dev@lynne.ee>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/encode.h')
-rw-r--r-- | libavcodec/encode.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/encode.h b/libavcodec/encode.h index dfa9cb2d97..089c31091c 100644 --- a/libavcodec/encode.h +++ b/libavcodec/encode.h @@ -24,6 +24,7 @@ #include "libavutil/frame.h" #include "avcodec.h" +#include "packet.h" /** * Called by encoders to get the next frame for encoding. @@ -36,4 +37,11 @@ */ int ff_encode_get_frame(AVCodecContext *avctx, AVFrame *frame); +/** + * Get a buffer for a packet. This is a wrapper around + * AVCodecContext.get_encode_buffer() and should be used instead calling get_encode_buffer() + * directly. + */ +int ff_get_encode_buffer(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int flags); + #endif /* AVCODEC_ENCODE_H */ |