Question about GstBuffer and GstMapInfo

Eric Trousset etrousset at awox.com
Tue Oct 8 06:35:44 PDT 2013


Hi,
As I understand the GstMapInfo, I get one using gst_buffer_map on a GstBuffer using the GST_MAP_READWRITE.  I can then modify the buffer data thru the MapInfo.data. And then commit the changes using gst_buffer_unmap.

But, when modifying the mapinfo.size field, it seems this isn't committed when unmapped.
And if we can call gst_buffer_resize() on a buffer that have been mapped, the MapInfo then becomes inconsistent.

So when modifying both the data content and the size, how one should proceed?

Let say I need to process the data and that the result has x less bytes ...

Should I :

Map the buffer
Process the data
Unmap
Call gst_buffer_resize

Or

Should I :
Map the buffer
Process the data
Update the size in the map
Unmap


The second seems more logical to me, but the API seem to work in the first way (Am I right)?

Eric


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20131008/d5f97eeb/attachment-0001.html>


More information about the gstreamer-devel mailing list