diff options
author | Anton Khirnov <anton@khirnov.net> | 2022-03-23 16:17:20 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2022-05-11 10:37:17 +0200 |
commit | c954cf1e1b766a0d1992d5be0a8be0055a8e1a6a (patch) | |
tree | 244b9eb3d088011dc6ae1878eb2319a6050826b9 /libavcodec/encode.h | |
parent | a4ce3706595edd9b537861f0e5447e31babf2100 (diff) | |
download | ffmpeg-c954cf1e1b766a0d1992d5be0a8be0055a8e1a6a.tar.gz |
lavc/encode: add an encoder-specific get_buffer() variant
Several encoders (roqvideo, svq1, snow, and the mpegvideo family)
currently call ff_get_buffer(). However this function is written
assuming it is called by a decoder. Though nothing has been obviously
broken by this until now, that may change in the future.
To avoid potential future issues, introduce a simple encode-specific
wrapper around avcodec_default_get_buffer2() and enforce its use in
encoders.
Diffstat (limited to 'libavcodec/encode.h')
-rw-r--r-- | libavcodec/encode.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/encode.h b/libavcodec/encode.h index 97b3acf9df..b2536bf0f3 100644 --- a/libavcodec/encode.h +++ b/libavcodec/encode.h @@ -45,6 +45,11 @@ int ff_encode_get_frame(AVCodecContext *avctx, AVFrame *frame); int ff_get_encode_buffer(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int flags); /** + * Allocate buffers for a frame. Encoder equivalent to ff_get_buffer(). + */ +int ff_encode_alloc_frame(AVCodecContext *avctx, AVFrame *frame); + +/** * Check AVPacket size and allocate data. * * Encoders supporting FFCodec.encode2() can use this as a convenience to |