aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/avuienc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-04-27 16:15:47 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-05-05 12:29:10 +0200
commit1106f206453b8ab29f5b6972522def49d08e6288 (patch)
tree09f32a997735d6f41b383d8907a06297d4585dbc /libavcodec/avuienc.c
parent9e9836424b63ee096fd715a2479066daff8dfa01 (diff)
downloadffmpeg-1106f206453b8ab29f5b6972522def49d08e6288.tar.gz
avcodec/avuienc: Allow user-supplied buffers
Trivial given that this encoder knows the size of the output buffer in advance. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/avuienc.c')
-rw-r--r--libavcodec/avuienc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/avuienc.c b/libavcodec/avuienc.c
index a1840d1d53..b7f1347056 100644
--- a/libavcodec/avuienc.c
+++ b/libavcodec/avuienc.c
@@ -21,6 +21,7 @@
*/
#include "avcodec.h"
+#include "encode.h"
#include "internal.h"
#include "libavutil/intreadwrite.h"
@@ -62,7 +63,7 @@ static int avui_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
skip = 16;
}
size = 2 * avctx->width * (avctx->height + skip) + 8 * interlaced;
- if ((ret = ff_alloc_packet2(avctx, pkt, size, size)) < 0)
+ if ((ret = ff_get_encode_buffer(avctx, pkt, size, 0)) < 0)
return ret;
dst = pkt->data;
if (!interlaced) {
@@ -98,7 +99,7 @@ const AVCodec ff_avui_encoder = {
.id = AV_CODEC_ID_AVUI,
.init = avui_encode_init,
.encode2 = avui_encode_frame,
- .capabilities = AV_CODEC_CAP_EXPERIMENTAL,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_UYVY422, AV_PIX_FMT_NONE },
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};