[gst-devel] question about the buffer pool (in directdraw sink, e.g.)

Julien Moutte julien at moutte.net
Wed Nov 14 16:05:50 CET 2007


The idea behind buffer pools is to not free/allocate memory all the
time.

Once you have allocated a video memory or system memory buffer for a
frame and the next frame has the same format you can use that same
buffer. Buffer pools allow you to get into a situation where you
allocate 2 or 3 buffers and then they are rotated to store the decoded
video frames directly in the decoder without ever freeing/reallocating
them.

That can bring a performance improvement.

Additionally when you are allocating buffer from video memory this gets
even nicer because that gives a chance to the decoders to decompress
frames directly in video memory skipping a precious memcpy (moreover
when doing HD).

If you are planning to modify the buffer with EVAS functions then the
buffer pool probably doesn't make a lot of sense as they will probably
reallocate memory. It really depends on the EVAS implementation wether
or not bufferpools will be useful.

Hope this helps.

cheers,

Julien

On Wed, 2007-11-14 at 13:40 +0100, Vincent Torri wrote:
> Hey,
> 
> I'm trying to write a sink for Evas [1]. I'm looking at how directdrawsink 
> is managing the surfaces.
> 
> Like ximagesink, it uses a buffer pool. My question is about the function 
> gst_ddrawsurface_finalize(). Note that I don't understand really what the 
> interest of the buffer pool is.
> 
> So, in that function, if the format changed, that is, the width, the 
> height, the ddraw pixel format changed or the surface is lost, then the 
> surface is destroyed and is set to NULL. Otherwise one appends the surface 
> to the pool.
> 
> In the case of evas, I have an Evas_Object instead of a ddraw surface. 
> Consider it as a struct with the data, the size, the colorspace etc... I 
> have methods to resize it and to change the colorspace (which is 
> sufficient for me). I can do that without having to destroy the Evas_Object.
> 
> My questions are : do I need a buffer pool ? If so, in my _finalize() 
> function, should I just modify my Evas_Object (that is, resize it and 
> change its colorspace) and add it to the pool ?
> 
> thank you
> 
> Vincent Torri
> 
> [1] http://www.enlightenment.org
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




More information about the gstreamer-devel mailing list