aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-04-27 16:58:16 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-05-15 13:00:12 +0200
commitbc40cd621440107ee7fbe6ec6cab2397acc3874b (patch)
tree2bdb2f8b7c95901d84533998923df9a7e10fe0c1
parented8a7c25cdef1a58362471240c218a02dd903619 (diff)
downloadffmpeg-bc40cd621440107ee7fbe6ec6cab2397acc3874b.tar.gz
avcodec/exrenc: Allow user-supplied buffers
Trivial for an encoder that has a good estimate of the size of the output packet in advance. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavcodec/exrenc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/exrenc.c b/libavcodec/exrenc.c
index 207a335f44..a594cf5a8d 100644
--- a/libavcodec/exrenc.c
+++ b/libavcodec/exrenc.c
@@ -33,6 +33,7 @@
#include "libavutil/pixdesc.h"
#include "avcodec.h"
#include "bytestream.h"
+#include "encode.h"
#include "internal.h"
#include "float2half.h"
@@ -352,7 +353,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
avctx->width,
avctx->height, 64) * 3LL / 2;
- if ((ret = ff_alloc_packet2(avctx, pkt, out_size, out_size)) < 0)
+ if ((ret = ff_get_encode_buffer(avctx, pkt, out_size, 0)) < 0)
return ret;
bytestream2_init_writer(pb, pkt->data, pkt->size);
@@ -541,10 +542,10 @@ const AVCodec ff_exr_encoder = {
.priv_class = &exr_class,
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_EXR,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.init = encode_init,
.encode2 = encode_frame,
.close = encode_close,
- .capabilities = AV_CODEC_CAP_FRAME_THREADS,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_GBRPF32,
AV_PIX_FMT_GBRAPF32,