After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 796940 - v4l2: can't cope with 1:4:0:0 colorimetry from jpegdec
v4l2: can't cope with 1:4:0:0 colorimetry from jpegdec
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.14.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-08-09 16:47 UTC by Philipp Zabel
Modified: 2018-08-21 16:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
v4l2object: stop V4L2 from zeroing extended colorimetry (1.01 KB, patch)
2018-08-09 16:47 UTC, Philipp Zabel
committed Details | Review
v4l2object: improve colorspace handling for JPEG sources (3.99 KB, patch)
2018-08-09 16:47 UTC, Philipp Zabel
committed Details | Review
v4l2object: fix typo in comment (889 bytes, patch)
2018-08-09 16:49 UTC, Philipp Zabel
committed Details | Review
v4l2object: complete colorspace info in debug log (1.98 KB, patch)
2018-08-09 16:50 UTC, Philipp Zabel
committed Details | Review

Description Philipp Zabel 2018-08-09 16:47:20 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.
Comment 1 Philipp Zabel 2018-08-09 16:47:54 UTC
Created attachment 373292 [details] [review]
v4l2object: improve colorspace handling for JPEG sources
Comment 2 Philipp Zabel 2018-08-09 16:49:11 UTC
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)
Comment 3 Philipp Zabel 2018-08-09 16:50:33 UTC
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.
Comment 4 Nicolas Dufresne (ndufresne) 2018-08-19 21:03:14 UTC
I'm sorry, I just never notice this subtle backward compatibility hack before. Indeed we should set the magic priv.
Comment 5 Nicolas Dufresne (ndufresne) 2018-08-21 15:58:36 UTC
Review of attachment 373291 [details] [review]:

lgtm
Comment 6 Nicolas Dufresne (ndufresne) 2018-08-21 16:00:12 UTC
Review of attachment 373292 [details] [review]:

lgtm
Comment 7 Nicolas Dufresne (ndufresne) 2018-08-21 16:00:46 UTC
Review of attachment 373293 [details] [review]:

lgtm
Comment 8 Nicolas Dufresne (ndufresne) 2018-08-21 16:01:19 UTC
Review of attachment 373294 [details] [review]:

lgtm
Comment 9 Nicolas Dufresne (ndufresne) 2018-08-21 16:03:40 UTC
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
Comment 10 Nicolas Dufresne (ndufresne) 2018-08-21 16:09:34 UTC
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