pub struct RtpHeader {
pub version: u8,
pub has_padding: bool,
pub has_extension: bool,
pub marker: bool,
pub payload_type: Pt,
pub sequence_number: u16,
pub timestamp: u32,
pub ssrc: Ssrc,
pub ext_vals: ExtensionValues,
pub header_len: usize,
}
Expand description
Parsed header from an RTP packet.
Fields§
§version: u8
Always 2
has_padding: bool
Whether the RTP packet has padding to be an equal of 4 bytes.
has_extension: bool
RTP packet has “RTP header extensions”.
marker: bool
A marker indicates the end of a series of packets belonging together such as for a single video frame.
payload_type: Pt
Type of payload being carried. What this correlates to is sent in the SDP.
sequence_number: u16
Sequence number increasing by 1 for each RTP packet.
timestamp: u32
Timestamp in media time for the RTP packet. What the media time base is depends on the codec.
ssrc: Ssrc
Sender source identifier.
ext_vals: ExtensionValues
The extension values parsed using the mapping via SDP.
header_len: usize
Length 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.