avcodecmap,avviddec: Map bt2020-10, PQ and HLG transfer functions

Map more transfer functions between Gstreamer and ffmpeg
This commit is contained in:
Seungha Yang 2019-05-24 20:35:41 +09:00
parent 597578ca41
commit 2b50a0ce93
2 changed files with 18 additions and 1 deletions

View file

@ -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;
}

View file

@ -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;
}