v4l2object: Fix translation of quantization

The V4L2_MAP_QUANTIZATION macro has been fixed to something a lot saner,
fix our replica accordingly. The new macro now simply set the quantization
to full range is the pixel formats is RGB based, or if the JPEG
colorspace is used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7284>
This commit is contained in:
Nicolas Dufresne 2024-07-29 11:37:29 -04:00 committed by Backport Bot
parent 0a2f3fbb9e
commit 8c881e833c

View file

@ -2342,11 +2342,7 @@ gst_v4l2_object_get_colorspace (GstV4l2Object * v4l2object,
break;
case V4L2_QUANTIZATION_DEFAULT:
/* replicated V4L2_MAP_QUANTIZATION_DEFAULT macro behavior */
if (is_rgb && colorspace == V4L2_COLORSPACE_BT2020)
cinfo->range = GST_VIDEO_COLOR_RANGE_16_235;
else if (is_rgb || matrix == V4L2_YCBCR_ENC_XV601
|| matrix == V4L2_YCBCR_ENC_XV709
|| colorspace == V4L2_COLORSPACE_JPEG)
if (is_rgb || colorspace == V4L2_COLORSPACE_JPEG)
cinfo->range = GST_VIDEO_COLOR_RANGE_0_255;
else
cinfo->range = GST_VIDEO_COLOR_RANGE_16_235;