pub struct FlexFecDecoder { /* private fields */ }Expand description
Recovers lost source packets from RFC 8627 FlexFEC repair packets (flexfec, not
flexfec-03): flexible masks, fixed L/D rows and columns (1-D and 2-D, decoded
iteratively), retransmissions, and repair packets that protect several source streams.
Every packet of the protected source streams goes to
push_source, every packet of the repair stream to
push_repair; both return the source packets that became available.
§Bounds
Only streams registered with add_source_stream are buffered: a
repair packet naming any other SSRC is ignored, so a peer cannot make the decoder open
buffers by inventing CSRCs. Per stream at most
max_source_packets are kept, for at most the
repair window; a repair packet whose L and D reach beyond that is ignored. Length recovery
can never ask for more than the repair packet itself holds.
Implementations§
Source§impl FlexFecDecoder
impl FlexFecDecoder
Sourcepub fn new(config: FlexFecDecoderConfig) -> Self
pub fn new(config: FlexFecDecoderConfig) -> Self
A decoder with no source stream registered.
Sourcepub fn config(&self) -> &FlexFecDecoderConfig
pub fn config(&self) -> &FlexFecDecoderConfig
The bounds this decoder runs with.
Sourcepub fn widen(&mut self, config: FlexFecDecoderConfig)
pub fn widen(&mut self, config: FlexFecDecoderConfig)
Raise each bound to at least config’s: another stream joined with a longer repair
window. Bounds are never lowered while packets are held against them.
Sourcepub fn stats(&self) -> FlexFecDecoderStats
pub fn stats(&self) -> FlexFecDecoderStats
Counters.
Sourcepub fn add_source_stream(&mut self, ssrc: u32)
pub fn add_source_stream(&mut self, ssrc: u32)
Protect the source stream ssrc: buffer its packets and accept repair packets for it.
Sourcepub fn remove_source_stream(&mut self, ssrc: u32)
pub fn remove_source_stream(&mut self, ssrc: u32)
Stop protecting ssrc, dropping what was held for it.
Sourcepub fn source_streams(&self) -> impl Iterator<Item = u32> + '_
pub fn source_streams(&self) -> impl Iterator<Item = u32> + '_
The protected source streams.
Sourcepub fn held_source_packets(&self) -> usize
pub fn held_source_packets(&self) -> usize
Source packets held, over all streams.
Sourcepub fn pending_repair_packets(&self) -> usize
pub fn pending_repair_packets(&self) -> usize
Repair packets held while they wait for sources.