From e111dfc39cab11a60692bcd52012b7c3e3744177 Mon Sep 17 00:00:00 2001 From: Christian Curtis Veng Date: Fri, 26 Jan 2024 10:56:19 +0100 Subject: [PATCH] glcolorconvert: fix wrong RGB to YUV matrix with bt709 Converting from RGB to YUV: When comparing the info.colorimetry to GST_VIDEO_COLORIMETRY_BT709 it does not make sense to look at the input signal because that is of type of RGB. The plugin needs to look at the output YUV-type and compare GST_VIDEO_COLORIMETRY_BT709 to that, because that is the YUV-type the plugin needs to convert input-RGB into. Converting from YUV to RGB: Comparing to the input is correct, but because here the color encoding info BT601/BT709 is on input side of the plugin. Part-of: --- .../gst-plugins-base/gst-libs/gst/gl/gstglcolorconvert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcolorconvert.c b/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcolorconvert.c index 1851dbe6a4..428670481b 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcolorconvert.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcolorconvert.c @@ -2291,7 +2291,7 @@ _RGB_to_YUV (GstGLColorConvert * convert) break; } - if (gst_video_colorimetry_matches (&convert->in_info.colorimetry, + if (gst_video_colorimetry_matches (&convert->out_info.colorimetry, GST_VIDEO_COLORIMETRY_BT709)) { info->cms_offset = (gfloat *) from_rgb_bt709_offset; info->cms_coeff1 = (gfloat *) from_rgb_bt709_ycoeff;