GstBufferPool

A #GstBufferPool is an object that can be used to pre-allocate and recycle buffers of the same size and with the same properties.

A #GstBufferPool is created with gst.buffer_pool.BufferPool.new_.

Once a pool is created, it needs to be configured. A call to gst.buffer_pool.BufferPool.getConfig returns the current configuration structure from the pool. With gst.buffer_pool.BufferPool.configSetParams and gst.buffer_pool.BufferPool.configSetAllocator the bufferpool parameters and allocator can be configured. Other properties can be configured in the pool depending on the pool implementation.

A bufferpool can have extra options that can be enabled with gst.buffer_pool.BufferPool.configAddOption. The available options can be retrieved with gst.buffer_pool.BufferPool.getOptions. Some options allow for additional configuration properties to be set.

After the configuration structure has been configured, gst.buffer_pool.BufferPool.setConfig updates the configuration in the pool. This can fail when the configuration structure is not accepted.

After the pool has been configured, it can be activated with gst.buffer_pool.BufferPool.setActive. This will preallocate the configured resources in the pool.

When the pool is active, gst.buffer_pool.BufferPool.acquireBuffer can be used to retrieve a buffer from the pool.

Buffers allocated from a bufferpool will automatically be returned to the pool with gst.buffer_pool.BufferPool.releaseBuffer when their refcount drops to 0.

The bufferpool can be deactivated again with gst.buffer_pool.BufferPool.setActive. All further gst.buffer_pool.BufferPool.acquireBuffer calls will return an error. When all buffers are returned to the pool they will be freed.

Members

Variables

GstReserved
void*[4] GstReserved;
flushing
int flushing;

whether the pool is currently gathering back outstanding buffers

object
GstObject object;

the parent structure

priv
GstBufferPoolPrivate* priv;