Sfoglia il codice sorgente

Merge branch 'CR_7333_gstv4l2_support_bt709_colorimetry_variant_Leo.Lu' into 'jh7110-mm-devel'

CR_7333_gstv4l2_support_bt709_colorimetry_variant_Leo.Lu

See merge request sdk/buildroot!130
andy.hu 8 mesi fa
parent
commit
f1e8bfd3b0

+ 28 - 0
package/gstreamer1/gst1-plugins-good/0001-v4l2object-support-bt709-colorimetry-variant.patch

@@ -0,0 +1,28 @@
+v4l2object: support for Apple's full-range bt709 colorimetry variant 1:3:5:1
+
+Signed-off-by: Leo Lu <leo.lu@starfivetech.com>
+
+--- a/sys/v4l2/gstv4l2object.c	2023-09-04 14:28:13.336536474 +0800
++++ b/sys/v4l2/gstv4l2object.c	2023-09-04 14:26:46.964215199 +0800
+@@ -2394,6 +2394,21 @@ gst_v4l2_object_add_colorspace (GstV4l2O
+       if (colorspace == req_cspace) {
+         if (gst_v4l2_object_get_colorspace (v4l2object, &fmt, &cinfo))
+           gst_v4l2_object_fill_colorimetry_list (&list, &cinfo);
++        
++        if (colorspace == V4L2_COLORSPACE_REC709) {
++          /* support for full-range variants of colorspaces V4L2_COLORSPACE_REC709
++           * (such as Apple's full-range bt709 variant 1:3:5:1) */
++          struct v4l2_format alt_fmt;
++          memcpy (&alt_fmt, &fmt, sizeof (alt_fmt));
++
++          if (V4L2_TYPE_IS_MULTIPLANAR (v4l2object->type))
++            alt_fmt.fmt.pix_mp.quantization = V4L2_QUANTIZATION_FULL_RANGE;
++          else
++            alt_fmt.fmt.pix.quantization = V4L2_QUANTIZATION_FULL_RANGE;
++
++          if (gst_v4l2_object_get_colorspace (v4l2object, &alt_fmt, &cinfo))
++            gst_v4l2_object_fill_colorimetry_list (&list, &cinfo);
++        }
+       }
+     }
+   }