1#ifndef MILLICAST_API_CLIENT_H
2#define MILLICAST_API_CLIENT_H
128 bool auto_reconnect{
true};
142 std::optional<DegradationPreferences>
188inline namespace compat {
203 virtual bool connect(
const std::optional<ConnectionOptions>&
204 connection_options = std::nullopt) = 0;
215 const std::optional<ConnectionOptions>&
216 connection_options = std::nullopt) = 0;
247 virtual std::optional<std::string>
get_mid(
const std::string& track_id) = 0;
276 std::optional<ConnectionOptions>&& connection_options) = 0;
289 std::optional<ConnectionOptions>&& connection_options) = 0;
318 std::string&& track_id) = 0;
static std::list< std::string > get_supported_video_codecs()
get_supported_video_codecs returns the list of the supported video codecs.
virtual ~ClientBase()=default
static void cleanup()
Clean and free the memory of dynamic objects.
static std::list< std::string > get_supported_audio_codecs()
get_supported_audio_codecs returns the list of the supported audio codecs.
The Client base class.
Definition client.h:194
virtual bool is_connected() const =0
is_connected
virtual bool connect(const std::optional< ConnectionOptions > &connection_options=std::nullopt)=0
Connect and open a websocket connection with the Millicast platform.
virtual std::optional< std::string > get_mid(const std::string &track_id)=0
Get the transceiver mid associated to a track if any.
virtual bool disconnect()=0
Disconnect from Millicast. The websocket connection to Millicast will no longer be active after disco...
virtual void enable_stats(bool enable)=0
Enable the rtc stats collecting. The stats are collected once the client is either publishing or subs...
virtual void enable_frame_transformer(bool enable)=0
Add frame transformer so you can add metadata to frame When a new transformable frame is available,...
virtual bool connect(const JsonData &data, const std::optional< ConnectionOptions > &connection_options=std::nullopt)=0
Connect to the media server directly using the websocket url and the JWT.
The Client base class.
Definition client.h:265
virtual Promise< void > disconnect()=0
Disconnect from Millicast. The websocket connection to Millicast will no longer be active after disco...
virtual Promise< void > connect(std::optional< ConnectionOptions > &&connection_options)=0
Connect and open a websocket connection with the Millicast platform.
virtual Promise< bool > is_connected() const =0
is_connected
virtual Promise< void > connect(JsonData &&data, std::optional< ConnectionOptions > &&connection_options)=0
Connect to the media server directly using the websocket url and the JWT.
virtual Promise< void > enable_stats(bool enable)=0
Enable the rtc stats collecting. The stats are collected once the client is either publishing or subs...
virtual Promise< void > enable_frame_transformer(bool enable)=0
Add frame transformer so you can add metadata to frame When a new transformable frame is available,...
virtual Promise< std::optional< std::string > > get_mid(std::string &&track_id)=0
#define MILLICAST_API
Definition exports.h:51
Definition capabilities.h:15
DegradationPreferences
The DegradationPreferences enum.
Definition client.h:29
Allows setting the desired minimum and/or maximum bitrates when publishing a stream....
Definition client.h:51
std::optional< int > max_bitrate_kbps
Definition client.h:54
bool disable_bwe
Definition client.h:52
std::optional< int > min_bitrate_kbps
Definition client.h:53
Connection related options.
Definition client.h:121
Authentication data returned by the director api in order to open a websocket connection.
Definition client.h:153
std::string jwt
Definition client.h:155
std::string ws_url
Definition client.h:154
The Client Listener struct which contains methods that will be called on specific events from a Clien...
Definition client.h:70
virtual void on_signaling_error(const std::string &message)=0
Called when millicast sends back an error message in response to a websocket command.
virtual void on_connection_error(int status, const std::string &reason)=0
on_connection_error is called when the attempt to connect to Millicast failed.
virtual void on_connected()=0
on_connected is called when the WebSocket connection to Millicast is opened
virtual ~ClientListener()=default
virtual void on_disconnected()=0
on_disconnected is called when the WebSocket connection to Millicast is closed. If this was an uninte...
virtual void on_stats_report(std::unique_ptr< StatsReport >)
on_stats_report is called when a new rtc stats report has been collected.
Definition client.h:106
virtual void on_viewer_count(int count)=0
Called when a new viewer join the stream or when a viewer quit the stream.
The ClientOption struct allows to setup the millicast connection.
Definition client.h:134
int stats_delay_ms
Definition client.h:140
std::optional< bool > stereo
Definition client.h:136
std::optional< bool > dtx
Definition client.h:138
std::optional< DegradationPreferences > degradation
Definition client.h:143
std::string rtc_event_log_output_path
Definition client.h:146
Useful informations about the available tracks in the media server. These informations are received i...
Definition client.h:61
std::string track_id
Definition client.h:63
std::string media
Definition client.h:62