pub struct RtpHeader {
pub payload_type: u8,
pub marker: bool,
pub sequence: u16,
pub timestamp: u32,
pub ssrc: u32,
}Expand description
The RFC 3550 fixed header fields a packetizer chooses per packet.
Fields§
§payload_type: u87-bit payload type (a static PT like 0 = PCMU, or a dynamic 96..=127).
marker: boolFrame/talkspurt boundary marker; payload-format-defined semantics.
sequence: u16Per-packet sequence number (the packetizer increments, wrapping).
timestamp: u32Media-clock timestamp of the payload’s sampling instant.
ssrc: u32Synchronization source identifier.
Implementations§
Source§impl RtpHeader
impl RtpHeader
Sourcepub fn parse(buf: &[u8]) -> Option<RtpParsed>
pub fn parse(buf: &[u8]) -> Option<RtpParsed>
Parse an RTP datagram received from an arbitrary peer, returning the
fixed-header fields and the payload’s byte range. The inverse of
to_bytes, but tolerant of the header variations a
real sender may set that to_bytes never emits: a CSRC list (CC), a
profile extension header (X), and payload padding (P).
Parser discipline (never trust the wire, per the demuxer rule): every
offset and length is folded with checked arithmetic and bounds-checked
against buf, so a malformed or truncated datagram returns None
rather than panicking or reading out of bounds. A non-RTP-v2 packet is
rejected. Heap-free (part of the no-alloc subset), so an MCU RTP source
uses it directly.
Sourcepub fn parse_header(buf: &[u8]) -> Option<RtpParsedHeader>
pub fn parse_header(buf: &[u8]) -> Option<RtpParsedHeader>
Parse the authenticated RTP header without reading the payload. This
accepts CSRC identifiers and an RTP extension and rejects any header
whose declared fields exceed buf.