pub struct FecRate { /* private fields */ }Expand description
The loss-driven amount of FEC for one sender. See the module documentation.
Implementations§
Source§impl FecRate
impl FecRate
Sourcepub fn new(media_packets: u32, fec_packets: u32, adaptive: bool) -> Self
pub fn new(media_packets: u32, fec_packets: u32, adaptive: bool) -> Self
fec_packets repair packets per media_packets source packets until the loss is known;
adaptive false keeps that amount whatever the loss.
Sourcepub fn on_fraction_lost(&mut self, fraction_lost: u8)
pub fn on_fraction_lost(&mut self, fraction_lost: u8)
A receiver report’s fraction lost (RFC 3550 6.4.1, in 1/256) for a protected stream.
Sourcepub fn fec_packets(&self) -> u32
pub fn fec_packets(&self) -> u32
Repair packets for the next block.
Sourcepub fn protects(&self) -> bool
pub fn protects(&self) -> bool
Whether any repair is to be sent now (for protection shapes whose amount is fixed: sent or not).
Sourcepub fn on_repair_sent(&mut self, now: Instant, size: usize)
pub fn on_repair_sent(&mut self, now: Instant, size: usize)
A repair packet of size octets left at now.
Sourcepub fn fec_bitrate(&mut self, now: Instant) -> f64
pub fn fec_bitrate(&mut self, now: Instant) -> f64
The bit rate of the repair packets of the last second at now.
Sourcepub fn media_target(&mut self, now: Instant, target: f64) -> f64
pub fn media_target(&mut self, now: Instant, target: f64) -> f64
The target the application encodes at, out of the congestion controller’s target:
what is left after the FEC.
Sourcepub fn on_read(
&mut self,
msg: &mut TaggedPacket,
protected: impl Fn(u32) -> bool,
)
pub fn on_read( &mut self, msg: &mut TaggedPacket, protected: impl Fn(u32) -> bool, )
Reads what an inbound packet tells the FEC rate, and takes the FEC out of a target it
carries: the receiver reports of protected streams feed the loss, and an
Attribute::TargetBitrateChanged on the packet is lowered by the FEC bit rate.