pub struct KeyframeGate { /* private fields */ }Available on crate feature
ingest only.Expand description
Gate that suppresses delta frames until the first IDR (keyframe) arrives, so late-joining or re-subscribing clients always start at a clean decoder boundary.
use arcly_stream::protocol::KeyframeGate;
use arcly_stream::FrameType;
let mut gate = KeyframeGate::new();
// A delta frame before any keyframe is held back:
assert!(!gate.admit(FrameType::Delta));
// The first keyframe opens the gate and is itself admitted:
assert!(gate.admit(FrameType::Key));
// Subsequent deltas now flow:
assert!(gate.admit(FrameType::Delta));
// Audio always flows (it carries no decode dependency on video IDRs):
assert!(KeyframeGate::new().admit(FrameType::Audio));Implementations§
Source§impl KeyframeGate
impl KeyframeGate
Trait Implementations§
Source§impl Debug for KeyframeGate
impl Debug for KeyframeGate
Source§impl Default for KeyframeGate
impl Default for KeyframeGate
Source§fn default() -> KeyframeGate
fn default() -> KeyframeGate
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for KeyframeGate
impl RefUnwindSafe for KeyframeGate
impl Send for KeyframeGate
impl Sync for KeyframeGate
impl Unpin for KeyframeGate
impl UnsafeUnpin for KeyframeGate
impl UnwindSafe for KeyframeGate
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