Skip to main content

FlexFecSendBuilder

Struct FlexFecSendBuilder 

Source
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

Source

pub fn new() -> Self

A builder with FLEXFEC_DEFAULT_PROTECTION and a 10 s repair window.

Source

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.

Source

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.

Source

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.

Source

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).

Source

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.

Source

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.

Source

pub fn build(self) -> FlexFecSendInterceptor

Build the interceptor.

Trait Implementations§

Source§

impl Default for FlexFecSendBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. 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> 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, 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.