Gst.BufferPool

const Gst = imports.gi.Gst;

let buffer_pool = new Gst.BufferPool();
  

a Gst.BufferPool is an object that can be used to pre-allocate and recycle buffers of the same size and with the same properties.

A Gst.BufferPool is created with Gst.new.

After the buffer is created, it needs to be configured. Gst.get_config get the current configuration structure from the pool. With Gst.config_set_params and Gst.config_set_allocator 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.config_add_option. The available options can be retrieved with Gst.get_options. Some options allow for additional configuration properties to be set.

After the configuration structure has been configured, Gst.set_config updates the configuration in the pool. This can fail when the configuration structure is not accepted.

After the a pool has been configured, it can be activated with Gst.set_active. This will preallocate the configured resources in the pool.

When the pool is active, Gst.acquire_buffer can be used to retrieve a buffer from the pool.

Buffer allocated from a bufferpool will automatically be returned to the pool with Gst.release_buffer when their refcount drops to 0.

The bufferpool can be deactivated again with Gst.set_active. All further Gst.acquire_buffer calls will return an error. When all buffers are returned to the pool they will be freed.

Use Gst.unref to release the reference to a bufferpool. If the refcount of the pool reaches 0, the pool will be freed.

Last reviewed on 2012-03-28 (0.11.3)

Hierarchy

  • GObject.Object
    • GObject.InitiallyUnowned
      • Gst.Object
        • Gst.BufferPool