[gst-devel] downstream allocated buffers

Wim Taymans wim at fluendo.com
Wed Jan 12 08:53:20 CET 2005


On Wed, 2005-01-12 at 21:40 +0530, Thirupathiah Annapureddy wrote:
> Hi All,
> How can a downstream element can enforce the upstream peer to use its
> own buffers. For example, in the following pipeline
> filesrc -> custom decoder -> file sink
> I want the file src to read the data into the buffers allocated by the
> custom decoder. custom decoder allocates mmaped dmable buffers from
> the driver. This technique can reduce the memory copy overhead. how
> can we ensure that the filesrc always reads the data into the buffers
> allocated by the custom decoder?

This is currently not possible in GStreamer since filesrc is not able to
use a bufferpool from the peer pad so you will have to do a memcpy for
now.

I would like to see the old GstBufferPool resurected as it allows for
this kind of operations. It also allows for a single object managing a
limited amount of buffers (think video/audio buffers) with locking and
unlocking on state changes. The current _pad_alloc_buffer() function 
will automagically allocate a non-pool buffer if the peer pad does not
provide an alloc function, so using this technique in filesrc would
degrade the mmap performance again (unless mmap is actually slower than
read() nowadays...). 

So, ideally: filesrc tries to get bufferpool, if that fails it uses its
own allocator with mmap and subbuffers.

Wim

> 
> Thanks in advance,
> A. Thirupathi Reddy.
> 
> 
> -------------------------------------------------------
> The SF.Net email is sponsored by: Beat the post-holiday blues
> Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
> It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
-- 
Wim Taymans <wim at fluendo.com>





More information about the gstreamer-devel mailing list