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

TrackRemote represents a single inbound source of media

Implementations§

source§

impl TrackRemote

source

pub fn tid(&self) -> usize

source

pub fn id(&self) -> String

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

pub fn set_id(&self, s: String)

source

pub fn stream_id(&self) -> String

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

source

pub fn set_stream_id(&self, s: String)

source

pub fn rid(&self) -> &str

rid gets the RTP Stream ID of this Track With Simulcast you will have multiple tracks with the same ID, but different RID values. In many cases a TrackRemote will not have an RID, so it is important to assert it is non-zero

source

pub fn payload_type(&self) -> PayloadType

payload_type gets the PayloadType of the track

source

pub fn set_payload_type(&self, payload_type: PayloadType)

source

pub fn kind(&self) -> RTPCodecType

kind gets the Kind of the track

source

pub fn set_kind(&self, kind: RTPCodecType)

source

pub fn ssrc(&self) -> SSRC

ssrc gets the SSRC of the track

source

pub fn set_ssrc(&self, ssrc: SSRC)

source

pub fn msid(&self) -> String

msid gets the Msid of the track

source

pub fn codec(&self) -> RTCRtpCodecParameters

codec gets the Codec of the track

source

pub fn set_codec(&self, codec: RTCRtpCodecParameters)

source

pub fn params(&self) -> RTCRtpParameters

source

pub fn set_params(&self, params: RTCRtpParameters)

source

pub fn onmute<F>(&self, handler: F)
where F: FnMut() -> Pin<Box<dyn Future<Output = ()> + Send + 'static>> + Send + 'static + Sync,

source

pub fn onunmute<F>(&self, handler: F)
where F: FnMut() -> Pin<Box<dyn Future<Output = ()> + Send + 'static>> + Send + 'static + Sync,

source

pub async fn read(&self, b: &mut [u8]) -> Result<(Packet, Attributes)>

Reads data from the track.

Cancel Safety: This method is not cancel safe. Dropping the resulting Future before it returns [Poll::Ready] will cause data loss.

source

pub async fn read_rtp(&self) -> Result<(Packet, Attributes)>

read_rtp is a convenience method that wraps Read and unmarshals for you.

Trait Implementations§

source§

impl Debug for TrackRemote

source§

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

Formats the value using the given formatter. Read more

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
§

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

§

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

§

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

§

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.
§

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

§

fn vzip(self) -> V