#[non_exhaustive]pub enum Packet {
Rtp(Packet),
Rtcp(Vec<Box<dyn Packet>>),
}Expand description
RTP/RTCP Packet
An enum representing either an RTP or RTCP packet that can be processed by interceptors in the chain.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Rtp(Packet)
RTP (Real-time Transport Protocol) packet containing media data
Rtcp(Vec<Box<dyn Packet>>)
RTCP (RTP Control Protocol) packets for feedback and statistics.
§An empty vector is reserved
Packet::Rtcp(vec![]) means attribute carrier and nothing else: a packet that exists
only to carry Attributes when no real packet is going the same way. rtc’s handler
reads the attributes off it and then drops it, so it never reaches the wire or the
application.
An interceptor must therefore never emit an empty compound packet meaning anything else —
it would be discarded with no error and no trace. Generators that build from a
variable-length list return early when that list is empty rather than emitting nothing-shaped
output; rtc-interceptor/tests/empty_rtcp_is_reserved.rs holds them to it.