Skip to main content

PtsFrameQueue

Struct PtsFrameQueue 

Source
pub struct PtsFrameQueue { /* private fields */ }
Expand description

Bounded presentation-timestamp-ordered decoded frame queue supporting B-frame reordering and generation-tagged seek draining.

Implementations§

Source§

impl PtsFrameQueue

Bounded PTS-ordered insertion, seek-generation draining, and due-frame retrieval for PtsFrameQueue.

Source

pub fn with_capacity(capacity: usize) -> Self

Creates a bounded PtsFrameQueue retaining at most capacity decoded frames.

§Arguments
  • usize - Maximum queued frame count (>= 1).
§Returns
  • Self - Empty bounded queue.
Source

pub fn is_full(&self) -> bool

Returns true when the queue is at its bounded capacity.

§Arguments
  • &Self - Queue reference.
§Returns
  • bool - true when len() >= capacity.
Source

pub fn len(&self) -> usize

Returns the number of frames currently buffered in the queue.

§Arguments
  • &Self - Queue reference.
§Returns
  • usize - Queued frame count.
Source

pub fn is_empty(&self) -> bool

Returns true when no frames are queued.

§Arguments
  • &Self - Queue reference.
§Returns
  • bool - true iff empty.
Source

pub fn push_ordered( &mut self, frame: DecodedVideoFrame, ) -> Option<DecodedVideoFrame>

Inserts frame in ascending pts_us order (reordering B-frames automatically), returning Some(frame) if the bounded queue is full.

§Arguments
  • &Self - Mutable PTS queue.
  • DecodedVideoFrame - Frame to insert.
§Returns
  • Option<DecodedVideoFrame> - None when inserted, or Some(frame) when queue is at bounded capacity.
Source

pub fn peek_front_pts_us(&self) -> Option<i64>

Peeks the earliest presentation timestamp currently waiting at the front of the queue.

§Arguments
  • &Self - Queue reference.
§Returns
  • Option<i64> - Front frame PTS in microseconds, if any.
Source

pub fn has_stale_generation(&self, active_generation: u64) -> bool

Returns true when at least one buffered frame has a generation different from active_generation.

§Arguments
  • &Self - Queue reference.
  • u64 - Active seek generation.
§Returns
  • bool - true when stale-generation frames are present.
Source

pub fn drain_stale_generations( &mut self, active_generation: u64, pool: &VideoFramePool, ) -> usize

Removes and recycles every queued frame whose generation != active_generation in place with zero heap allocations.

§Arguments
  • &Self - Mutable PTS queue.
  • u64 - Active seek generation.
  • &VideoFramePool - Pool receiving recycled CPU buffers.
§Returns
  • usize - Number of stale frames drained.
Source

pub fn clear_and_recycle(&mut self, pool: &VideoFramePool)

Drains all queued frames and recycles any CPU-pooled buffers back into pool while preserving queue capacity.

§Arguments
  • &Self - Mutable PTS queue.
  • &VideoFramePool - Pool receiving recycled CPU buffers.
Source§

impl PtsFrameQueue

Source

pub fn get_capacity(&self) -> usize

Source

pub fn get_mut_capacity(&mut self) -> &mut usize

Source

pub fn set_capacity(&mut self, val: usize) -> &mut Self

Source

pub fn get_frames(&self) -> &VecDeque<DecodedVideoFrame>

Source

pub fn get_mut_frames(&mut self) -> &mut VecDeque<DecodedVideoFrame>

Source

pub fn set_frames(&mut self, val: VecDeque<DecodedVideoFrame>) -> &mut Self

Source

pub fn get_stale_generation_drops(&self) -> u64

Source

pub fn get_mut_stale_generation_drops(&mut self) -> &mut u64

Source

pub fn set_stale_generation_drops(&mut self, val: u64) -> &mut Self

Trait Implementations§

Source§

impl Clone for PtsFrameQueue

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PtsFrameQueue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PtsFrameQueue

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.