pub struct FlexFecSendBuilder { /* private fields */ }Expand description
Builder for FlexFecSendInterceptor.
§Example
use rtci_interceptor::{FlexFecProtection, FlexFecSendBuilder, Registry, Slot};
let chain = Registry::new()
.with(
Slot::FecEncoder,
FlexFecSendBuilder::new()
.with_protection(FlexFecProtection::RowAndColumn { l: 4, d: 3 })
.build(),
)
.build();Implementations§
Source§impl FlexFecSendBuilder
impl FlexFecSendBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
A builder with FLEXFEC_DEFAULT_PROTECTION and a 10 s repair window.
Sourcepub fn with_protection(self, protection: FlexFecProtection) -> Self
pub fn with_protection(self, protection: FlexFecProtection) -> Self
The shape of the protection: flexible masks, rows, columns, or rows and columns.
A shape with no usable block (l of 0, a column of fewer than two rows, a mask block of
more than 110 packets) protects nothing.
Sourcepub fn with_repair_window(self, repair_window: Duration) -> Self
pub fn with_repair_window(self, repair_window: Duration) -> Self
The longest repair window this sender uses. A stream whose negotiated repair-window
(its a=fmtp line) is shorter is held to that one.
A block of source packets is protected only when its first packet and its repair packets are sent within the window: RFC 8627 section 1.1.8 forbids repair packets whose L and D exceed it.
Sourcepub fn with_retransmissions(self, retransmissions: bool) -> Self
pub fn with_retransmissions(self, retransmissions: bool) -> Self
Answer NACKs for the protected streams with FlexFEC retransmission packets (R=1, section 4.2.2.3) on the repair stream. Off by default.
This is FlexFEC’s own retransmission, in place of RFC 4588 RTX: a chain that turns it on must not also run a NACK responder for the same streams, or each NACK is answered twice.
Sourcepub fn with_initial_sequence_number(self, sequence_number: u16) -> Self
pub fn with_initial_sequence_number(self, sequence_number: u16) -> Self
The sequence number each repair stream starts at. Unset, it is random (section 4.2.1).
Sourcepub fn with_initial_timestamp(self, timestamp: u32) -> Self
pub fn with_initial_timestamp(self, timestamp: u32) -> Self
The RTP timestamp each repair stream carries at the instant of its first packet. Unset, it is random (RFC 3550 section 5.1). From there it follows the send clock.
Sourcepub fn with_adaptive_rate(self, adaptive: bool) -> Self
pub fn with_adaptive_rate(self, adaptive: bool) -> Self
Whether the amount of FEC follows the loss the receiver reports (the default), or
stays as configured. See FecRate: no repair under 0.5% loss, enough
for twice the loss above it, at most half the block (flexible masks; rows and columns are sent or not); the FEC sent is taken out of the
target the application encodes at.
Sourcepub fn with_latency_budget(self, latency_budget: Option<Duration>) -> Self
pub fn with_latency_budget(self, latency_budget: Option<Duration>) -> Self
The application’s latency budget (RFC 8854 section 8): while the round trip measured to
the receiver is within it, a stream that can be repaired by retransmission (RTX: nack
and an RTX stream negotiated; or with_retransmissions on)
gets no FEC. FEC_DEFAULT_LATENCY_BUDGET by
default; None sends FEC by the loss whatever the round trip (proactive FEC).
Sourcepub fn with_base_layer_only(self, base_layer_only: bool) -> Self
pub fn with_base_layer_only(self, base_layer_only: bool) -> Self
Whether only base-layer frames of a layered codec are protected (RFC 8854 section 8; the default): a packet of a temporal layer above the base (VP8, VP9, H.265, AV1) is left out, and ends the block gathered so far, which is protected as it is.
Sourcepub fn with_probe_fill(self, probe_fill: bool) -> Self
pub fn with_probe_fill(self, probe_fill: bool) -> Self
Whether bandwidth probe clusters are filled with repair packets (RFC 8854 section 8:
“when probing bandwidth, i.e., speculatively sending extra data to determine if
additional link capacity exists, FEC data SHOULD be used as the additional data”; the
default). When the pacer sends a cluster (its ProbeFill says how
much the media it holds leaves to fill), the encoder sends up to that much in repair
packets over the newest source packets (at most 16, within the repair window; one repair
packet each at most) of the stream that sent last, and the NACK responder pads only what
they leave unfilled. These repair packets are not taken
out of the target the application encodes at: a cluster is sent above it. Off, the NACK
responder fills clusters with padding on the RTX stream.
Sourcepub fn with_source_rate_first(self, source_rate_first: bool) -> Self
pub fn with_source_rate_first(self, source_rate_first: bool) -> Self
Whether stronger FEC waits until the source rate has been reduced (RFC 8627 section 8:
“stronger FEC protection MAY be applied only after the source rate has been reduced”;
the default). Once a congestion controller’s target went by, the amount of FEC rises
only when the source sent in the last second plus the FEC the higher amount adds fit
within the target, and the target for the application is lowered by the FEC asked for
so the source makes the room. See FecRate::with_source_rate_first.
Sourcepub fn build(self) -> FlexFecSendInterceptor
pub fn build(self) -> FlexFecSendInterceptor
Build the interceptor.