pub struct RtpPacket {
pub version: u8,
pub padding: bool,
pub extension: bool,
pub csrc_count: u8,
pub marker: bool,
pub payload_type: u8,
pub sequence_number: u16,
pub timestamp: u32,
pub ssrc: u32,
pub csrc: Vec<u32>,
pub payload: Vec<u8>,
}Expand description
RTP packet (RFC 3550)
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|V=2|P|X| CC |M| PT | sequence number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| timestamp |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| synchronization source (SSRC) identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+Fields§
§version: u8§padding: bool§extension: bool§csrc_count: u8§marker: bool§payload_type: u8§sequence_number: u16§timestamp: u32§ssrc: u32§csrc: Vec<u32>§payload: Vec<u8>Implementations§
Source§impl RtpPacket
impl RtpPacket
Sourcepub const MIN_HEADER_SIZE: usize = 12
pub const MIN_HEADER_SIZE: usize = 12
Minimum RTP header size (no CSRC, no extension)
Sourcepub fn new(
payload_type: u8,
sequence_number: u16,
timestamp: u32,
ssrc: u32,
) -> Self
pub fn new( payload_type: u8, sequence_number: u16, timestamp: u32, ssrc: u32, ) -> Self
Create a new RTP packet
Sourcepub fn with_payload(self, payload: Vec<u8>) -> Self
pub fn with_payload(self, payload: Vec<u8>) -> Self
Set the payload data
Sourcepub fn with_marker(self, marker: bool) -> Self
pub fn with_marker(self, marker: bool) -> Self
Set the marker bit
Trait Implementations§
impl Eq for RtpPacket
impl StructuralPartialEq for RtpPacket
Auto Trait Implementations§
impl Freeze for RtpPacket
impl RefUnwindSafe for RtpPacket
impl Send for RtpPacket
impl Sync for RtpPacket
impl Unpin for RtpPacket
impl UnsafeUnpin for RtpPacket
impl UnwindSafe for RtpPacket
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