SenderReportBuilder

Struct SenderReportBuilder 

Source
pub struct SenderReportBuilder<P> { /* private fields */ }
Expand description

Builder for the SenderReportInterceptor.

§Example

use rtc_interceptor::{Registry, SenderReportBuilder};
use std::time::Duration;

// With default interval (1 second)
let chain = Registry::new()
    .with(SenderReportBuilder::new().build())
    .build();

// With custom interval
let chain = Registry::new()
    .with(SenderReportBuilder::new().with_interval(Duration::from_millis(500)).build())
    .build();

// With use_latest_packet enabled
let chain = Registry::new()
    .with(SenderReportBuilder::new().with_use_latest_packet().build())
    .build();

Implementations§

Source§

impl<P> SenderReportBuilder<P>

Source

pub fn new() -> Self

Create a new builder with default settings.

Default interval is 1 second.

Source

pub fn with_interval(self, interval: Duration) -> Self

Set a custom interval between sender reports.

§Example
use std::time::Duration;
use rtc_interceptor::SenderReportBuilder;

let builder = SenderReportBuilder::new()
    .with_interval(Duration::from_millis(500));
Source

pub fn with_use_latest_packet(self) -> Self

Enable always using the latest packet for timestamp tracking, even if it appears to be out-of-order based on sequence numbers.

By default (disabled), only in-order packets update the RTP↔NTP timestamp correlation. This prevents out-of-order packets from corrupting the timestamp mapping.

Enable this option when:

  • Packets are guaranteed to arrive in order
  • The application reorders packets before the interceptor
  • You want the sender report to always reflect the most recent packet
§Example
use rtc_interceptor::SenderReportBuilder;

let builder = SenderReportBuilder::new()
    .with_use_latest_packet();
Source

pub fn build(self) -> impl FnOnce(P) -> SenderReportInterceptor<P>

Create a builder function for use with Registry.

This returns a closure that can be passed to Registry::with().

§Example
use rtc_interceptor::{Registry, SenderReportBuilder};

let registry = Registry::new()
    .with(SenderReportBuilder::new().build());

Trait Implementations§

Source§

impl<P> Default for SenderReportBuilder<P>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<P> Freeze for SenderReportBuilder<P>

§

impl<P> RefUnwindSafe for SenderReportBuilder<P>
where P: RefUnwindSafe,

§

impl<P> Send for SenderReportBuilder<P>
where P: Send,

§

impl<P> Sync for SenderReportBuilder<P>
where P: Sync,

§

impl<P> Unpin for SenderReportBuilder<P>
where P: Unpin,

§

impl<P> UnwindSafe for SenderReportBuilder<P>
where P: 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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,