MillicastSDK 1.8.4
Loading...
Searching...
No Matches
Public Member Functions | List of all members
millicast::compat::Client Class Referenceabstract

The Client base class. More...

#include <client.h>

Inheritance diagram for millicast::compat::Client:
Inheritance graph
[legend]
Collaboration diagram for millicast::compat::Client:
Collaboration graph
[legend]

Public Member Functions

virtual bool connect (const std::optional< ConnectionOptions > &connection_options=std::nullopt)=0
 Connect and open a websocket connection with the Millicast platform.
 
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.
 
virtual bool is_connected () const =0
 is_connected
 
virtual bool disconnect ()=0
 Disconnect from Millicast. The websocket connection to Millicast will no longer be active after disconnect is complete. If the client is currently publishing/subscribing, the SDK will first stop the publishing/subscribing before disconnecting.
 
virtual void enable_stats (bool enable)=0
 Enable the rtc stats collecting. The stats are collected once the client is either publishing or subscribed.
 
virtual std::optional< std::string > get_mid (const std::string &track_id)=0
 Get the transceiver mid associated to a track if any.
 
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, the listener method on_transformable_frame will be called.
 
- Public Member Functions inherited from millicast::ClientBase
virtual ~ClientBase ()=default
 

Additional Inherited Members

- Public Types inherited from millicast::ClientBase
using Listener = ClientListener
 
using ConnectionOptions = ClientConnectionOptions
 
using Option = ClientOption
 
using JsonData = ClientJsonData
 
- Static Public Member Functions inherited from millicast::ClientBase
static std::list< std::string > get_supported_video_codecs ()
 get_supported_video_codecs returns the list of the supported video codecs.
 
static std::list< std::string > get_supported_audio_codecs ()
 get_supported_audio_codecs returns the list of the supported audio codecs.
 
static void cleanup ()
 Clean and free the memory of dynamic objects.
 

Detailed Description

The Client base class.

This is the base class to handle a connection with the Millicast platform.

Member Function Documentation

◆ connect() [1/2]

virtual bool millicast::compat::Client::connect ( const JsonData data,
const std::optional< ConnectionOptions > &  connection_options = std::nullopt 
)
pure virtual

Connect to the media server directly using the websocket url and the JWT.

Parameters
dataThe JSON data returned by the director api.
Returns
false if an error occurred, true otherwise.
Remarks
Returning true does not mean you are connected. You are connected when the Listener's method on_connected is called.

◆ connect() [2/2]

virtual bool millicast::compat::Client::connect ( const std::optional< ConnectionOptions > &  connection_options = std::nullopt)
pure virtual

Connect and open a websocket connection with the Millicast platform.

Returns
false if an error occurred, true otherwise.
Remarks
You must set valid credentials before using this method.
Returning true does not mean you are connected. You are connected when the Listener's method on_connected is called.

◆ disconnect()

virtual bool millicast::compat::Client::disconnect ( )
pure virtual

Disconnect from Millicast. The websocket connection to Millicast will no longer be active after disconnect is complete. If the client is currently publishing/subscribing, the SDK will first stop the publishing/subscribing before disconnecting.

Returns
false if unable to reach a disconnected state, true otherwise.

◆ enable_frame_transformer()

virtual void millicast::compat::Client::enable_frame_transformer ( bool  enable)
pure virtual

Add frame transformer so you can add metadata to frame When a new transformable frame is available, the listener method on_transformable_frame will be called.

Parameters
enabletrue to enable the frame transformer false to disable it

◆ enable_stats()

virtual void millicast::compat::Client::enable_stats ( bool  enable)
pure virtual

Enable the rtc stats collecting. The stats are collected once the client is either publishing or subscribed.

Parameters
enabletrue to enable the stats, false to disable the stats.

◆ get_mid()

virtual std::optional< std::string > millicast::compat::Client::get_mid ( const std::string &  track_id)
pure virtual

Get the transceiver mid associated to a track if any.

Parameters
track_idThe id of the track you want to retrieve the mid
Returns
The transceiver mid if it exists

◆ is_connected()

virtual bool millicast::compat::Client::is_connected ( ) const
pure virtual

is_connected

Returns
return true if the client is connected to millicast, false otherwise.

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