pub struct RtpPacket<'p> { /* private fields */ }
Expand description
A structure enabling manipulation of on the wire packets
Implementations§
source§impl<'a> RtpPacket<'a>
impl<'a> RtpPacket<'a>
sourcepub fn new<'p>(packet: &'p [u8]) -> Option<RtpPacket<'p>>
pub fn new<'p>(packet: &'p [u8]) -> Option<RtpPacket<'p>>
Constructs a new RtpPacket. If the provided buffer is less than the minimum required packet size, this will return None.
sourcepub fn owned(packet: Vec<u8>) -> Option<RtpPacket<'static>>
pub fn owned(packet: Vec<u8>) -> Option<RtpPacket<'static>>
Constructs a new RtpPacket. If the provided buffer is less than the minimum required packet size, this will return None. With this constructor the RtpPacket will own its own data and the underlying buffer will be dropped when the RtpPacket is.
sourcepub fn to_immutable<'p>(&'p self) -> RtpPacket<'p>
pub fn to_immutable<'p>(&'p self) -> RtpPacket<'p>
Maps from a RtpPacket to a RtpPacket
sourcepub fn consume_to_immutable(self) -> RtpPacket<'a>
pub fn consume_to_immutable(self) -> RtpPacket<'a>
Maps from a RtpPacket to a RtpPacket while consuming the source
sourcepub const fn minimum_packet_size() -> usize
pub const fn minimum_packet_size() -> usize
The minimum size (in bytes) a packet of this type can be. It’s based on the total size of the fixed-size fields.
sourcepub fn packet_size(_packet: &Rtp) -> usize
pub fn packet_size(_packet: &Rtp) -> usize
The size (in bytes) of a Rtp instance when converted into a byte-array
sourcepub fn get_version(&self) -> u2
pub fn get_version(&self) -> u2
Get the version field.
sourcepub fn get_padding(&self) -> u1
pub fn get_padding(&self) -> u1
Get the padding field.
sourcepub fn get_extension(&self) -> u1
pub fn get_extension(&self) -> u1
Get the extension field.
sourcepub fn get_csrc_count(&self) -> u4
pub fn get_csrc_count(&self) -> u4
Get the csrc_count field.
sourcepub fn get_marker(&self) -> u1
pub fn get_marker(&self) -> u1
Get the marker field.
sourcepub fn get_payload_type(&self) -> RtpType
pub fn get_payload_type(&self) -> RtpType
Get the value of the payload_type field
sourcepub fn get_sequence(&self) -> Wrap16
pub fn get_sequence(&self) -> Wrap16
Get the value of the sequence field
sourcepub fn get_timestamp(&self) -> Wrap32
pub fn get_timestamp(&self) -> Wrap32
Get the value of the timestamp field
sourcepub fn get_ssrc(&self) -> u32be
pub fn get_ssrc(&self) -> u32be
Get the ssrc field. This field is always stored big-endian within the struct, but this accessor returns host order.
sourcepub fn get_csrc_list_raw(&self) -> &[u8]
pub fn get_csrc_list_raw(&self) -> &[u8]
Get the raw &u8 value of the csrc_list field, without copying
sourcepub fn get_csrc_list(&self) -> Vec<u32be>
pub fn get_csrc_list(&self) -> Vec<u32be>
Get the value of the csrc_list field (copies contents)