1#ifndef MILLICAST_API_TRACK_H
2#define MILLICAST_API_TRACK_H
42 [[nodiscard]]
virtual const std::string&
id()
const = 0;
49 [[nodiscard]]
virtual const std::string&
kind()
const = 0;
150#ifndef MC_DISABLE_COPY_AND_ASSIGN
151#define MC_DISABLE_COPY_AND_ASSIGN(Klass) \
152 Klass(Klass&&) = delete; \
153 Klass(const Klass&) = delete; \
154 Klass& operator=(Klass&&) = delete; \
155 Klass& operator=(const Klass&) = delete
159class RtsRemoteVideoTrack;
160class RtsRemoteAudioTrack;
161class WebrtcRemoteAudioTrack;
162class WebrtcRemoteVideoTrack;
215 std::optional<std::string>
mid;
371 std::optional<int> target_fps{};
374 std::optional<int> target_width{};
442 [[nodiscard]]
virtual const std::optional<std::string>&
source_id()
const = 0;
515 operator bool() const noexcept {
516 return encodingId || spatialLayerId || temporalLayerId ||
517 maxSpatialLayerId || maxTemporalLayerId;
551 const Layer& layer = {},
552 bool promote =
false) = 0;
626 bool promote =
false) = 0;
637 const std::shared_ptr<VideoRenderer>& renderer) = 0;
The AudioRenderer class is responsible for rendering audio in a specific way in your application.
Definition renderer.h:70
The AudioTrack class.
Definition track.h:121
virtual void set_volume(double volume)=0
Set the track's volume.
~AudioTrack() override=default
virtual void add_renderer(AudioRenderer *renderer)=0
Add an audio renderer to render this track. Several renderers can be added to the track....
virtual void remove_renderer(AudioRenderer *renderer)=0
Remove a renderer from the renderer list.
RtsRemoteAudioTrack()=default
MC_DISABLE_COPY_AND_ASSIGN(RtsRemoteAudioTrack)
virtual Promise< void > set_volume(double volume)=0
virtual Promise< void > enable()=0
virtual Promise< void > disable()=0
virtual EventConnectionPtr add_event_handler(EventHandler< Inactive > &&handler)=0
virtual Kind kind() const =0
virtual EventConnectionPtr add_event_handler(EventHandler< Active > &&handler)=0
virtual const std::optional< std::string > & source_id() const =0
MC_DISABLE_COPY_AND_ASSIGN(RtsRemoteTrack)
virtual EventConnectionPtr add_event_handler(EventHandler< FrameMetadata > &&handler)=0
virtual EventConnectionPtr add_event_handler(EventHandler< Layers > &&handler)=0
virtual EventConnectionPtr add_event_handler(EventHandler< MidUpdated > &&handler)=0
virtual RtsRemoteVideoTrack * as_video()=0
virtual bool is_active() const =0
virtual std::optional< std::string > get_current_mid() const =0
virtual RtsRemoteAudioTrack * as_audio()=0
virtual millicast::Promise< void > enable_frame_metadata(bool enabled)=0
MC_DISABLE_COPY_AND_ASSIGN(RtsRemoteVideoTrack)
virtual Promise< void > enable(const std::shared_ptr< VideoRenderer > &renderer, const Layer &layer={}, bool promote=false)=0
RtsRemoteVideoTrack()=default
The Track class represent a media sources.
Definition track.h:32
virtual const std::string & kind() const =0
Get the track's kind.
virtual const std::string & id() const =0
Get the track's id.
virtual void enable(bool e)=0
enable or disable the track. A disabled track will produce silence (if audio) or black frames (if vid...
virtual bool is_enabled() const =0
Tell whether the track is enabled or not.
The VideoRenderer class Inherits this class to receive video frames and render them in your applicati...
Definition renderer.h:46
The VideoTrack class.
Definition track.h:74
~VideoTrack() override=default
virtual void remove_renderer(VideoRenderer *renderer)=0
Remove a renderer from the renderer list.
virtual ContentHint content_hint() const noexcept=0
Get the current content hint for this track.
ContentHint
Video track content hint, used to override the source is_screencast property.
Definition track.h:80
virtual void set_content_hint(ContentHint hint) noexcept=0
Set the content hint for this track.
virtual void add_renderer(VideoRenderer *renderer)=0
Add a VideoRenderer to render this video track. Several renderers can be added to the track....
MC_DISABLE_COPY_AND_ASSIGN(WebrtcRemoteAudioTrack)
virtual Promise< void > set_volume(double volume)=0
virtual Promise< RtsRemoteAudioTrack * > current_projection()=0
virtual Promise< void > project(RtsRemoteAudioTrack &rts_track)=0
WebrtcRemoteAudioTrack()=default
Kind
Definition track.h:183
@ AUDIO
audio
Definition track.h:184
virtual EventConnectionPtr add_event_handler(EventHandler< MidUpdated > &&handler)=0
virtual EventConnectionPtr add_event_handler(EventHandler< Disabled > &&handler)=0
MC_DISABLE_COPY_AND_ASSIGN(WebrtcRemoteTrack)
virtual WebrtcRemoteAudioTrack * as_audio()=0
virtual Promise< void > unproject()=0
virtual WebrtcRemoteVideoTrack * as_video()=0
virtual std::optional< std::string > get_current_mid() const =0
virtual EventConnectionPtr add_event_handler(EventHandler< FrameMetadata > &&handler)=0
WebrtcRemoteTrack()=default
virtual const std::string & get_cname() const =0
virtual Kind kind() const =0
virtual Promise< void > project(RtsRemoteVideoTrack &rts_track, const RtsRemoteVideoTrack::Layer &layer={}, bool promote=false)=0
virtual Promise< void > add_renderer(const std::shared_ptr< VideoRenderer > &renderer)=0
virtual Promise< void > remove_renderer(const VideoRenderer *renderer)=0
virtual Promise< RtsRemoteVideoTrack * > current_projection()=0
virtual millicast::Promise< void > enable_frame_metadata(bool enabled)=0
MC_DISABLE_COPY_AND_ASSIGN(WebrtcRemoteVideoTrack)
WebrtcRemoteVideoTrack()=default
#define MILLICAST_API
Definition exports.h:51
Definition capabilities.h:15
std::function< void(const EventTypes &...)> EventHandler
Definition event_handling.h:10
std::unique_ptr< EventConnection > EventConnectionPtr
Definition event_handling.h:31
The layer data is used to select a simulcast/svc layer. by sending a command to the server using the ...
Definition track.h:366
std::optional< int > temporal_layer_id
Definition track.h:375
std::string encoding_id
Definition track.h:367
std::optional< Resolution > layer_resolution
The resolution of the frame for simulcast / SVC layer.
Definition track.h:378
std::optional< int > max_spatial_layer_id
Definition track.h:384
std::optional< int > max_temporal_layer_id
Definition track.h:381
std::optional< int > spatial_layer_id
Definition track.h:376
Represents resolution of a video frame.
Definition track.h:357
int width
Definition track.h:358
int height
Definition track.h:359
std::vector< Layer > active
Definition track.h:387
std::vector< std::string > inactive
Definition track.h:388
std::optional< int > maxTemporalLayerId
Definition track.h:513
std::optional< int > temporalLayerId
Definition track.h:511
std::optional< std::string > encodingId
Definition track.h:509
std::optional< int > maxSpatialLayerId
Definition track.h:512
std::optional< int > spatialLayerId
Definition track.h:510
std::optional< std::string > mid
Definition track.h:215