Struct webrtc::track::track_remote::TrackRemote
source · pub struct TrackRemote { /* private fields */ }
Expand description
TrackRemote represents a single inbound source of media
Implementations
sourceimpl TrackRemote
impl TrackRemote
pub fn tid(&self) -> usize
sourcepub async fn id(&self) -> String
pub async 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’
pub async fn set_id(&self, s: String)
sourcepub async fn stream_id(&self) -> String
pub async fn stream_id(&self) -> String
stream_id is the group this track belongs too. This must be unique
pub async fn set_stream_id(&self, s: String)
sourcepub fn rid(&self) -> &str
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
sourcepub fn payload_type(&self) -> PayloadType
pub fn payload_type(&self) -> PayloadType
payload_type gets the PayloadType of the track
pub fn set_payload_type(&self, payload_type: PayloadType)
sourcepub fn kind(&self) -> RTPCodecType
pub fn kind(&self) -> RTPCodecType
kind gets the Kind of the track
pub fn set_kind(&self, kind: RTPCodecType)
pub fn set_ssrc(&self, ssrc: SSRC)
sourcepub async fn codec(&self) -> RTCRtpCodecParameters
pub async fn codec(&self) -> RTCRtpCodecParameters
codec gets the Codec of the track
pub async fn set_codec(&self, codec: RTCRtpCodecParameters)
pub async fn params(&self) -> RTCRtpParameters
pub async fn set_params(&self, params: RTCRtpParameters)
pub async fn onmute<F>(&self, handler: F)where
F: FnMut() -> Pin<Box<dyn Future<Output = ()> + Send + 'static>> + Send + 'static + Sync,
pub async fn onunmute<F>(&self, handler: F)where
F: FnMut() -> Pin<Box<dyn Future<Output = ()> + Send + 'static>> + Send + 'static + Sync,
sourcepub async fn read(&self, b: &mut [u8]) -> Result<(usize, Attributes)>
pub async fn read(&self, b: &mut [u8]) -> Result<(usize, Attributes)>
Read reads data from the track.
sourcepub async fn read_rtp(&self) -> Result<(Packet, Attributes)>
pub async fn read_rtp(&self) -> Result<(Packet, Attributes)>
read_rtp is a convenience method that wraps Read and unmarshals for you.