pub struct BFrameReorderBuffer { /* private fields */ }Expand description
B-frame reorder buffer.
Accepts frames in PTS order and emits ReadyFrames in decode order with
computed DTS values.
§Reorder algorithm (simplified)
Frames are collected into groups of pictures (GOPs). Within each GOP a
run of B frames is deferred until its anchor P/I frame has been output.
DTS is assigned as a monotonically increasing counter starting from the
smallest PTS seen, offset back by max_b_frames * min_dts_delta to ensure
DTS ≤ PTS for every frame.
Implementations§
Source§impl BFrameReorderBuffer
impl BFrameReorderBuffer
Sourcepub fn new(config: ReorderConfig) -> Self
pub fn new(config: ReorderConfig) -> Self
Create a new reorder buffer with the given configuration.
Sourcepub fn default_config() -> Self
pub fn default_config() -> Self
Create with default configuration.
Sourcepub fn push(&mut self, frame: QueuedFrame)
pub fn push(&mut self, frame: QueuedFrame)
Push a frame in PTS / display order.
The buffer will internally decide when to emit frames in decode order.
Sourcepub fn pop(&mut self) -> Option<ReadyFrame>
pub fn pop(&mut self) -> Option<ReadyFrame>
Pop the next ReadyFrame in decode order, or None if none are ready.
Sourcepub fn pending_len(&self) -> usize
pub fn pending_len(&self) -> usize
Number of frames still buffered (not yet emitted).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BFrameReorderBuffer
impl RefUnwindSafe for BFrameReorderBuffer
impl Send for BFrameReorderBuffer
impl Sync for BFrameReorderBuffer
impl Unpin for BFrameReorderBuffer
impl UnsafeUnpin for BFrameReorderBuffer
impl UnwindSafe for BFrameReorderBuffer
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