pub struct UlpfecEncoder;Expand description
Generates ULPFEC payloads.
Stateless: every call is one FEC packet over the media packets and levels it is given.
Implementations§
Source§impl UlpfecEncoder
impl UlpfecEncoder
Sourcepub fn full_protection_length(media: &[Packet]) -> Result<u16, UlpfecError>
pub fn full_protection_length(media: &[Packet]) -> Result<u16, UlpfecError>
The protection length that covers every packet in media to its end: the longest
packet’s length after the fixed RTP header.
Sourcepub fn encode(
&self,
media: &[Packet],
levels: &[ProtectionLevel],
) -> Result<UlpfecPacket, UlpfecError>
pub fn encode( &self, media: &[Packet], levels: &[ProtectionLevel], ) -> Result<UlpfecPacket, UlpfecError>
Generate one FEC packet protecting media at levels (level 0 first).
The packets are protected as they marshal: CSRC list, header extension, payload and
padding all count as payload (7.3). Each level names its packets by sequence number; a
number that is not in media is an error, as is a level without packets and a set of
packets spanning more than 48 sequence numbers. Rule c of 7.4 (a packet holding level p
holds level p - 1) holds by construction; rules a and b, which relate several FEC
packets, are checked by validate_scheme.