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
impl UlpfecStreamPacketizer
Sourcepub fn new(
payload_type: u8,
ssrc: u32,
clock_rate: u32,
initial_sequence_number: u16,
) -> Self
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.
Sourcepub fn on_media(&mut self, timestamp: u32, now: Instant)
pub fn on_media(&mut self, timestamp: u32, now: Instant)
Note a media packet of the protected stream going out at now with timestamp.
Sourcepub fn packetize(&mut self, fec: &UlpfecPacket, now: Instant) -> Packet
pub fn packetize(&mut self, fec: &UlpfecPacket, now: Instant) -> Packet
The RTP packet carrying fec, sent at now.