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

#include <track.h>

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

Classes

struct  Active
 
struct  Inactive
 
struct  Layers
 

Public Types

using MidUpdated = WebrtcRemoteTrack::MidUpdated
 
using Kind = WebrtcRemoteTrack::Kind
 

Public Member Functions

 RtsRemoteTrack ()=default
 
 MC_DISABLE_COPY_AND_ASSIGN (RtsRemoteTrack)
 
virtual EventConnectionPtr add_event_handler (EventHandler< Active > &&handler)=0
 
virtual EventConnectionPtr add_event_handler (EventHandler< Inactive > &&handler)=0
 
virtual EventConnectionPtr add_event_handler (EventHandler< Layers > &&handler)=0
 
virtual EventConnectionPtr add_event_handler (EventHandler< MidUpdated > &&handler)=0
 
virtual EventConnectionPtr add_event_handler (EventHandler< FrameMetadata > &&handler)=0
 
virtual const std::optional< std::string > & source_id () const =0
 
virtual Kind kind () const =0
 
virtual bool is_active () const =0
 
virtual std::optional< std::string > get_current_mid () const =0
 
virtual Promise< void > disable ()=0
 
virtual RtsRemoteVideoTrackas_video ()=0
 
virtual RtsRemoteAudioTrackas_audio ()=0
 

Detailed Description

The RTS logical track.

This class represents a single media (audio or video) in the RTS stream.

The RTS tracks are created automatically when the service notifies about the sources becoming active, can be used to enable simple streaming scenarios: enable projection of the audio and video coming from the same source with lip-sync, with a single video renderer attached to the video track. When the RTS source goes inactive, streaming for them is automatically disabled.

Member Typedef Documentation

◆ Kind

◆ MidUpdated

The event for updating the MID of the internal webrtc track used by this RTS track.

Constructor & Destructor Documentation

◆ RtsRemoteTrack()

millicast::RtsRemoteTrack::RtsRemoteTrack ( )
default

Member Function Documentation

◆ add_event_handler() [1/5]

virtual EventConnectionPtr millicast::RtsRemoteTrack::add_event_handler ( EventHandler< Active > &&  handler)
pure virtual

Attach the event handler for the track entering the active state.

Parameters
handlerthe callback to invoke when the track goes active.
Returns
event connection

◆ add_event_handler() [2/5]

virtual EventConnectionPtr millicast::RtsRemoteTrack::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/5]

virtual EventConnectionPtr millicast::RtsRemoteTrack::add_event_handler ( EventHandler< Inactive > &&  handler)
pure virtual

Attach the event handler for the track entering the inactive state.

Parameters
handlerthe callback to invoke when the track goes inactive.
Returns
event connection

◆ add_event_handler() [4/5]

virtual EventConnectionPtr millicast::RtsRemoteTrack::add_event_handler ( EventHandler< Layers > &&  handler)
pure virtual

Attach the event handler for the track layers update.

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

◆ add_event_handler() [5/5]

virtual EventConnectionPtr millicast::RtsRemoteTrack::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 RtsRemoteAudioTrack * millicast::RtsRemoteTrack::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 RtsRemoteVideoTrack * millicast::RtsRemoteTrack::as_video ( )
pure virtual

Get the video track interface.

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

◆ disable()

virtual Promise< void > millicast::RtsRemoteTrack::disable ( )
pure virtual

Disable the RTS track.

This function unprojects the default track, and removes the renderer in case of video tracks. Disabling RTS track does not unproject it from any custom webrtc tracks which might have been projected separately.

Returns
asynchronous status.

◆ get_current_mid()

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

Get the current MID of the default webrtc track used by this RTS 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.

◆ is_active()

virtual bool millicast::RtsRemoteTrack::is_active ( ) const
pure virtual

Check if the track is active.

Note: properly written applications should rely on the Active and Inactive events. The activity status can change at any time.

Returns
true if the source was active, false otherwise

◆ kind()

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

Get the kind (audio or video) of this track.

Returns
AUDIO or VIDEO

◆ MC_DISABLE_COPY_AND_ASSIGN()

millicast::RtsRemoteTrack::MC_DISABLE_COPY_AND_ASSIGN ( RtsRemoteTrack  )

◆ source_id()

virtual const std::optional< std::string > & millicast::RtsRemoteTrack::source_id ( ) const
pure virtual

Get the RTS source ID of this track.

RTS tracks with the same source ID use the internal webrtc tracks with the same stream names, causing lip-sync for audio and video tracks.

Returns
source ID, or empty optional if this track represents media in the defualt source.

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