From: Nicolas Dufresne Date: Mon, 9 Apr 2018 00:42:16 +0000 (-0400) Subject: v4l2object: Only use BT2020_12 for BT2020 v4l2 colorspace X-Git-Tag: 1.16.2~594 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ebf8a6d0c06e6233f55dbbb1cdd75c7e3fb166da;p=platform%2Fupstream%2Fgst-plugins-good.git v4l2object: Only use BT2020_12 for BT2020 v4l2 colorspace BT2020_12 is not represented in V4L2, so drivers providing full colority for BT2020 will set V4L2_XFER_FUNC_709 transfer function. To fix the issue, we bump this to BT2020_12 if the resoltion is 4K, but we should only do that if the colorspace is BT2020 to start with, otherwise it's not possible to use normal BT709 for 4K 8bit formats. --- diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index 1b43e16..678f035 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -2083,7 +2083,7 @@ gst_v4l2_object_get_colorspace (struct v4l2_format *fmt, switch (transfer) { case V4L2_XFER_FUNC_709: - if (fmt->fmt.pix.height >= 2160) + if (colorspace == V4L2_COLORSPACE_BT2020 && fmt->fmt.pix.height >= 2160) cinfo->transfer = GST_VIDEO_TRANSFER_BT2020_12; else cinfo->transfer = GST_VIDEO_TRANSFER_BT709;