pub struct UlpfecSendBuilder { /* private fields */ }Expand description
Builder for UlpfecSendInterceptor.
§Example
use rtci_interceptor::{Registry, Slot, UlpfecSendBuilder};
// `a=rtpmap:116 red/90000`, `a=rtpmap:117 ulpfec/90000`
let chain = Registry::new()
.with(Slot::FecEncoder, UlpfecSendBuilder::red(116, 117).build())
.build();Implementations§
Source§impl UlpfecSendBuilder
impl UlpfecSendBuilder
Sourcepub fn red(red_payload_type: u8, fec_payload_type: u8) -> Self
pub fn red(red_payload_type: u8, fec_payload_type: u8) -> Self
FEC as a redundant encoding (RFC 5109 14.2): every packet of a protected stream leaves as
a RED packet of red_payload_type, and FEC data has fec_payload_type. Both come from
the negotiated a=rtpmap lines (red, ulpfec).
Sourcepub fn stream() -> Self
pub fn stream() -> Self
FEC as a stream of its own (RFC 5109 14.1), on the repair SSRC and payload type of
StreamInfo::ssrc_fec / StreamInfo::payload_type_fec. A stream without both is not
protected. See UlpfecStreamPacketizer for why this is not the media SSRC.
Sourcepub fn with_red_placement(self, placement: RedPlacement) -> Self
pub fn with_red_placement(self, placement: RedPlacement) -> Self
Where FEC data goes in a RED stream. Ignored for a separate stream.
Sourcepub fn with_num_media_packets(self, num_media_packets: usize) -> Self
pub fn with_num_media_packets(self, num_media_packets: usize) -> Self
How many media packets one block of FEC protects, 1 to 48 (the long mask’s reach).
Sourcepub fn with_num_fec_packets(self, num_fec_packets: usize) -> Self
pub fn with_num_fec_packets(self, num_fec_packets: usize) -> Self
How many FEC packets each block produces. The block’s packets are dealt to them in turn,
so n FEC packets recover a burst of up to n losses. Zero sends no FEC.
Sourcepub fn with_level_lengths(self, lengths: impl Into<Vec<u16>>) -> Self
pub fn with_level_lengths(self, lengths: impl Into<Vec<u16>>) -> Self
Protection lengths of the levels, level 0 first, for uneven protection: level 0 covers the
first lengths[0] octets after the fixed RTP header, level 1 the next lengths[1], and
so on; what lies beyond the last level is not protected.
Empty, the default, is one level as long as the block’s longest packet: full protection.
Sourcepub fn with_one_level_only(self, one_level_only: bool) -> Self
pub fn with_one_level_only(self, one_level_only: bool) -> Self
Use one level only, whatever with_level_lengths says: for a
stream whose ulpfec format carries onelevelonly=1 (RFC 5109 13). See
one_level_only_from_fmtp.
Sourcepub fn with_flush_on_marker(self, flush_on_marker: bool) -> Self
pub fn with_flush_on_marker(self, flush_on_marker: bool) -> Self
Also close a block at a packet with the marker bit (the last packet of a video frame), so FEC never waits for the next frame.
Sourcepub fn with_initial_fec_sequence_number(self, sequence_number: u16) -> Self
pub fn with_initial_fec_sequence_number(self, sequence_number: u16) -> Self
The first sequence number of a separate FEC stream. Random when not set, as an RTP stream’s is (RFC 3550 5.1); a test pins it.
Sourcepub fn with_stream_filter(
self,
filter: impl Fn(&StreamInfo) -> bool + Send + Sync + 'static,
) -> Self
pub fn with_stream_filter( self, filter: impl Fn(&StreamInfo) -> bool + Send + Sync + 'static, ) -> Self
Which bound local streams are protected. The default is every video/ stream.
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; the FEC sent is taken out of the
target the application encodes at.
Sourcepub fn build(self) -> UlpfecSendInterceptor
pub fn build(self) -> UlpfecSendInterceptor
Build the interceptor.