summaryrefslogtreecommitdiff
path: root/libavcodec/magicyuvenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-05-11 20:52:13 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-08-27 02:23:43 +0200
commita499b4345b2dbc731d6c24aa6a9b319d4c3a0d4c (patch)
treeb16216ae64dedbc5fdb499f9817dcc50c32bc3a4 /libavcodec/magicyuvenc.c
parent7360e97e4beec13ef5aa87657490d8f272be9f26 (diff)
avcodec: Make ff_alloc_packet() based encoders accept user buffers
Up until now, these encoders received non-refcounted packets (whose data was owned by the corresponding AVCodecContext) from ff_alloc_packet(); these packets were made refcounted lateron by av_packet_make_refcounted() generically. This commit makes these encoders accept user-supplied buffers by replacing av_packet_make_refcounted() with an equivalent function that is based upon get_encode_buffer(). (I am pretty certain that one can also set the flag for mpegvideo- based encoders, but I want to double-check this later. What is certain is that it reallocates the buffer owned by the AVCodecContext which should maybe be moved to encode.c, so that proresenc_kostya.c and ttaenc.c can make use of it, too.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/magicyuvenc.c')
-rw-r--r--libavcodec/magicyuvenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/magicyuvenc.c b/libavcodec/magicyuvenc.c
index 7d77ef7bba..b2846948e6 100644
--- a/libavcodec/magicyuvenc.c
+++ b/libavcodec/magicyuvenc.c
@@ -569,12 +569,12 @@ const FFCodec ff_magicyuv_encoder = {
.p.long_name = NULL_IF_CONFIG_SMALL("MagicYUV video"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_MAGICYUV,
+ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.priv_data_size = sizeof(MagicYUVContext),
.p.priv_class = &magicyuv_class,
.init = magy_encode_init,
.close = magy_encode_close,
FF_CODEC_ENCODE_CB(magy_encode_frame),
- .p.capabilities = AV_CODEC_CAP_FRAME_THREADS,
.p.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_GRAY8,