[Bug 779524] buffer with video meta information do not support memory split buffers

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon Mar 6 11:24:03 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=779524

--- Comment #10 from Frediano Ziglio <fziglio at redhat.com> ---
Offsets are fine. If I made the same buffer contiguous with the same metadata
it works perfectly. Basically what Matthew said is true, plane must be aligned
(I would use the word contiguous but I'm not native English, maybe is the
same).

>From gst_video_frame_map documentation:

"The purpose of this function is to make it easy for you to get to the video
pixels in a generic way, without you having to worry too much about details
such as whether the video data is allocated in one contiguous memory chunk or
multiple memory chunks (e.g. one for each plane); or if custom strides and
custom plane offsets are used or not (as signalled by GstVideoMeta on each
buffer). This function will just fill the GstVideoFrame structure with the
right values and if you use the accessor macros everything will just work and
you can access the data easily. It also maps the underlying memory chunks for
you."

So the documentation state that not contiguous memory chunks are supported.
Yes, there is the plane example but it's just an example, not a constraint.
Also note that the memory problem happens way further from the called functions
and not contiguous supported happens depending on the state of the buffer.
Would be great if an error would be detected in default_map (testing and
notified from the code. default_map calls gst_buffer_map_range which is
supposed to handle not contiguous however don't pass the plane length.

What's the range of the plane ? [offset, offset + meta->height * meta->stride)
if stride is positive. Can stride be negative? Would the range be [offset +
meta->height * meta->stride, offset) or [offset + (meta->height-1) *
meta->stride, offset - meta->stride) ?

Looks like that no contiguous memory cause extra memory allocation and copies.
Would be worth documenting this so people can decide to do this by themselves
if more appropriate.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list