Skip to main content

FecRate

Struct FecRate 

Source
pub struct FecRate { /* private fields */ }
Expand description

The loss-driven amount of FEC for one sender. See the module documentation.

Implementations§

Source§

impl FecRate

Source

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.

Source

pub fn with_max(self, max: u32) -> Self

The most repair packets per block, whatever the loss.

Source

pub fn max(&self) -> u32

The most repair packets per block.

Source

pub fn loss(&self) -> Option<f64>

The smoothed loss fraction, once a report gave one.

Source

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.

Source

pub fn fec_packets(&self) -> u32

Repair packets for the next block.

Source

pub fn protects(&self) -> bool

Whether any repair is to be sent now (for protection shapes whose amount is fixed: sent or not).

Source

pub fn on_repair_sent(&mut self, now: Instant, size: usize)

A repair packet of size octets left at now.

Source

pub fn fec_bitrate(&mut self, now: Instant) -> f64

The bit rate of the repair packets of the last second at now.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for FecRate

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FecRate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.