pub struct TrackLocalStaticRTP { /* private fields */ }
Expand description

TrackLocalStaticRTP is a TrackLocal that has a pre-set codec and accepts RTP Packets. If you wish to send a media.Sample use TrackLocalStaticSample

Implementations§

source§

impl TrackLocalStaticRTP

source

pub fn new(codec: RTCRtpCodecCapability, id: String, stream_id: String) -> Self

returns a TrackLocalStaticRTP.

source

pub fn codec(&self) -> RTCRtpCodecCapability

codec gets the Codec of the track

source

pub async fn any_binding_paused(&self) -> bool

source

pub async fn all_binding_paused(&self) -> bool

source

pub async fn write_rtp_with_extensions( &self, p: &Packet, extensions: &[HeaderExtension] ) -> Result<usize>

write_rtp_with_extensions writes a RTP Packet to the TrackLocalStaticRTP If one PeerConnection fails the packets will still be sent to all PeerConnections. The error message will contain the ID of the failed PeerConnections so you can remove them

If the RTCRtpSender direction is such that no packets should be sent, any call to this function are blocked internally. Care must be taken to not increase the sequence number while the sender is paused. While the actual sending is blocked, the receiver will miss out when the sequence number “rolls over”, which in turn will break SRTP.

Extensions that are already configured on the packet are overwritten by extensions in extensions.

Trait Implementations§

source§

impl Debug for TrackLocalStaticRTP

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl TrackLocal for TrackLocalStaticRTP

source§

fn bind<'life0, 'life1, 'async_trait>( &'life0 self, t: &'life1 TrackLocalContext ) -> Pin<Box<dyn Future<Output = Result<RTCRtpCodecParameters>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

bind is called by the PeerConnection after negotiation is complete This asserts that the code requested is supported by the remote peer. If so it setups all the state (SSRC and PayloadType) to have a call

source§

fn unbind<'life0, 'life1, 'async_trait>( &'life0 self, t: &'life1 TrackLocalContext ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

unbind implements the teardown logic when the track is no longer needed. This happens because a track has been stopped.

source§

fn id(&self) -> &str

id is the unique identifier for this Track. This should be unique for the stream, but doesn’t have to globally unique. A common example would be ‘audio’ or ‘video’ and StreamID would be ‘desktop’ or ‘webcam’

source§

fn stream_id(&self) -> &str

stream_id is the group this track belongs too. This must be unique

source§

fn kind(&self) -> RTPCodecType

kind controls if this TrackLocal is audio or video

source§

fn as_any(&self) -> &dyn Any

source§

impl TrackLocalWriter for TrackLocalStaticRTP

source§

fn write_rtp<'life0, 'life1, 'async_trait>( &'life0 self, p: &'life1 Packet ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

write_rtp writes a RTP Packet to the TrackLocalStaticRTP If one PeerConnection fails the packets will still be sent to all PeerConnections. The error message will contain the ID of the failed PeerConnections so you can remove them

If the RTCRtpSender direction is such that no packets should be sent, any call to this function are blocked internally. Care must be taken to not increase the sequence number while the sender is paused. While the actual sending is blocked, the receiver will miss out when the sequence number “rolls over”, which in turn will break SRTP.

source§

fn write<'life0, 'life1, 'async_trait>( &'life0 self, b: &'life1 [u8] ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

write writes a RTP Packet as a buffer to the TrackLocalStaticRTP If one PeerConnection fails the packets will still be sent to all PeerConnections. The error message will contain the ID of the failed PeerConnections so you can remove them

Auto Trait Implementations§

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

source§

fn implicit( self, class: Class, constructed: bool, tag: u32 ) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

source§

fn implicit( self, class: Class, constructed: bool, tag: u32 ) -> TaggedParser<'a, Implicit, Self, E>

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> Same for T

§

type Output = T

Should always be Self
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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V