WebRTC support helpers
WebSocketSignaller
SignallingInterface implementation using plain JSON over WebSocket.
WebSocketSignaller
#include <icy/webrtc/support/wssignaller.h>Inherits:
SignallingInterface
SignallingInterface implementation using plain JSON over WebSocket.
Public Attributes
| Return | Name | Description |
|---|---|---|
Signal< void(const std::string &)> | SendMessage |
SendMessage
Signal< void(const std::string &)> SendMessagePublic Methods
| Return | Name | Description |
|---|---|---|
WebSocketSignaller explicit | ||
WebSocketSignaller | Deleted constructor. | |
void | sendSdp virtual | Send an SDP offer or answer to the remote peer. |
void | sendCandidate virtual | Send an ICE candidate to the remote peer. |
void | sendControl virtual | Send a control message to the remote peer. |
void | receive | |
void | setLocalPeerId inline | |
const std::string & | localPeerId const inline |
WebSocketSignaller
explicit
explicit WebSocketSignaller(const std::string & localPeerId)WebSocketSignaller
WebSocketSignaller(const WebSocketSignaller &) = deleteDeleted constructor.
sendSdp
virtual
virtual void sendSdp(const std::string & peerId, const std::string & type, const std::string & sdp)Send an SDP offer or answer to the remote peer.
Parameters
peerIdRemote peer identifier.type"offer" or "answer".sdpThe SDP string.
sendCandidate
virtual
virtual void sendCandidate(const std::string & peerId, const std::string & candidate, const std::string & mid)Send an ICE candidate to the remote peer.
Parameters
peerIdRemote peer identifier.candidateThe candidate string (from RTCIceCandidate).midThe sdpMid value.
sendControl
virtual
virtual void sendControl(const std::string & peerId, const std::string & type, const std::string & reason)Send a control message to the remote peer.
Parameters
peerIdRemote peer identifier.typeControl type: "init", "accept", "reject", "hangup".reasonOptional reason string (for reject/hangup).
receive
void receive(const std::string & json)setLocalPeerId
inline
inline void setLocalPeerId(const std::string & id)localPeerId
const inline
inline const std::string & localPeerId() constPrivate Attributes
| Return | Name | Description |
|---|---|---|
std::string | _localPeerId | |
std::mutex | _mutex |
_localPeerId
std::string _localPeerId_mutex
std::mutex _mutexPrivate Methods
| Return | Name | Description |
|---|---|---|
void | sendJson |
sendJson
void sendJson(const json::Value & msg)