diff options
author | Limin Wang <lance.lmwang@gmail.com> | 2022-02-14 23:17:11 +0800 |
---|---|---|
committer | Limin Wang <lance.lmwang@gmail.com> | 2022-03-01 09:08:43 +0800 |
commit | 5cd3c83a86ea65144c3f59cf07bad4e36ee511ba (patch) | |
tree | 7c4a626023f7e5f035a0922a7492cc7e4f60aea0 /libavcodec/hevcdec.c | |
parent | 188faab2bba234dab488b07a0dd425255eae8c23 (diff) | |
download | ffmpeg-5cd3c83a86ea65144c3f59cf07bad4e36ee511ba.tar.gz |
avcodec: support for CUVA HDR Vivid metadata
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libavcodec/hevcdec.c')
-rw-r--r-- | libavcodec/hevcdec.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 1d4ad42278..068750ddb6 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -2984,6 +2984,17 @@ static int set_side_data(HEVCContext *s) if ((ret = ff_dovi_attach_side_data(&s->dovi_ctx, out)) < 0) return ret; + if (s->sei.dynamic_hdr_vivid.info) { + AVBufferRef *info_ref = av_buffer_ref(s->sei.dynamic_hdr_vivid.info); + if (!info_ref) + return AVERROR(ENOMEM); + + if (!av_frame_new_side_data_from_buf(out, AV_FRAME_DATA_DYNAMIC_HDR_VIVID, info_ref)) { + av_buffer_unref(&info_ref); + return AVERROR(ENOMEM); + } + } + return 0; } @@ -3777,6 +3788,10 @@ static int hevc_update_thread_context(AVCodecContext *dst, if (ret < 0) return ret; + ret = av_buffer_replace(&s->sei.dynamic_hdr_vivid.info, s0->sei.dynamic_hdr_vivid.info); + if (ret < 0) + return ret; + s->sei.frame_packing = s0->sei.frame_packing; s->sei.display_orientation = s0->sei.display_orientation; s->sei.mastering_display = s0->sei.mastering_display; |