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 follows the cadence (Self::with_cadence) or stays fixed at
Self::with_interval (false). On by default.
Sourcepub fn with_cadence(self, cadence: CongestionFeedbackCadence) -> Self
pub fn with_cadence(self, cadence: CongestionFeedbackCadence) -> Self
When a report is built while the interval is not fixed: see
CongestionFeedbackCadence. Default CongestionFeedbackCadence::ReceivedMedia,
the engine’s own form, which no specification has (RFC 8888 section 4 leaves the
interval to the application: “Applications need to negotiate an appropriate congestion
control feedback interval”). CongestionFeedbackCadence::PerFrame is the form of
the texts (RFC 8888 section 4, “sending feedback once per frame is an upper bound
before the reporting overhead becomes excessive”, and “Specifications for RTP
congestion control algorithms can also provide guidance”: draft-ietf-rmcat-gcc-02
section 3, “once per received video frame or at least once every 30 ms if audio-only
or multi-stream”, up to 100 ms where the overhead needs to be limited): measured
worse as the default, it is the StrictRfc behaviour profile’s.
The share of the rate it is sized to that the feedback may take with
CongestionFeedbackCadence::SendEstimate and
CongestionFeedbackCadence::ReceivedMedia. Default 0.05; the Performance
behaviour profile takes 0.025. CongestionFeedbackCadence::PerFrame does not use it.
Sourcepub fn with_max_adaptive_interval(self, max_interval: Duration) -> Self
pub fn with_max_adaptive_interval(self, max_interval: Duration) -> Self
The longest interval of CongestionFeedbackCadence::SendEstimate and
CongestionFeedbackCadence::ReceivedMedia while media flows. Default 250 ms; 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.