pub struct RtpHeader { /* private fields */ }Expand description
RTP header.
Implementations§
Source§impl RtpHeader
impl RtpHeader
Sourcepub fn decode(data: &mut Bytes) -> Result<Self, InvalidInput>
pub fn decode(data: &mut Bytes) -> Result<Self, InvalidInput>
Decode an RTP header from given data.
Sourcepub fn with_padding(self, padding: bool) -> Self
pub fn with_padding(self, padding: bool) -> Self
Set the padding bit.
Sourcepub fn extension(&self) -> Option<&RtpHeaderExtension>
pub fn extension(&self) -> Option<&RtpHeaderExtension>
Check if there is an RTP header extension.
Sourcepub fn with_extension(self, extension: Option<RtpHeaderExtension>) -> Self
pub fn with_extension(self, extension: Option<RtpHeaderExtension>) -> Self
Set the extension bit.
Sourcepub fn with_marker(self, marker: bool) -> Self
pub fn with_marker(self, marker: bool) -> Self
Set the marker bit.
Sourcepub fn payload_type(&self) -> u8
pub fn payload_type(&self) -> u8
Get RTP payload type.
Note: Only the lower 7 bits are used.
Sourcepub fn with_payload_type(self, payload_type: u8) -> Self
pub fn with_payload_type(self, payload_type: u8) -> Self
Sourcepub fn sequence_number(&self) -> u16
pub fn sequence_number(&self) -> u16
Get RTP sequence number.
Sourcepub fn with_sequence_number(self, n: u16) -> Self
pub fn with_sequence_number(self, n: u16) -> Self
Set the sequence number.
Sourcepub fn with_timestamp(self, timestamp: u32) -> Self
pub fn with_timestamp(self, timestamp: u32) -> Self
Set RTP timestamp.
Sourcepub fn with_csrcs<T>(self, csrcs: T) -> Self
pub fn with_csrcs<T>(self, csrcs: T) -> Self
Set the CSRC identifiers.
§Panics
The method panics if the number of identifiers is greater than 255.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RtpHeader
impl RefUnwindSafe for RtpHeader
impl Send for RtpHeader
impl Sync for RtpHeader
impl Unpin 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