From 2b50a0ce93c47946dc63fac9fa828814ed56b7ea Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Fri, 24 May 2019 20:35:41 +0900 Subject: [PATCH] avcodecmap,avviddec: Map bt2020-10, PQ and HLG transfer functions Map more transfer functions between Gstreamer and ffmpeg --- ext/libav/gstavcodecmap.c | 9 +++++++++ ext/libav/gstavviddec.c | 10 +++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ext/libav/gstavcodecmap.c b/ext/libav/gstavcodecmap.c index fea91057cb..559228fd95 100644 --- a/ext/libav/gstavcodecmap.c +++ b/ext/libav/gstavcodecmap.c @@ -2986,9 +2986,18 @@ gst_ffmpeg_videoinfo_to_context (GstVideoInfo * info, AVCodecContext * context) case GST_VIDEO_TRANSFER_LOG316: context->color_trc = AVCOL_TRC_LOG_SQRT; break; + case GST_VIDEO_TRANSFER_BT2020_10: + context->color_trc = AVCOL_TRC_BT2020_10; + break; case GST_VIDEO_TRANSFER_BT2020_12: context->color_trc = AVCOL_TRC_BT2020_12; break; + case GST_VIDEO_TRANSFER_SMPTE2084: + context->color_trc = AVCOL_TRC_SMPTE2084; + break; + case GST_VIDEO_TRANSFER_ARIB_STD_B67: + context->color_trc = AVCOL_TRC_ARIB_STD_B67; + break; default: break; } diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c index 33fcd8e3bb..6522828bae 100644 --- a/ext/libav/gstavviddec.c +++ b/ext/libav/gstavviddec.c @@ -1225,7 +1225,6 @@ gst_ffmpegviddec_negotiate (GstFFMpegVidDec * ffmpegdec, if (!gst_structure_has_field (in_s, "colorimetry") || in_info->colorimetry.transfer == GST_VIDEO_TRANSFER_UNKNOWN) { switch (context->color_trc) { - case AVCOL_TRC_BT2020_10: case AVCOL_TRC_BT709: case AVCOL_TRC_SMPTE170M: out_info->colorimetry.transfer = GST_VIDEO_TRANSFER_BT709; @@ -1248,9 +1247,18 @@ gst_ffmpegviddec_negotiate (GstFFMpegVidDec * ffmpegdec, case AVCOL_TRC_LOG_SQRT: out_info->colorimetry.transfer = GST_VIDEO_TRANSFER_LOG316; break; + case AVCOL_TRC_BT2020_10: + out_info->colorimetry.transfer = GST_VIDEO_TRANSFER_BT2020_10; + break; case AVCOL_TRC_BT2020_12: out_info->colorimetry.transfer = GST_VIDEO_TRANSFER_BT2020_12; break; + case AVCOL_TRC_SMPTE2084: + out_info->colorimetry.transfer = GST_VIDEO_TRANSFER_SMPTE2084; + break; + case AVCOL_TRC_ARIB_STD_B67: + out_info->colorimetry.transfer = GST_VIDEO_TRANSFER_ARIB_STD_B67; + break; default: break; }