Trait gstreamer::BufferPoolExtManual
source · [−]pub trait BufferPoolExtManual: 'static {
fn config(&self) -> BufferPoolConfig;
fn set_config(&self, config: BufferPoolConfig) -> Result<(), BoolError>;
fn is_flushing(&self) -> bool;
fn acquire_buffer(
&self,
params: Option<&BufferPoolAcquireParams>
) -> Result<Buffer, FlowError>;
fn release_buffer(&self, buffer: Buffer);
}
Required methods
fn config(&self) -> BufferPoolConfig
fn config(&self) -> BufferPoolConfig
Gets a copy of the current configuration of the pool. This configuration
can be modified and used for the set_config()
call.
Returns
a copy of the current configuration of self
.
fn set_config(&self, config: BufferPoolConfig) -> Result<(), BoolError>
fn set_config(&self, config: BufferPoolConfig) -> Result<(), BoolError>
Sets the configuration of the pool. If the pool is already configured, and
the configuration hasn’t changed, this function will return true
. If the
pool is active, this method will return false
and active configuration
will remain. Buffers allocated from this pool must be returned or else this
function will do nothing and return false
.
config
is a Structure
that contains the configuration parameters for
the pool. A default and mandatory set of parameters can be configured with
gst_buffer_pool_config_set_params()
, gst_buffer_pool_config_set_allocator()
and gst_buffer_pool_config_add_option()
.
If the parameters in config
can not be set exactly, this function returns
false
and will try to update as much state as possible. The new state can
then be retrieved and refined with config()
.
This function takes ownership of config
.
config
Returns
true
when the configuration could be set.
fn is_flushing(&self) -> bool
fn acquire_buffer(
&self,
params: Option<&BufferPoolAcquireParams>
) -> Result<Buffer, FlowError>
fn acquire_buffer(
&self,
params: Option<&BufferPoolAcquireParams>
) -> Result<Buffer, FlowError>
Acquires a buffer from self
. buffer
should point to a memory location that
can hold a pointer to the new buffer.
params
can contain optional parameters to influence the allocation.
params
parameters.
Returns
a FlowReturn
such as FlowReturn::Flushing
when the pool is
inactive.
buffer
a location for a Buffer
fn release_buffer(&self, buffer: Buffer)
fn release_buffer(&self, buffer: Buffer)
Releases buffer
to self
. buffer
should have previously been allocated from
self
with acquire_buffer()
.
This function is usually called automatically when the last ref on buffer
disappears.
buffer
a Buffer