Trait webrtc::media::track::track_local::TrackLocal[][src]

pub trait TrackLocal {
    fn bind<'life0, 'life1, 'async_trait>(
        &'life0 self,
        t: &'life1 TrackLocalContext
    ) -> Pin<Box<dyn Future<Output = Result<RTCRtpCodecParameters>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
fn unbind<'life0, 'life1, 'async_trait>(
        &'life0 self,
        t: &'life1 TrackLocalContext
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
fn id(&self) -> &str;
fn stream_id(&self) -> &str;
fn kind(&self) -> RTPCodecType;
fn as_any(&self) -> &dyn Any; }
Expand description

TrackLocal is an interface that controls how the user can send media The user can provide their own TrackLocal implementatiosn, or use the implementations in pkg/media

Required methods

bind should implement the way how the media data flows from the Track to the PeerConnection This will be called internally after signaling is complete and the list of available codecs has been determined

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

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 stream_id would be ‘desktop’ or ‘webcam’

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

kind controls if this TrackLocal is audio or video

Implementors