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

Sebastian Dröge sebastian at centricular.com
Fri Jan 9 00:44:58 PST 2015


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150109/75ba04d4/attachment-0001.sig>


More information about the gstreamer-devel mailing list