OpenTera WebRTC API (C++) 1.2.6
|
Represents the base class of DataChannelClient and StreamClient. More...
#include <WebrtcClient.h>
Public Member Functions | |
WebrtcClient (SignalingServerConfiguration &&signalingServerConfiguration, WebrtcConfiguration &&webrtcConfiguration, VideoStreamConfiguration &&videoStreamConfiguration) | |
DECLARE_NOT_COPYABLE (WebrtcClient) | |
DECLARE_NOT_MOVABLE (WebrtcClient) | |
void | setTlsVerificationEnabled (bool isEnabled) |
void | connect () |
Connects the client the signaling server. | |
void | close () |
Closes all client connections (asynchronous). | |
void | closeSync () |
Closes all client connections (synchronous). | |
void | callAll () |
Calls all room clients. | |
void | callIds (const std::vector< std::string > &ids) |
Calls the specified clients. More... | |
void | hangUpAll () |
Hangs up all clients. | |
void | closeAllRoomPeerConnections () |
Closes all room peer connections. | |
bool | isConnected () |
Indicates if the client is connected to the signaling server. More... | |
bool | isRtcConnected () |
Indicates if the client is connected to at least one client (RTCPeerConnection). More... | |
std::string | id () |
Returns the client id. More... | |
std::vector< std::string > | getConnectedRoomClientIds () |
Returns the connected room client ids. More... | |
RoomClient | getRoomClient (const std::string &id) |
Returns the room client that matches with the specified id. If no room client matches with the id, a default room client is returned. More... | |
std::vector< RoomClient > | getRoomClients () |
Returns the room clients. More... | |
void | setOnSignalingConnectionOpened (const std::function< void()> &callback) |
Sets the callback that is called when the signaling connection opens. More... | |
void | setOnSignalingConnectionClosed (const std::function< void()> &callback) |
Sets the callback that is called when the signaling connection closes. More... | |
void | setOnSignalingConnectionError (const std::function< void(const std::string &)> &callback) |
Sets the callback that is called when a signaling connection error occurs. More... | |
void | setOnRoomClientsChanged (const std::function< void(const std::vector< RoomClient > &)> &callback) |
Sets the callback that is called when the room client changes. More... | |
void | setCallAcceptor (const std::function< bool(const Client &)> &callback) |
Sets the callback that is used to accept or reject a call. More... | |
void | setOnCallRejected (const std::function< void(const Client &)> &callback) |
Sets the callback that is called when a call is rejected. More... | |
void | setOnClientConnected (const std::function< void(const Client &)> &callback) |
Sets the callback that is called when a client peer connection opens. More... | |
void | setOnClientDisconnected (const std::function< void(const Client &)> &callback) |
Sets the callback that is called when a client peer connection closes. More... | |
void | setOnClientConnectionFailed (const std::function< void(const Client &)> &callback) |
Sets the callback that is called when a client peer connection fails. More... | |
void | setOnError (const std::function< void(const std::string &error)> &callback) |
Sets the callback that is called when an error occurs. More... | |
void | setLogger (const std::function< void(const std::string &message)> &callback) |
Sets the callback that is used to log information. More... | |
Protected Member Functions | |
template<class T , class... Types> | |
void | invokeIfCallable (const std::function< T > &f, Types... args) |
void | log (const std::string &message) |
virtual std::unique_ptr< PeerConnectionHandler > | createPeerConnectionHandler (const std::string &id, const Client &peerClient, bool isCaller)=0 |
std::function< void(const std::string &)> | getOnErrorFunction () |
std::function< void(const Client &)> | getOnClientConnectedFunction () |
std::function< void(const Client &)> | getOnClientDisconnectedFunction () |
std::function< void(const Client &)> | getOnClientConnectionFailedFunction () |
rtc::Thread * | getInternalClientThread () |
Protected Attributes | |
std::unique_ptr< SignalingClient > | m_signalingClient |
rtc::scoped_refptr< webrtc::PeerConnectionFactoryInterface > | m_peerConnectionFactory |
std::map< std::string, std::unique_ptr< PeerConnectionHandler > > | m_peerConnectionHandlersById |
rtc::scoped_refptr< OpenteraAudioDeviceModule > | m_audioDeviceModule |
rtc::scoped_refptr< webrtc::AudioProcessing > | m_audioProcessing |
Represents the base class of DataChannelClient and StreamClient.
void WebrtcClient::callIds | ( | const std::vector< std::string > & | ids | ) |
Calls the specified clients.
ids | The client ids to call |
vector< string > WebrtcClient::getConnectedRoomClientIds | ( | ) |
Returns the connected room client ids.
|
inline |
Returns the room client that matches with the specified id. If no room client matches with the id, a default room client is returned.
id | The room client id |
vector< RoomClient > WebrtcClient::getRoomClients | ( | ) |
Returns the room clients.
|
inline |
Returns the client id.
|
inline |
Indicates if the client is connected to the signaling server.
|
inline |
Indicates if the client is connected to at least one client (RTCPeerConnection).
|
inline |
Sets the callback that is used to accept or reject a call.
The callback is called from the internal client thread. The callback should not block.
Callback parameters:
Callback return value:
callback | The callback |
|
inline |
Sets the callback that is used to log information.
The callback is called from the internal client thread. The callback should not block.
Callback parameters:callback | The callback |
|
inline |
Sets the callback that is called when a call is rejected.
The callback is called from the internal client thread. The callback should not block.
Callback parameters:callback | The callback |
|
inline |
Sets the callback that is called when a client peer connection opens.
The callback is called from the internal client thread. The callback should not block.
Callback parameters:callback | The callback |
|
inline |
Sets the callback that is called when a client peer connection fails.
The callback is called from the internal client thread. The callback should not block.
Callback parameters:callback | The callback |
|
inline |
Sets the callback that is called when a client peer connection closes.
The callback is called from the internal client thread. The callback should not block.
Callback parameters:callback | The callback |
|
inline |
Sets the callback that is called when an error occurs.
The callback is called from the internal client thread. The callback should not block.
Callback parameters:callback | The callback |
|
inline |
Sets the callback that is called when the room client changes.
The callback is called from the internal client thread. The callback should not block.
Callback parameters:callback | The callback |
|
inline |
Sets the callback that is called when the signaling connection closes.
The callback is called from the internal client thread. The callback should not block.
callback | The callback |
|
inline |
Sets the callback that is called when a signaling connection error occurs.
The callback is called from the internal client thread. The callback should not block.
Callback parameters:callback | The callback |
|
inline |
Sets the callback that is called when the signaling connection opens.
The callback is called from the internal client thread. The callback should not block.
callback | The callback |
void WebrtcClient::setTlsVerificationEnabled | ( | bool | isEnabled | ) |
Enable or disable the TLS verification. By default, the TLS verification is enabled.
isEnabled |