Struct rtp_rs::RtpPacketBuilder [−][src]
pub struct RtpPacketBuilder<'a> { /* fields omitted */ }
Expand description
A new packet build which collects the data which should be written as RTP packet
Implementations
impl<'a> RtpPacketBuilder<'a>
[src]
impl<'a> RtpPacketBuilder<'a>
[src]pub fn payload_type(self, payload_type: u8) -> Self
[src]
pub fn payload_type(self, payload_type: u8) -> Self
[src]Set the payload type.
The type must be in range of [0; 127],
else RtpPacketBuilder::build_info
will fail.
pub fn padded(self, pad: Pad) -> Self
[src]
pub fn padded(self, pad: Pad) -> Self
[src]Control if and how bytes are appended to the packet if the headers and payload together do not have an appropriate length (for instance if the length of the resulting RTP data must be a multiple of 4 bytes).
The default is Pad::none()
- no padding bytes will be added and the padding flag will not
be set in the RTP header.
pub fn add_csrc(self, csrc: u32) -> Self
[src]
pub fn add_csrc(self, csrc: u32) -> Self
[src]Add a contributing source (csrc). If added more than 15 contributing sources the rest will be discarded.
pub fn set_csrc(self, csrcs: &[u32]) -> Self
[src]
pub fn set_csrc(self, csrcs: &[u32]) -> Self
[src]Set the contributing sources (csrc). If added more than 15 contributing sources the rest will be discarded.
pub fn extension(self, id: u16, payload: &'a [u8]) -> Self
[src]
pub fn extension(self, id: u16, payload: &'a [u8]) -> Self
[src]Add a custom extension payload.
The bytes should be aligned to a a four byte boundary,
else RtpPacketBuilder::build_info
will fail.
pub fn target_length(&self) -> usize
[src]
pub fn target_length(&self) -> usize
[src]Calculate the target length of the packet.
This can be used to allocate a buffer for the build_into
method.
pub fn build_into_unchecked(&self, target: &mut [u8]) -> usize
[src]
pub fn build_into_unchecked(&self, target: &mut [u8]) -> usize
[src]Build the packet into the target buffer but ignore all validity checks.
pub fn build_into(
&self,
target: &mut [u8]
) -> Result<usize, RtpPacketBuildError>
[src]
pub fn build_into(
&self,
target: &mut [u8]
) -> Result<usize, RtpPacketBuildError>
[src]Build the RTP packet on the target buffer. The length of the final packet will be returned on success.
Trait Implementations
impl<'a> Clone for RtpPacketBuilder<'a>
[src]
impl<'a> Clone for RtpPacketBuilder<'a>
[src]fn clone(&self) -> RtpPacketBuilder<'a>
[src]
fn clone(&self) -> RtpPacketBuilder<'a>
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl<'a> RefUnwindSafe for RtpPacketBuilder<'a>
impl<'a> Send for RtpPacketBuilder<'a>
impl<'a> Sync for RtpPacketBuilder<'a>
impl<'a> Unpin for RtpPacketBuilder<'a>
impl<'a> UnwindSafe for RtpPacketBuilder<'a>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more