pub struct SenderReportBuilder { /* private fields */ }Expand description
Builder for the SenderReportInterceptor.
§Example
use rtci_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 rtci_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 rtci_interceptor::{Slot, Registry, SenderReportBuilder};
let registry =
Registry::new().with(Slot::SenderReport, SenderReportBuilder::new().with_use_latest_packet().build());Sourcepub fn with_wall_clock(self, anchor: SystemInstant) -> Self
pub fn with_wall_clock(self, anchor: SystemInstant) -> Self
The wall-clock anchor the sender reports’ NTP times derive from. Default: the
process-wide SystemInstant::shared. Give one per peer connection for reproducible
virtual-time runs: two runs in one process otherwise map the same instants to NTP times
as far apart as the real time between them.
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 rtci_interceptor::{Slot, Registry, SenderReportBuilder};
let registry = Registry::new()
.with(Slot::SenderReport, SenderReportBuilder::new().build());