[gst-devel] Question on how to use GstBuffer?
Chen, Weian
weian.chen at intel.com
Sat Jan 9 11:24:07 CET 2010
Thanks a lot for your information/suggestion.
And I have made some experiments, and found that: I have to create new GstBuffer for every gst_pad_push() in _chain(), once the GstBuffer is used, it could not push data to downstream element successfully, the pipeline still keeps running, but the data in GstBuffer can’t be written into file.
Please note, I mean I need to create GstBuffer for each call of _chain(), but not the real buffer which will contain real data (GstBufer’s member variable ->data will point this buffer)
What’s the problem?
thanks,
Weian
________________________________
From: Clark, Rob [mailto:rob at ti.com]
Sent: 2010年1月9日 17:55
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] Question on how to use GstBuffer?
yes, there are a handful of examples of this.. look for example, in v4l2bufferpool.. xvimagesink, etc..
basically the principle is to subclass GstBuffer, provide your own finalize function that revives the buffer and returns it to your pool of buffers.
(random thought: really, it's a pattern seen in enough gst elements, that perhaps it would be nice to see a generic GstBufferPool class..)
BR,
-R
On Jan 7, 2010, at 8:56 PM, Chen, Weian wrote:
Hi All,
In my current element, I will create and new a GstBuffer (which means to use g_malloc to allocate buffer) in the _chain() function for each frame.
My question is: Can I allocate several buffers (ring buffers) ahead of time, then I can re-use them and don’t need to allocate buffer for each call of _chain, if yes, how?
Thanks in advanced.
Weian
------------------------------------------------------------------------------
This SF.Net<http://SF.Net> email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev _______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.sourceforge.net<mailto:gstreamer-devel at lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20100109/4bd41231/attachment.htm>
More information about the gstreamer-devel
mailing list