GNOME Bugzilla – Bug 694804
bufferpool: No way to override acquire_buffer to chose a sensible buffer
Last modified: 2018-05-04 09:34:33 UTC
The buffer always has to be returned from the default implementation of acquire_buffer currently because that handles bookkeeping of the internal GstBufferPool state. Also there's no way to get a list of all buffers that are currently there. The documentation of GstBufferPoolAcquireParams however mentions that custom implementations of acquire_buffer could use the information of the params to chose a specific buffer.
Created attachment 238764 [details] [review] bufferpool: Allow subclasses to access the queue of buffers
The idea is that you need to overwrite the acquire and release methods and implement your own g_queue and signaling if you want something else.
I guess my biggest problem is that the pool is now not atomic anymore.
Does that really matter? I don't see how we could allow subclasses to do anything useful in acquire without making the pool not-atomic.
(In reply to comment #4) > Does that really matter? It does to me > > I don't see how we could allow subclasses to do anything useful in acquire > without making the pool not-atomic. some options: - You override the acquire, release and stop methods and take a buffer from your own queue/array/whatever you use to implement the pool. We need to make do_alloc_buffer() public. - Implement a method to iterate the queue buffers to filter out a buffer that you want. What exactly would you want to do with the buffers from atomic queue?
(In reply to comment #5) > > I don't see how we could allow subclasses to do anything useful in acquire > > without making the pool not-atomic. > > some options: > > - You override the acquire, release and stop methods and take a buffer from > your own queue/array/whatever you use to implement the pool. We need to make > do_alloc_buffer() public. That would be possible, yes. > - Implement a method to iterate the queue buffers to filter out a buffer that > you want. I don't think that's possible with the atomic queue without making it non-atomic. > What exactly would you want to do with the buffers from atomic queue? In gst-omx I need to acquire a very specific buffer from the pool.
Comment on attachment 238764 [details] [review] bufferpool: Allow subclasses to access the queue of buffers Let's just add get_buffer() and put_buffer() vfuncs to the pool, for which the default implementation just uses the atomic queue If someone ever needs that, I don't anymore ;)
It seems no one else has needed it in 5 years, so let's close this unless someone plan to commit it.