v4l2object: Always tell capture queue that we want to set the CSC
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Tue, 17 Sep 2024 17:28:45 +0000 (13:28 -0400)
committerNicolas Dufresne <nicolas@ndufresne.ca>
Tue, 24 Sep 2024 20:19:12 +0000 (20:19 +0000)
Not all drivers supports it, but in general we want to try and match the
negotiated caps, so lets always try to set the CSC.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7563>

subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c

index 8b158b1da9b4dd2c1eda5acdc7aa0bb8eb2bd3c4..e9932e3113199285bb76161e5dee50308948d99c 100644 (file)
@@ -3898,12 +3898,16 @@ gst_v4l2_object_set_format_full (GstV4l2Object * v4l2object, GstCaps * caps,
     format.fmt.pix_mp.quantization = range;
     format.fmt.pix_mp.ycbcr_enc = matrix;
     format.fmt.pix_mp.xfer_func = transfer;
+    if (V4L2_TYPE_IS_CAPTURE (v4l2object->type))
+      format.fmt.pix_mp.flags |= V4L2_PIX_FMT_FLAG_SET_CSC;
   } else {
     format.fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
     format.fmt.pix.colorspace = colorspace;
     format.fmt.pix.quantization = range;
     format.fmt.pix.ycbcr_enc = matrix;
     format.fmt.pix.xfer_func = transfer;
+    if (V4L2_TYPE_IS_CAPTURE (v4l2object->type))
+      format.fmt.pix.flags |= V4L2_PIX_FMT_FLAG_SET_CSC;
   }
 
   GST_DEBUG_OBJECT (v4l2object->dbg_obj, "Desired colorspace is %d:%d:%d:%d",