videoconvert: fix passthrough on equivalent transfer

When the input info and output info are equal, except for the
transfer functions that are *not* equivalent, we need to set up
a converter as we won't be passthrough.

Fixes an assertion in that case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2929>
This commit is contained in:
Mathieu Duponchelle 2022-08-23 16:02:31 +02:00
parent ffebd52e46
commit 31c1e586c3

View file

@ -792,12 +792,11 @@ gst_video_convert_scale_set_info (GstVideoFilter * filter, GstCaps * in,
* we're converting between equivalent transfer functions, do passthrough */ * we're converting between equivalent transfer functions, do passthrough */
tmp_info = *in_info; tmp_info = *in_info;
tmp_info.colorimetry.transfer = out_info->colorimetry.transfer; tmp_info.colorimetry.transfer = out_info->colorimetry.transfer;
if (gst_video_info_is_equal (&tmp_info, out_info)) { if (gst_video_info_is_equal (&tmp_info, out_info) &&
if (gst_video_transfer_function_is_equivalent (in_info->colorimetry. gst_video_transfer_function_is_equivalent (in_info->colorimetry.transfer,
transfer, in_info->finfo->bits, out_info->colorimetry.transfer, in_info->finfo->bits, out_info->colorimetry.transfer,
out_info->finfo->bits)) { out_info->finfo->bits)) {
gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (filter), TRUE); gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (filter), TRUE);
}
} else { } else {
GstStructure *options; GstStructure *options;
GST_CAT_DEBUG_OBJECT (CAT_PERFORMANCE, filter, "setup videoscaling"); GST_CAT_DEBUG_OBJECT (CAT_PERFORMANCE, filter, "setup videoscaling");