pub struct SenderReportBuilder { /* private fields */ }Expand description
Builder for the SenderReportInterceptor.
§Example
use rtc_interceptor::{Slot, Registry, SenderReportBuilder};
use std::time::Duration;
// With default interval (1 second)
let chain = Registry::new()
.with(Slot::SenderReport, SenderReportBuilder::new().build())
.build();
// With custom interval
let chain = Registry::new()
.with(Slot::SenderReport, SenderReportBuilder::new().with_interval(Duration::from_millis(500)).build())
.build();
// With use_latest_packet enabled
let chain = Registry::new()
.with(Slot::SenderReport, SenderReportBuilder::new().with_use_latest_packet().build())
.build();Implementations§
Source§impl SenderReportBuilder
impl SenderReportBuilder
Sourcepub fn with_interval(self, interval: Duration) -> Self
pub fn with_interval(self, interval: Duration) -> Self
Set a custom interval between sender reports.
§Example
use rtc_interceptor::{Registry, SenderReportBuilder, Slot};
use std::time::Duration;
let registry = Registry::new().with(
Slot::SenderReport,
SenderReportBuilder::new()
.with_interval(Duration::from_millis(500))
.build(),
);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::{Slot, Registry, SenderReportBuilder};
let registry =
Registry::new().with(Slot::SenderReport, SenderReportBuilder::new().with_use_latest_packet().build());Sourcepub fn build(self) -> SenderReportInterceptor
pub fn build(self) -> SenderReportInterceptor
Create a builder function for use with Registry.
This returns a closure that can be passed to Registry::with().
§Example
use rtc_interceptor::{Slot, Registry, SenderReportBuilder};
let registry = Registry::new()
.with(Slot::SenderReport, SenderReportBuilder::new().build());Trait Implementations§
Auto Trait Implementations§
impl Freeze for SenderReportBuilder
impl RefUnwindSafe for SenderReportBuilder
impl Send for SenderReportBuilder
impl Sync for SenderReportBuilder
impl Unpin for SenderReportBuilder
impl UnsafeUnpin for SenderReportBuilder
impl UnwindSafe for SenderReportBuilder
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