GNOME Bugzilla – Bug 787160
Backport patch for 4K colorimetry BT2020_12 selection needs >= 2160 in height check
Last modified: 2017-09-06 15:38:05 UTC
[PATCH] v4l2: Fix 4K colorimetry + +Since 1.6, the transfer function for BT2020 has been changed from BT709 +to BT2020_12. It's the same function, but with more precision. As a side +effect, the V4L2 colorpsace didn't match GStreamer colorspace. When +GStreamer ended up making a guess, it would not match anything supported +by V4L2 anymore. This this by using BT2020_12 for BT2020 colorspace and +BT2020 transfer function in replacement of BT709 whenever a 4K +resolution is detected. +@@ -2062,7 +2062,10 @@ gst_v4l2_object_get_colorspace (struct v4l2_format *fmt, + + switch (transfer) { + case V4L2_XFER_FUNC_709: +- cinfo->transfer = GST_VIDEO_TRANSFER_BT709; ++ if (fmt->fmt.pix.height > 2160) ++ cinfo->transfer = GST_VIDEO_TRANSFER_BT2020_12; ++ else ++ cinfo->transfer = GST_VIDEO_TRANSFER_BT709; + break; This height comparison should be >= 2160.
Created attachment 359188 [details] [review] Fix colorimetry transfer lookup for 4K video Signed-off-by: Ian Jamison <ian.dev@arkver.com>
Commited as fc5d9c34a74ee6fc7f533f19e88831e306db698d with small nodification in the comment. Note that we add some context (in this case we prefix the title with v4l2object:) and we also don't use Signed-off-By in this project unless there is multiple authors.
Also in 1.12