GNOME Bugzilla – Bug 796940
v4l2: can't cope with 1:4:0:0 colorimetry from jpegdec
Last modified: 2018-08-21 16:09:44 UTC
Created attachment 373291 [details] [review] v4l2object: stop V4L2 from zeroing extended colorimetry 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 in gst_v4l2_object_set_format_full, 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 The attached patches make v4l2object select 1:4:7:1 colorimetry in this case because V4L2 doesn't have a concept of unknown colorspace or transfer function, fix the S_FMT invocation for non-mplane queues to actually set the extended colorimetry attributes, and loosen the matching so that 1:4:0:0 input is accepted in case the queue format is set to 1:4:7:1.
Created attachment 373292 [details] [review] v4l2object: improve colorspace handling for JPEG sources
Created attachment 373293 [details] [review] v4l2object: fix typo in comment (not relevant to the bug in question, just noticed it while looking at gst_v4l2_object_set_format_full)
Created attachment 373294 [details] [review] v4l2object: complete colorspace info in debug log Not sure if we want this, but it took this change to make me notice that V4L2_PIX_FMT_PRIV_MAGIC wasn't set.
I'm sorry, I just never notice this subtle backward compatibility hack before. Indeed we should set the magic priv.
Review of attachment 373291 [details] [review]: lgtm
Review of attachment 373292 [details] [review]: lgtm
Review of attachment 373293 [details] [review]: lgtm
Review of attachment 373294 [details] [review]: lgtm
Attachment 373292 [details] pushed as 02d3f97 - v4l2object: improve colorspace handling for JPEG sources Attachment 373293 [details] pushed as 91dd9c1 - v4l2object: fix typo in comment Attachment 373294 [details] pushed as 00143ca - v4l2object: complete colorspace info in debug log Was not picked by git bz: commit 9595fd08e3487214b6f9551f74374e09a5e7a1f7 Author: Philipp Zabel <p.zabel@pengutronix.de> Date: Thu Aug 9 17:24:35 2018 +0200 v4l2object: stop V4L2 from zeroing extended colorimetry for non-mplane Setting the priv field to a magic value stops V4L2 core from zeroing the extended colorimetry fields quantization, ycbcr_enc, and xfer_func for non-mplane queues. https://bugzilla.gnome.org/show_bug.cgi?id=796940
Now in 1.14. remote: sending e-mail for d1cbf59fe460dc4896355a7d62671209f6f030ce remote: sending e-mail for 520e78c85ae187f6bf3e88a8ae5fbc0cc1f8eefb remote: sending e-mail for ca561ac781add7bc1aa627da12e32667328d668b remote: sending e-mail for ab1f4cc853b35cb06446fe9df8b58b38cfbb71b9