pub struct FecSessionSsrcMap { /* private fields */ }Expand description
Maps the SSRCs of a FEC session (RFC 5109 section 14.1) between the wire and the chain; see
the fec_session module’s source documentation.
§Example
use rtci_interceptor::FecSessionSsrcMap;
let map = FecSessionSsrcMap::new(0x5109_5109);
let media_ssrc = 0x1234_5678;
let in_chain = map.map(media_ssrc);
assert_ne!(in_chain, media_ssrc);
// The same map takes a packet in and out.
assert_eq!(map.map(in_chain), media_ssrc);Implementations§
Source§impl FecSessionSsrcMap
impl FecSessionSsrcMap
Sourcepub fn new(key: u32) -> Self
pub fn new(key: u32) -> Self
A map with key. Zero would leave every SSRC as it is, the very collision the map is
for, so it is replaced by 1.
Sourcepub fn map(&self, ssrc: u32) -> u32
pub fn map(&self, ssrc: u32) -> u32
The chain’s SSRC for a wire SSRC of the FEC session, and the wire SSRC for the chain’s.
Sourcepub fn map_rtp(&self, packet: &mut Packet)
pub fn map_rtp(&self, packet: &mut Packet)
Maps the SSRC of an RTP packet of the FEC session. A FEC packet has no CSRC list (RFC 5109 section 7.2 uses the fields “according to RFC 3550”: a FEC packet is not a mixer’s), and one that came with entries keeps them as they are.
Sourcepub fn map_rtcp(&self, packets: &[Box<dyn Packet>]) -> Vec<Box<dyn Packet>>
pub fn map_rtcp(&self, packets: &[Box<dyn Packet>]) -> Vec<Box<dyn Packet>>
Maps every SSRC of a compound RTCP packet of the FEC session: sender and receiver reports with their report blocks, source descriptions, goodbyes, transport-wide and RFC 8888 congestion control feedback, and the receiver reference time and DLRR blocks of an extended report.
Any other packet is left out of the result: feedback about pictures, bit rates or retransmission has no meaning for a FEC stream, and a packet passed on with its SSRCs unmapped would name another stream of the connection. An extended report keeps the blocks named above and is left out when none remains.