MillicastSDK 2.0.0
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
millicast::WebrtcRemoteTrack Class Referenceabstract

#include <track.h>

Inheritance diagram for millicast::WebrtcRemoteTrack:
Inheritance graph
[legend]

Classes

struct  Disabled
 
struct  MidUpdated
 

Public Types

enum  Kind { AUDIO , VIDEO }
 

Public Member Functions

 WebrtcRemoteTrack ()=default
 
 MC_DISABLE_COPY_AND_ASSIGN (WebrtcRemoteTrack)
 
virtual Kind kind () const =0
 
virtual Promise< void > unproject ()=0
 
virtual std::optional< std::string > get_current_mid () const =0
 
virtual const std::string & get_cname () const =0
 
virtual WebrtcRemoteVideoTrackas_video ()=0
 
virtual WebrtcRemoteAudioTrackas_audio ()=0
 
virtual EventConnectionPtr add_event_handler (EventHandler< Disabled > &&handler)=0
 
virtual EventConnectionPtr add_event_handler (EventHandler< MidUpdated > &&handler)=0
 
virtual EventConnectionPtr add_event_handler (EventHandler< FrameMetadata > &&handler)=0
 

Detailed Description

The webrtc logical track.

This class represents a remote track which was requested by the application for the purpose of implementing advanced projection schemes (like keeping the RTS media projected when they go inactive, or projecting the same RTS media onto multiple tracks).

Once obtained, the track remains valid as long as the viewer is not destroyed.

Member Enumeration Documentation

◆ Kind

The track's kind, audio or video

Enumerator
AUDIO 

audio

VIDEO 

video

Constructor & Destructor Documentation

◆ WebrtcRemoteTrack()

millicast::WebrtcRemoteTrack::WebrtcRemoteTrack ( )
default

Member Function Documentation

◆ add_event_handler() [1/3]

virtual EventConnectionPtr millicast::WebrtcRemoteTrack::add_event_handler ( EventHandler< Disabled > &&  handler)
pure virtual

Attach the event handler for the track becoming disabled.

Parameters
handlerthe callback to invoke when the track gets disabled.
Returns
event connection

◆ add_event_handler() [2/3]

virtual EventConnectionPtr millicast::WebrtcRemoteTrack::add_event_handler ( EventHandler< FrameMetadata > &&  handler)
pure virtual

Attach the event handler for frame metadata received on this track.

Parameters
handlerthe callback to invoke when frame metadata is received.
Returns
event connection

◆ add_event_handler() [3/3]

virtual EventConnectionPtr millicast::WebrtcRemoteTrack::add_event_handler ( EventHandler< MidUpdated > &&  handler)
pure virtual

Attach the event handler for the MID update.

Parameters
handlerthe callback to invoke when the MID is updated.
Returns
event connection

◆ as_audio()

virtual WebrtcRemoteAudioTrack * millicast::WebrtcRemoteTrack::as_audio ( )
pure virtual

Get the audio track interface.

Returns
the pointer to the audio track interface, or nullptr if this track is video.

◆ as_video()

virtual WebrtcRemoteVideoTrack * millicast::WebrtcRemoteTrack::as_video ( )
pure virtual

Get the video track interface.

Returns
the pointer to the video track interface, or nullptr if this track is audio.

◆ get_cname()

virtual const std::string & millicast::WebrtcRemoteTrack::get_cname ( ) const
pure virtual

◆ get_current_mid()

virtual std::optional< std::string > millicast::WebrtcRemoteTrack::get_current_mid ( ) const
pure virtual

Get the current MID of this track.

This function is implemented for convenience of simple applications, but its usage is discouraged. The applications requiring to map webrtc stats to specific tracks should maintain a mid:track map, updated based on the mid update events from the tracks. Such an implementation would allow for most efficient mapping of the stats back to the tracks.

Returns
MID or empty optional if this webrtc track currently has no MID.

◆ kind()

virtual Kind millicast::WebrtcRemoteTrack::kind ( ) const
pure virtual

Gets the kind.

Returns
AUDIO or VIDEO

◆ MC_DISABLE_COPY_AND_ASSIGN()

millicast::WebrtcRemoteTrack::MC_DISABLE_COPY_AND_ASSIGN ( WebrtcRemoteTrack  )

◆ unproject()

virtual Promise< void > millicast::WebrtcRemoteTrack::unproject ( )
pure virtual

Unproject this webrtc track.

After unprojection, the service no longer streams media to this track.

Returns
asynchronous status

The documentation for this class was generated from the following file: