Question about GstBuffer and GstMapInfo

Eric Trousset etrousset at awox.com
Tue Oct 8 06:53:49 PDT 2013


Thx for the info

From: Wim Taymans [mailto:wim.taymans at gmail.com]
Sent: mardi 8 octobre 2013 15:39
To: Discussion of the development of and with GStreamer
Cc: gstreamer-devel at lists.freedesktop.org
Subject: Re: Question about GstBuffer and GstMapInfo



On Tue, Oct 8, 2013 at 3:35 PM, Eric Trousset <etrousset at awox.com<mailto:etrousset at awox.com>> wrote:

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)?

Yes, you must resize explicitly, changing the mapinfo size does nothing.

Wim



Eric


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


More information about the gstreamer-devel mailing list