pub trait FramePool {
type Descriptor;
// Required methods
fn coded_resolution(&self) -> Resolution;
fn set_coded_resolution(&mut self, resolution: Resolution);
fn add_frames(
&mut self,
descriptors: Vec<Self::Descriptor>,
) -> Result<(), Error>;
fn num_free_frames(&self) -> usize;
fn num_managed_frames(&self) -> usize;
fn clear(&mut self);
}
Expand description
Trait for a pool of frames in a particular format.
This is mostly useful for the decoder where the user is expected to manage how the decoded frames buffers are allocated and when.
Required Associated Types§
Sourcetype Descriptor
type Descriptor
Type of descriptor for the memory backing the frames.
Required Methods§
Sourcefn coded_resolution(&self) -> Resolution
fn coded_resolution(&self) -> Resolution
Returns the coded resolution of the pool.
All the frames maintained by this pool are guaranteed to be able to contain the coded resolution.
Sourcefn set_coded_resolution(&mut self, resolution: Resolution)
fn set_coded_resolution(&mut self, resolution: Resolution)
Update the coded resolution of the pool.
Frames managed by this pool that can not contain the new resolution are dropped.
Sourcefn add_frames(
&mut self,
descriptors: Vec<Self::Descriptor>,
) -> Result<(), Error>
fn add_frames( &mut self, descriptors: Vec<Self::Descriptor>, ) -> Result<(), Error>
Add new frames to the pool, using descriptors
as backing memory.
Sourcefn num_free_frames(&self) -> usize
fn num_free_frames(&self) -> usize
Returns new number of frames currently available in this pool.
Sourcefn num_managed_frames(&self) -> usize
fn num_managed_frames(&self) -> usize
Returns the total number of managed frames in this pool.