Skip to main content

JitterBufferDiscards

Struct JitterBufferDiscards 

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

The packets each remote stream’s jitter buffer discarded, shared by a jitter buffer and the XR generator: give the same handle to JitterBufferBuilder::with_discard_count (or AdaptiveJitterBufferBuilder::with_discard_count) and to XrReportBuilder::with_jitter_buffer_discards, and the VoIP Metrics block’s discard rate is the buffer’s (RFC 3611 section 4.7.1). Without it the generator reports 0, which is true only when nothing in the chain discards.

Counted per SSRC since the stream was bound: packets that arrived after their turn to be played out had passed, that a full buffer dropped, and that a stream restart (a timestamp discontinuity) dropped unplayed. A second copy of a packet, held or already played out, is not counted (“excluding duplicate packet discards”).

use rtci_interceptor::{
    JitterBufferBuilder, JitterBufferDiscards, Registry, Slot, XrReportBuilder,
};

let discards = JitterBufferDiscards::new();
let chain = Registry::new()
    .with(
        Slot::ExtendedReports,
        XrReportBuilder::new().with_jitter_buffer_discards(&discards).build(),
    )
    .with(
        Slot::JitterBuffer,
        JitterBufferBuilder::new().with_discard_count(&discards).build(),
    )
    .build();
assert_eq!(0, discards.discarded(0x1234));

Implementations§

Source§

impl JitterBufferDiscards

Source

pub fn new() -> Self

A handle with nothing counted.

Source

pub fn discarded(&self, ssrc: u32) -> u64

The packets of the remote stream ssrc discarded so far, duplicates excluded.

Trait Implementations§

Source§

impl Clone for JitterBufferDiscards

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 JitterBufferDiscards

Source§

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

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

impl Default for JitterBufferDiscards

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Forget for JitterBufferDiscards

§

impl Freeze for JitterBufferDiscards
where *const ArcInner<Mutex<HashMap<u32, StreamDiscards>>> is !null: Freeze, PhantomData<ArcInner<Mutex<HashMap<u32, StreamDiscards>>>>: Freeze,

§

impl Move for JitterBufferDiscards

§

impl RefUnwindSafe for JitterBufferDiscards
where Atomic<usize>: RefUnwindSafe, Mutex<HashMap<u32, StreamDiscards>>: RefUnwindSafe,

§

impl Send for JitterBufferDiscards
where Arc<Mutex<HashMap<u32, StreamDiscards>>>: Send,

§

impl Sync for JitterBufferDiscards
where Arc<Mutex<HashMap<u32, StreamDiscards>>>: Sync,

§

impl Unpin for JitterBufferDiscards
where Arc<Mutex<HashMap<u32, StreamDiscards>>>: Unpin,

§

impl UnsafeUnpin for JitterBufferDiscards
where *const ArcInner<Mutex<HashMap<u32, StreamDiscards>>> is !null: UnsafeUnpin, PhantomData<ArcInner<Mutex<HashMap<u32, StreamDiscards>>>>: UnsafeUnpin,

§

impl UnwindSafe for JitterBufferDiscards
where Arc<Mutex<HashMap<u32, StreamDiscards>>>: UnwindSafe,

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.