Skip to main content

UlpfecStreamPacketizer

Struct UlpfecStreamPacketizer 

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

Builds the RTP packets of a FEC stream sent apart from the media (RFC 5109 7.2, 14.1).

The sequence number is one higher than the previous FEC packet’s, the marker bit is 0, and the timestamp is the media RTP clock at the instant the FEC packet is sent: the timestamp of the last media packet, advanced by the time since that packet at the stream’s clock rate.

The RFC sets the SSRC to the protected stream’s and puts the FEC stream in its own RTP session. Pass the media SSRC for that. Within one RTP session (a WebRTC transport) the FEC stream needs an SSRC of its own, since two sequence number spaces cannot share one.

Implementations§

Source§

impl UlpfecStreamPacketizer

Source

pub fn new( payload_type: u8, ssrc: u32, clock_rate: u32, initial_sequence_number: u16, ) -> Self

A packetizer for FEC packets of payload_type on ssrc, whose first packet has initial_sequence_number. clock_rate is the protected media’s.

Source

pub fn on_media(&mut self, timestamp: u32, now: Instant)

Note a media packet of the protected stream going out at now with timestamp.

Source

pub fn packetize(&mut self, fec: &UlpfecPacket, now: Instant) -> Packet

The RTP packet carrying fec, sent at now.

Trait Implementations§

Source§

impl Clone for UlpfecStreamPacketizer

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 UlpfecStreamPacketizer

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.