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 build(self) -> FlexFecSendInterceptor
pub fn build(self) -> FlexFecSendInterceptor
Build the interceptor.