bufferpool: is it possible wait all memory writalbe, nor free the buffer?

Bing Song Kevin.Song at freescale.com
Fri Jan 9 01:32:41 PST 2015


Thanks.

I know the methods can fix my issue. But free and allocate buffer in video buffer pool isn't expect behave in some use case. Is it valuable to implement the feature in gstbufferpool.c?

Regards,
Song Bing.

-----Original Message-----
From: gstreamer-devel [mailto:gstreamer-devel-bounces at lists.freedesktop.org] On Behalf Of Sebastian Dr?ge
Sent: Friday, January 09, 2015 4:45 PM
To: Discussion of the development of and with GStreamer
Subject: Re: bufferpool: is it possible wait all memory writalbe, nor free the buffer?

On Fr, 2015-01-09 at 03:41 +0000, Bing Song wrote:
> Hi,
> 
> Below code in default_release_buffer() in gstbufferpool.c will free buffer.
> 
>   /* all memory should be exclusive to this buffer (and thus be writable) */
>   if (G_UNLIKELY (!gst_buffer_is_all_memory_writable (buffer))) goto 
> not_writable;
> 
> Is it possible to add one feature to wait until all memory writable?
> 
> Our use case need buffers in video buffer pool are fixed, can't free and allocate during PLAYING. As camera has two video pipeline (viewfinder and video recording), it will free buffer as the memory isn't writable. The memory is used by another gstbuffer when gstbuffer copy.

You could implement some kind of pooling logic inside your GstAllocator.
GstBufferPool would then try to allocate new memory from that allocator and could block as long as you want.

Alternatively you could of course also override
GstBufferPool::release_buffer() and do whatever is needed there.

Or make sure that the memory of your buffers can't be shared with any other buffers.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com


More information about the gstreamer-devel mailing list