Struct rtp_types::RtpPacketMut
source · pub struct RtpPacketMut<'a> { /* private fields */ }Expand description
Packet editing
Implementations§
source§impl<'a> RtpPacketMut<'a>
impl<'a> RtpPacketMut<'a>
sourcepub const MIN_RTP_PACKET_LEN: usize = 12usize
pub const MIN_RTP_PACKET_LEN: usize = 12usize
The minimum number of bytes a RTP packet must be to be parsed correctly
sourcepub fn parse(data: &'a mut [u8]) -> Result<RtpPacketMut<'a>, RtpParseError>
pub fn parse(data: &'a mut [u8]) -> Result<RtpPacketMut<'a>, RtpParseError>
Parse a byte slice into an editable RtpPacketMut. The packet is first parsed using
RtpPacket::parse and will fail if parsing fails.
sourcepub fn set_marker(&mut self, marker: bool)
pub fn set_marker(&mut self, marker: bool)
Change the marker bit of this packet
sourcepub fn set_payload_type(&mut self, pt: u8) -> Result<(), RtpWriteError>
pub fn set_payload_type(&mut self, pt: u8) -> Result<(), RtpWriteError>
Change the payload type of this packet
sourcepub fn set_sequence_number(&mut self, sequence: u16)
pub fn set_sequence_number(&mut self, sequence: u16)
Change the sequence number of this packet
sourcepub fn set_timestamp(&mut self, timestamp: u32)
pub fn set_timestamp(&mut self, timestamp: u32)
Change the timestamp of this packet
Methods from Deref<Target = RtpPacket<'a>>§
pub const MIN_RTP_PACKET_LEN: usize = 12usize
pub const MAX_N_CSRCS: usize = 15usize
sourcepub fn padding(&self) -> Option<u8>
pub fn padding(&self) -> Option<u8>
Returns the number of bytes of padding used by this packet or None
sourcepub fn n_csrcs(&self) -> u8
pub fn n_csrcs(&self) -> u8
Returns the number of Contribution Sources for this packet. May not be used by this packet.
sourcepub fn marker(&self) -> bool
pub fn marker(&self) -> bool
Returns whether the marker bit is set for this packet. The meaning of the marker bit is payload-specific
sourcepub fn payload_type(&self) -> u8
pub fn payload_type(&self) -> u8
Returns the payload type for this packet.
sourcepub fn sequence_number(&self) -> u16
pub fn sequence_number(&self) -> u16
Returns the sequence number for this packet
sourcepub fn csrc(&self) -> impl Iterator<Item = u32> + '_
pub fn csrc(&self) -> impl Iterator<Item = u32> + '_
Returns a (potentially empty) iterator over the Contribution Sources for this packet
sourcepub fn extension(&self) -> Option<(u16, &[u8])>
pub fn extension(&self) -> Option<(u16, &[u8])>
Returns the extension data for this packet. The first value is an identifier and is ‘defined by the RTP profile’. The second value is the extension data.
sourcepub fn as_builder(&'a self) -> RtpPacketBuilder<&'a [u8], &'a [u8]>
pub fn as_builder(&'a self) -> RtpPacketBuilder<&'a [u8], &'a [u8]>
Creates a builder that will be able to reconstruct this packet byte for byte (excluding any padding bytes). Any aspect of the returned builder can be modified.