pub struct Rfc8888Builder { /* private fields */ }Expand description
Builder for Rfc8888Interceptor.
§Example
use rtci_interceptor::{Slot, Registry, Rfc8888Builder};
use std::time::Duration;
let chain = Registry::new()
.with(Slot::Rfc8888, Rfc8888Builder::new().with_interval(Duration::from_millis(50)).build())
.build();Implementations§
Source§impl Rfc8888Builder
impl Rfc8888Builder
Sourcepub fn with_interval(self, interval: Duration) -> Self
pub fn with_interval(self, interval: Duration) -> Self
How often feedback is sent.
Congestion control wants this often — the estimate is only as fresh as the feedback driving it — traded against the RTCP bandwidth it costs.
Sourcepub fn with_adaptive_interval(self, adaptive_interval: bool) -> Self
pub fn with_adaptive_interval(self, adaptive_interval: bool) -> Self
Whether the interval stretches to what the RTCP bandwidth holds one report in. On by default.
“RTCP bandwidth and transmission rules put some upper limits on how frequently the
RTCP feedback messages can be sent” (RFC 8888 section 4), and the RTCP session applies
them: 5% of the session bandwidth unless b=RS / b=RR say otherwise (RFC 3550
section 6.2). Reports built more often than that queue in the session and reach the
sender late or not at all. With this on, the interval is the configured one where the
bandwidth allows it and longer where it does not, up to half a second: one report for
every RTCP packet the session may send, each covering everything since the last.
false keeps the interval fixed.
The share of the media received that the feedback may take while the interval is
adaptive: the interval is the time in which this share holds one feedback packet (with
its lower layers, and the minimal compound packet around it without reduced-size
RTCP). Default 0.05, RFC 3550 section 6.2’s 5% for all of RTCP. A smaller share leaves
room in the 5% for the regular reports (the Performance behaviour profile: 0.025).
Sourcepub fn with_max_adaptive_interval(self, max_interval: Duration) -> Self
pub fn with_max_adaptive_interval(self, max_interval: Duration) -> Self
The longest the adaptive interval stretches to while media flows. Default 250 ms.
draft-holmer-rmcat-transport-wide-cc-extensions-01 section 3: “in cases of low uplink
bandwidth it is acceptable to send them less frequently, e.g., for instance once per
RTT”; RFC 8888 section 4 leaves the interval to the application (“Applications need to
negotiate an appropriate congestion control feedback interval … based on … the
acceptable feedback overhead”). The Performance behaviour profile takes 500 ms.
Sourcepub fn with_max_report_size(self, max_report_size: usize) -> Self
pub fn with_max_report_size(self, max_report_size: usize) -> Self
Byte budget for one report.
A report larger than the path MTU is fragmented or dropped, and feedback that does not arrive is worth nothing, so feedback that exceeds the budget is split into several reports (RFC 8888 section 3.1).
Sourcepub fn with_sender_ssrc(self, sender_ssrc: u32) -> Self
pub fn with_sender_ssrc(self, sender_ssrc: u32) -> Self
The SSRC these reports are sent from.
Left unset, the interceptor uses the SSRC of the first local stream bound to it (the RTCP packet sender is then the endpoint’s own media source), and while there is none, a random non-zero SSRC chosen when it is built, as a receive-only RTP participant has (RFC 3550 section 8). It is never 0.
Sourcepub fn with_wall_clock(self, anchor: SystemInstant) -> Self
pub fn with_wall_clock(self, anchor: SystemInstant) -> Self
The wall-clock anchor the reports’ timestamps derive from (RFC 8888 section 3.1: the
clock of the RTCP sender reports’ NTP timestamps, so give the RTCP session the same).
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) -> Rfc8888Interceptor
pub fn build(self) -> Rfc8888Interceptor
Build the interceptor.