pub struct JitterBuffer { /* private fields */ }Expand description
Jitter buffer for RTP packet reordering and playout scheduling.
Implementations§
Source§impl JitterBuffer
impl JitterBuffer
Sourcepub fn new(config: JitterConfig) -> Self
pub fn new(config: JitterConfig) -> Self
Create a new jitter buffer with the given configuration.
Sourcepub fn push(&mut self, seq: u16, timestamp: u32, payload: Vec<u8>) -> bool
pub fn push(&mut self, seq: u16, timestamp: u32, payload: Vec<u8>) -> bool
Push a received RTP packet into the buffer.
Returns true if the packet was buffered, false if dropped.
Sourcepub fn pop(&mut self) -> Option<BufferedPacket>
pub fn pop(&mut self) -> Option<BufferedPacket>
Pop the next packet for playout, if ready.
Returns None if no packet is ready (still buffering or waiting for delay).
Sourcepub fn stats(&self) -> JitterStats
pub fn stats(&self) -> JitterStats
Get current statistics.
Sourcepub fn flush(&mut self) -> Vec<BufferedPacket>
pub fn flush(&mut self) -> Vec<BufferedPacket>
Flush all buffered packets.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JitterBuffer
impl RefUnwindSafe for JitterBuffer
impl Send for JitterBuffer
impl Sync for JitterBuffer
impl Unpin for JitterBuffer
impl UnsafeUnpin for JitterBuffer
impl UnwindSafe for JitterBuffer
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