pub struct Header {
pub version: u8,
pub padding: bool,
pub extension: bool,
pub marker: bool,
pub payload_type: u8,
pub sequence_number: u16,
pub timestamp: u32,
pub ssrc: u32,
pub csrc: Vec<u32>,
pub extension_profile: u16,
pub extensions: Vec<Extension>,
pub extensions_padding: usize,
}Expand description
Header represents an RTP packet header NOTE: PayloadOffset is populated by Marshal/Unmarshal and should not be modified
Fields§
§version: u8The RTP version, always 2.
padding: boolWhether the payload is followed by padding octets, the last giving the padding length.
extension: boolWhether a header-extension block follows the fixed header.
marker: boolThe marker bit: the last packet of a video frame, or the start of a talk spurt for audio.
payload_type: u8The payload type, which identifies the codec as negotiated in SDP.
sequence_number: u16Increments by one per packet sent; used to detect loss and restore order.
timestamp: u32The sampling instant of the first octet, in the codec’s clock rate.
ssrc: u32The synchronization source — the identifier of the stream this packet belongs to.
csrc: Vec<u32>The contributing sources, listed when a mixer combined several streams.
extension_profile: u16Which header-extension form is in use: EXTENSION_PROFILE_ONE_BYTE or
EXTENSION_PROFILE_TWO_BYTE.
extensions: Vec<Extension>The header extensions present on this packet.
extensions_padding: usizePadding bytes appended to the extension block so it ends on a 32-bit boundary.
Implementations§
Source§impl Header
impl Header
Sourcepub fn get_extension_payload_len(&self) -> usize
pub fn get_extension_payload_len(&self) -> usize
The total encoded length of the extension payloads, padding excluded.
Sourcepub fn set_extension(&mut self, id: u8, payload: Bytes) -> Result<()>
pub fn set_extension(&mut self, id: u8, payload: Bytes) -> Result<()>
SetExtension sets an RTP header extension
Sourcepub fn get_extension_ids(&self) -> Vec<u8> ⓘ
pub fn get_extension_ids(&self) -> Vec<u8> ⓘ
returns an extension id array
Sourcepub fn get_extension(&self, id: u8) -> Option<Bytes>
pub fn get_extension(&self, id: u8) -> Option<Bytes>
returns an RTP header extension
Sourcepub fn del_extension(&mut self, id: u8) -> Result<()>
pub fn del_extension(&mut self, id: u8) -> Result<()>
Removes an RTP Header extension
Trait Implementations§
impl Eq for Header
Source§impl MarshalSize for Header
impl MarshalSize for Header
Source§fn marshal_size(&self) -> usize
fn marshal_size(&self) -> usize
MarshalSize returns the size of the packet once marshaled.