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>
impl<P> SenderReportBuilder<P>
Sourcepub fn with_interval(self, interval: Duration) -> Self
pub fn with_interval(self, interval: Duration) -> Self
Sourcepub fn with_use_latest_packet(self) -> Self
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();Sourcepub fn build(self) -> impl FnOnce(P) -> SenderReportInterceptor<P>
pub fn build(self) -> impl FnOnce(P) -> SenderReportInterceptor<P>
Trait Implementations§
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<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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