Struct rtp_types::RtpPacketMut

source ·
pub struct RtpPacketMut<'a> { /* private fields */ }
Expand description

Packet editing

Implementations§

source§

impl<'a> RtpPacketMut<'a>

source

pub const MIN_RTP_PACKET_LEN: usize = 12usize

The minimum number of bytes a RTP packet must be to be parsed correctly

source

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.

source

pub fn set_marker(&mut self, marker: bool)

Change the marker bit of this packet

source

pub fn set_payload_type(&mut self, pt: u8) -> Result<(), RtpWriteError>

Change the payload type of this packet

source

pub fn set_sequence_number(&mut self, sequence: u16)

Change the sequence number of this packet

source

pub fn set_timestamp(&mut self, timestamp: u32)

Change the timestamp of this packet

source

pub fn set_ssrc(&mut self, ssrc: u32)

Change the SSRC of this packet

Methods from Deref<Target = RtpPacket<'a>>§

source

pub const MIN_RTP_PACKET_LEN: usize = 12usize

source

pub const MAX_N_CSRCS: usize = 15usize

source

pub fn version(&self) -> u8

The RTP version in this packet. Only version 2 is supported.

source

pub fn padding(&self) -> Option<u8>

Returns the number of bytes of padding used by this packet or None

source

pub fn n_csrcs(&self) -> u8

Returns the number of Contribution Sources for this packet. May not be used by this packet.

source

pub fn marker(&self) -> bool

Returns whether the marker bit is set for this packet. The meaning of the marker bit is payload-specific

source

pub fn payload_type(&self) -> u8

Returns the payload type for this packet.

source

pub fn sequence_number(&self) -> u16

Returns the sequence number for this packet

source

pub fn timestamp(&self) -> u32

Returns the RTP timestamp for this packet

source

pub fn ssrc(&self) -> u32

Returns the Sychronisation Source for this packet

source

pub fn csrc(&self) -> impl Iterator<Item = u32> + '_

Returns a (potentially empty) iterator over the Contribution Sources for this packet

source

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.

source

pub fn payload(&self) -> &[u8]

Returns the payload data

source

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.

Trait Implementations§

source§

impl<'a> Deref for RtpPacketMut<'a>

§

type Target = RtpPacket<'a>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for RtpPacketMut<'a>

§

impl<'a> Send for RtpPacketMut<'a>

§

impl<'a> Sync for RtpPacketMut<'a>

§

impl<'a> Unpin for RtpPacketMut<'a>

§

impl<'a> !UnwindSafe for RtpPacketMut<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.