pub struct VideoFramePool { /* private fields */ }Expand description
Thread-safe (native) or single-threaded (wasm32) bounded reusable CPU RGBA8 video frame pool.
Implementations§
Source§impl VideoFramePool
Bounded zero-allocation steady-state buffer acquisition and recycling for VideoFramePool.
impl VideoFramePool
Bounded zero-allocation steady-state buffer acquisition and recycling for VideoFramePool.
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Sourcepub fn acquire(&self, width: u32, height: u32) -> Option<PooledVideoFrame>
pub fn acquire(&self, width: u32, height: u32) -> Option<PooledVideoFrame>
Acquires a reusable RGBA8 frame buffer sized for width x height, returning None when bounded capacity is exhausted.
§Arguments
&Self- Pool reference.u32- Frame width in pixels.u32- Frame height in pixels.
§Returns
Option<PooledVideoFrame>- Reusable frame buffer orNoneunder bounded backpressure.
Sourcepub fn recycle(&self, frame: PooledVideoFrame)
pub fn recycle(&self, frame: PooledVideoFrame)
Returns a checked-out CPU video frame buffer back into the bounded pool for zero-allocation reuse.
§Arguments
&Self- Pool reference.PooledVideoFrame- Frame buffer to recycle.
Sourcepub fn recycle_decoded_frame(&self, frame: DecodedVideoFrame)
pub fn recycle_decoded_frame(&self, frame: DecodedVideoFrame)
Recycles the CPU pixel buffer inside a DecodedVideoFrame when backed by VideoFrameBacking::CpuPooled.
§Arguments
&Self- Pool reference.DecodedVideoFrame- Frame whose backing should be reclaimed if CPU-pooled.
Sourcepub fn stats(&self) -> VideoFramePoolStats
pub fn stats(&self) -> VideoFramePoolStats
Trait Implementations§
Source§impl Clone for VideoFramePool
impl Clone for VideoFramePool
Source§impl Debug for VideoFramePool
impl Debug for VideoFramePool
Auto Trait Implementations§
impl Forget for VideoFramePool
impl Freeze for VideoFramePool
impl Move for VideoFramePool
impl RefUnwindSafe for VideoFramePool
impl Send for VideoFramePool
impl Sync for VideoFramePool
impl Unpin for VideoFramePool
impl UnsafeUnpin for VideoFramePoolwhere
*const ArcInner<Mutex<VideoFramePoolState>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<VideoFramePoolState>>>: UnsafeUnpin,
impl UnwindSafe for VideoFramePool
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