summaryrefslogtreecommitdiff
path: root/libavcodec/hevcdec.c
diff options
context:
space:
mode:
authorMohammad Izadi <izadi@google.com>2020-11-23 13:29:34 -0800
committerJames Almer <jamrial@gmail.com>2020-12-05 19:19:54 -0300
commitafbc6852b439005b546d8067f35cf65b1dddb8ac (patch)
treebe1ad56d27344c9546efc91a76cfde58fdb3ff4e /libavcodec/hevcdec.c
parent530d1dbcef6b8de4e506e4248a313ba729dfdf4f (diff)
avcodec/hevc_sei: add support for HDR10+ metadata
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/hevcdec.c')
-rw-r--r--libavcodec/hevcdec.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index 699c13bbcc..b2e196b294 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -2867,6 +2867,17 @@ static int set_side_data(HEVCContext *s)
s->sei.timecode.num_clock_ts = 0;
}
+ if (s->sei.dynamic_hdr_plus.info) {
+ AVBufferRef *info_ref = av_buffer_ref(s->sei.dynamic_hdr_plus.info);
+ if (!info_ref)
+ return AVERROR(ENOMEM);
+
+ if (!av_frame_new_side_data_from_buf(out, AV_FRAME_DATA_DYNAMIC_HDR_PLUS, info_ref)) {
+ av_buffer_unref(&info_ref);
+ return AVERROR(ENOMEM);
+ }
+ }
+
return 0;
}
@@ -3560,6 +3571,10 @@ static int hevc_update_thread_context(AVCodecContext *dst,
}
}
+ ret = av_buffer_replace(&s->sei.dynamic_hdr_plus.info, s0->sei.dynamic_hdr_plus.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;