pub struct RtpHeader {
pub version: u8,
pub has_padding: bool,
pub has_extension: bool,
pub csrc_count: usize,
pub marker: bool,
pub payload_type: Pt,
pub sequence_number: u16,
pub timestamp: u32,
pub ssrc: Ssrc,
pub csrc: [u32; 15],
pub ext_vals: ExtensionValues,
pub header_len: usize,
}Expand description
Parsed header from an RTP packet.
Fields§
§version: u8Always 2
has_padding: boolWhether the RTP packet has padding to be an equal of 4 bytes.
has_extension: boolRTP packet has “RTP header extensions”.
csrc_count: usizeNumber of contributing source identifiers.
marker: boolFor video, this marker signifies the end of a series of packets that together form a single video frame. For audio, it marks the beginning of a talkspurt, which is a burst of audio packets.
payload_type: PtType of payload being carried. What this correlates to is sent in the SDP.
sequence_number: u16Sequence number increasing by 1 for each RTP packet.
timestamp: u32Timestamp in media time for the RTP packet. What the media time base is depends on the codec.
ssrc: SsrcSender source identifier.
csrc: [u32; 15]Contributing source identifiers (CSRC). Up to 15 values per RFC 3550.
ext_vals: ExtensionValuesThe extension values parsed using the mapping via SDP.
header_len: usizeLength of header.
Implementations§
Source§impl RtpHeader
impl RtpHeader
Sourcepub fn create_padding_packet(
buf: &mut [u8],
header_len: usize,
pad_len: u8,
block_size: usize,
) -> usize
pub fn create_padding_packet( buf: &mut [u8], header_len: usize, pad_len: u8, block_size: usize, ) -> usize
Write a packet consisting entirely of padding and write.
Sourcepub fn read_original_sequence_number(buf: &[u8], seq_no: &mut u16) -> usize
pub fn read_original_sequence_number(buf: &[u8], seq_no: &mut u16) -> usize
For RTX the original sequence number is inserted before the RTP payload.
Sourcepub fn write_original_sequence_number(buf: &mut [u8], seq_no: SeqNo) -> usize
pub fn write_original_sequence_number(buf: &mut [u8], seq_no: SeqNo) -> usize
For RTX the original sequence number is inserted before the RTP payload.
Sourcepub fn sequence_number(&self, previous: Option<SeqNo>) -> SeqNo
pub fn sequence_number(&self, previous: Option<SeqNo>) -> SeqNo
Sequencer number of this RTP header given the previous number.
The logic detects wrap-arounds of the 16-bit RTP sequence number.