Trait gstreamer::prelude::BufferPoolExt
source · pub trait BufferPoolExt: IsA<BufferPool> + Sealed + 'static {
// Provided methods
fn options(&self) -> Vec<GString> { ... }
fn has_option(&self, option: &str) -> bool { ... }
fn is_active(&self) -> bool { ... }
fn release_buffer(&self, buffer: Buffer) { ... }
fn set_active(&self, active: bool) -> Result<(), BoolError> { ... }
fn set_flushing(&self, flushing: bool) { ... }
}
Expand description
Provided Methods§
sourcefn has_option(&self, option: &str) -> bool
fn has_option(&self, option: &str) -> bool
sourcefn is_active(&self) -> bool
fn is_active(&self) -> bool
Checks if self
is active. A pool can be activated with the
set_active()
call.
§Returns
true
when the pool is active.
sourcefn release_buffer(&self, buffer: Buffer)
fn release_buffer(&self, buffer: Buffer)
Releases buffer
to self
. buffer
should have previously been allocated from
self
with BufferPoolExtManual::acquire_buffer()
.
This function is usually called automatically when the last ref on buffer
disappears.
§buffer
a Buffer
sourcefn set_active(&self, active: bool) -> Result<(), BoolError>
fn set_active(&self, active: bool) -> Result<(), BoolError>
Controls the active state of self
. When the pool is inactive, new calls to
BufferPoolExtManual::acquire_buffer()
will return with FlowReturn::Flushing
.
Activating the bufferpool will preallocate all resources in the pool based on the configuration of the pool.
Deactivating will free the resources again when there are no outstanding buffers. When there are outstanding buffers, they will be freed as soon as they are all returned to the pool.
§active
the new active state
§Returns
false
when the pool was not configured or when preallocation of the
buffers failed.
sourcefn set_flushing(&self, flushing: bool)
fn set_flushing(&self, flushing: bool)
Enables or disables the flushing state of a self
without freeing or
allocating buffers.
§flushing
whether to start or stop flushing