Skip to main content

UlpfecSendBuilder

Struct UlpfecSendBuilder 

Source
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

Source

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

Source

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.

Source

pub fn with_red_placement(self, placement: RedPlacement) -> Self

Where FEC data goes in a RED stream. Ignored for a separate stream.

Source

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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

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; the FEC sent is taken out of the target the application encodes at.

Source

pub fn build(self) -> UlpfecSendInterceptor

Build the interceptor.

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.