v4l2object: improve colorspace handling for JPEG sources
authorPhilipp Zabel <p.zabel@pengutronix.de>
Thu, 9 Aug 2018 13:08:59 +0000 (15:08 +0200)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Tue, 21 Aug 2018 16:01:41 +0000 (12:01 -0400)
commit02d3f9748bebac4c22e8dd33b55cf5dff8259d2a
treebbbaa6db19eee495f9dee5db4b2890af295850ee
parent9595fd08e3487214b6f9551f74374e09a5e7a1f7
v4l2object: improve colorspace handling for JPEG sources

gstjpegdec sets 1:4:0:0 colorimetry (full range BT.601 YCbCr encoding
with unknown primaries and unknown transfer function). This currently
gets translated to bt601 or bt709 depending on resolution.
Both cases result in a negotiation failure:

    ERROR: from element /GstPipeline:pipeline0/v4l2video0convert:v4l2video0convert0: Device '/dev/video0' does not support 1:4:0:0 colorimetry

Improve the guessing game by selecting JPEG colorimetry (JPEG colorspace
with sRGB transfer function) under these specific conditions, and loosen
the matching so that 1:4:0:0 input gets accepted if the device is
actually configured to 1:4:7:1 (V4L2_PIX_FMT_JPEG default).

https://bugzilla.gnome.org/show_bug.cgi?id=796940
sys/v4l2/gstv4l2object.c