pub struct RtpHeader {
pub version: u8,
pub padding: bool,
pub extension: bool,
pub csrc_count: u8,
pub marker: bool,
pub payload_type: u8,
pub sequence: u16,
pub timestamp: u32,
pub ssrc: u32,
pub csrc: Vec<u32>,
pub extension_data: Option<Vec<u8>>,
}Expand description
RTP packet header (RFC 3550).
Fields§
§version: u8RTP version (always 2).
padding: boolPadding flag.
extension: boolExtension flag.
csrc_count: u8CSRC count.
marker: boolMarker bit.
payload_type: u8Payload type (0-127).
sequence: u16Sequence number (wraps at 65535).
timestamp: u32Timestamp in clock rate units.
ssrc: u32Synchronization source identifier.
csrc: Vec<u32>Contributing source identifiers (0-15 entries).
extension_data: Option<Vec<u8>>Header extension data (if extension flag is set).
Implementations§
Source§impl RtpHeader
impl RtpHeader
Sourcepub fn new(payload_type: u8, sequence: u16, timestamp: u32, ssrc: u32) -> Self
pub fn new(payload_type: u8, sequence: u16, timestamp: u32, ssrc: u32) -> Self
Create a new RTP header with default values.
Sourcepub fn with_marker(self) -> Self
pub fn with_marker(self) -> Self
Create a header with the marker bit set (e.g., for first packet of a talkspurt).
Sourcepub fn header_length(&self) -> usize
pub fn header_length(&self) -> usize
Get the total header length in bytes.
Trait Implementations§
impl Eq for RtpHeader
impl StructuralPartialEq for RtpHeader
Auto Trait Implementations§
impl Freeze for RtpHeader
impl RefUnwindSafe for RtpHeader
impl Send for RtpHeader
impl Sync for RtpHeader
impl Unpin for RtpHeader
impl UnsafeUnpin for RtpHeader
impl UnwindSafe for RtpHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more