pub struct FramePool { /* private fields */ }Expand description
Frame pool for reusing frame allocations.
This is a placeholder for integration with oximedia-core’s buffer pool.
Implementations§
Source§impl FramePool
impl FramePool
Sourcepub fn get_video_frame(
&mut self,
format: PixelFormat,
width: u32,
height: u32,
) -> VideoFrame
pub fn get_video_frame( &mut self, format: PixelFormat, width: u32, height: u32, ) -> VideoFrame
Get a video frame from the pool or create a new one.
Sourcepub fn return_video_frame(&mut self, frame: VideoFrame)
pub fn return_video_frame(&mut self, frame: VideoFrame)
Return a video frame to the pool.
Sourcepub fn get_audio_frame(
&mut self,
format: SampleFormat,
sample_rate: u32,
channels: ChannelLayout,
) -> AudioFrame
pub fn get_audio_frame( &mut self, format: SampleFormat, sample_rate: u32, channels: ChannelLayout, ) -> AudioFrame
Get an audio frame from the pool or create a new one.
Sourcepub fn return_audio_frame(&mut self, frame: AudioFrame)
pub fn return_audio_frame(&mut self, frame: AudioFrame)
Return an audio frame to the pool.
Sourcepub fn video_frame_count(&self) -> usize
pub fn video_frame_count(&self) -> usize
Get the number of video frames in the pool.
Sourcepub fn audio_frame_count(&self) -> usize
pub fn audio_frame_count(&self) -> usize
Get the number of audio frames in the pool.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FramePool
impl RefUnwindSafe for FramePool
impl Send for FramePool
impl Sync for FramePool
impl Unpin for FramePool
impl UnsafeUnpin for FramePool
impl UnwindSafe for FramePool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more