Skip to main content

is_rtcp

Function is_rtcp 

Source
pub fn is_rtcp(buf: &[u8]) -> bool
Expand description

Returns true if buf is RTCP rather than RTP.

Distinguished by the second octet, as RFC 5761 ยง4 has it: an RTCP packet carries its packet type there, and the types RTCP uses next to RTP are [192, 223]. An RTP packet carries the marker bit and its 7-bit payload type there, so the octet is in that range only for payload types 64 to 95 sent with the marker bit set, which is why RFC 5761 forbids those payload types when RTP and RTCP share a port. The same payload types without the marker bit (second octet 64 to 95) are RTP like any other.

Returns false for buffers too short to tell.