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 733501 - v4l2: Fully support v4l2_plane.data_offset
v4l2: Fully support v4l2_plane.data_offset
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Low minor
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-07-21 12:57 UTC by Nicolas Dufresne (ndufresne)
Modified: 2017-11-03 20:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
v4l2allocator: Add support for data_offset (9.83 KB, patch)
2017-11-03 19:36 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review

Description Nicolas Dufresne (ndufresne) 2014-07-21 12:57:25 UTC
This parameter is not well documented in V4L2 hence was not fully implemented. It's mostly implemented for DMABUF, but ignored for MMAP.

<hverkuil> 08:06:12> stormer: please don't ignore data_offset. You can test with this driver: http://git.linuxtv.org/cgit.cgi/hverkuil/media_tree.git/log/?h=vivid
<hverkuil> 08:06:23> modprobe vivid multiplanar=2
<hverkuil> 08:06:41> Select the NV16 pixformat and plane 0 will have a data_offset of 128.
<hverkuil> 08:07:00> for both input (video0) and output (video1).
<hverkuil> 08:07:52> remember: bytesused *includes* data_offset, so the actual size of the image is bytesused-data_offset.
Comment 1 Nicolas Dufresne (ndufresne) 2015-04-30 13:34:35 UTC
As all real drivers has been implementing it wrong (GStreamer is no different), upstream is reconsidering the part about bytesused. It may not include the offset anymore. No upstream driver except vivid is using this at the moment, and proprietary or out of tree drivers using it we found all missed that bytesused includes the offset.
Comment 2 Nicolas Dufresne (ndufresne) 2017-10-03 15:29:18 UTC
Ok, this is now implemented by Venus (Qualcomm 8016 / DB420c) for encoding VP8.
Comment 3 Nicolas Dufresne (ndufresne) 2017-11-03 19:36:42 UTC
Created attachment 362932 [details] [review]
v4l2allocator: Add support for data_offset

In MPLANE mode, the driver may set data_offset, which represent some
padding at the start of the buffer used internally. This portion of the
data need to be skipped, though it is included in bytesused.

This patch removes frame size sanity check as the method used will no
longer work. This check was simply there to help detect broken kernel
drivers. It would be re-implement by estimating the plane size, which is
not totally trivial and may be too much work for a simple debug check.
Comment 4 Nicolas Dufresne (ndufresne) 2017-11-03 20:21:16 UTC
Attachment 362932 [details] pushed as 57d7ae8 - v4l2allocator: Add support for data_offset