Struct gstreamer::BufferPool[]

pub struct BufferPool(_, _);

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

A BufferPool is created with BufferPool::new.

Once a pool is created, it needs to be configured. A call to BufferPool::get_config returns the current configuration structure from the pool. With BufferPool::config_set_params and BufferPool::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 BufferPool::config_add_option. The available options can be retrieved with BufferPoolExt::get_options. Some options allow for additional configuration properties to be set.

After the configuration structure has been configured, BufferPool::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 BufferPoolExt::set_active. This will preallocate the configured resources in the pool.

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

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

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

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

Implements

BufferPoolExt, GstObjectExt, glib::object::ObjectExt

Methods

impl BufferPool
[src]

Creates a new BufferPool instance.

Returns

a new BufferPool instance

Trait Implementations

impl Clone for BufferPool

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Hash for BufferPool

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Ord for BufferPool

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl StaticType for BufferPool

Returns the type identifier of Self.

impl<T: IsA<Object>> PartialEq<T> for BufferPool

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for BufferPool

impl<T: IsA<Object>> PartialOrd<T> for BufferPool

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Debug for BufferPool

Formats the value using the given formatter. Read more

impl IsA<Object> for BufferPool

impl IsA<Object> for BufferPool

impl Send for BufferPool
[src]

impl Sync for BufferPool
[src]

impl Default for BufferPool
[src]

Returns the "default value" for a type. Read more