Skip to main content

JitterBuffer

Struct JitterBuffer 

Source
pub struct JitterBuffer<T> { /* private fields */ }

Implementations§

Source§

impl<T> JitterBuffer<T>

Source

pub fn new(decoder: Box<dyn Decodable<Frame = T>>) -> Self

Source

pub fn buffered_frames_len(&self) -> usize

Returns the current number of frames buffered and waiting in the jitter buffer.

Source

pub fn insert_frame(&mut self, frame: VideoFrame, arrival_time_ms: u128)

The main entry point for a new frame arriving from the network.

Source

pub fn find_and_move_continuous_frames(&mut self, current_time_ms: u128)

Checks the buffered frames and moves any continuous frames to the decodable queue.

Source

pub fn is_waiting_for_keyframe(&self) -> bool

Checks if the jitter buffer is currently waiting for a keyframe to continue.

Source

pub fn drop_all_frames(&mut self)

Removes all frames from the buffer. Used when a keyframe arrives and the buffer is full.

Source

pub fn flush(&mut self)

Flushes the jitter buffer, resetting its state completely.

Source

pub fn get_jitter_estimate_ms(&self) -> f64

Source

pub fn get_target_playout_delay_ms(&self) -> f64

Source

pub fn get_dropped_frames_count(&self) -> u64

Auto Trait Implementations§

§

impl<T> Freeze for JitterBuffer<T>

§

impl<T> !RefUnwindSafe for JitterBuffer<T>

§

impl<T> Send for JitterBuffer<T>

§

impl<T> Sync for JitterBuffer<T>

§

impl<T> Unpin for JitterBuffer<T>

§

impl<T> UnsafeUnpin for JitterBuffer<T>

§

impl<T> !UnwindSafe for JitterBuffer<T>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.