WebRTC support helpers

WebSocketSignaller

SignallingInterface implementation using plain JSON over WebSocket.

#include <icy/webrtc/support/wssignaller.h>

class WebSocketSignaller

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:29

List of all members

NameKindOwner
SendMessagevariableDeclared here
WebSocketSignallerfunctionDeclared here
~WebSocketSignallerfunctionDeclared here
WebSocketSignallerfunctionDeclared here
operator=functionDeclared here
sendSdpfunctionDeclared here
sendCandidatefunctionDeclared here
sendControlfunctionDeclared here
receivefunctionDeclared here
setLocalPeerIdfunctionDeclared here
localPeerIdfunctionDeclared here
_localPeerIdvariableDeclared here
_mutexvariableDeclared here
sendJsonfunctionDeclared here
SdpReceivedvariableInherited from SignallingInterface
CandidateReceivedvariableInherited from SignallingInterface
ControlReceivedvariableInherited from SignallingInterface
~SignallingInterfacefunctionInherited from SignallingInterface
sendSdpfunctionInherited from SignallingInterface
sendCandidatefunctionInherited from SignallingInterface
sendControlfunctionInherited from SignallingInterface

Inherited from SignallingInterface

KindNameDescription
variableSdpReceivedFires when an SDP offer or answer arrives from a remote peer. Parameters: peerId, type ("offer"/"answer"), sdp.
variableCandidateReceivedFires when an ICE candidate arrives from a remote peer. Parameters: peerId, candidate, mid.
variableControlReceivedFires when a control message arrives from a remote peer. Parameters: peerId, type ("init"/"accept"/"reject"/"hangup"), reason.
function~SignallingInterface virtualDefaulted destructor.
functionsendSdp virtualSend an SDP offer or answer to the remote peer.
functionsendCandidate virtualSend an ICE candidate to the remote peer.
functionsendControl virtualSend a control message to the remote peer.

Public Attributes

ReturnNameDescription
Signal< void(const std::string &)>SendMessage

SendMessage

Signal< void(const std::string &)> SendMessage

Type: Signal< void(const std::string &)>

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:52

Public Methods

ReturnNameDescription
WebSocketSignaller explicit
~WebSocketSignaller override
WebSocketSignallerDeleted constructor.
WebSocketSignaller &operator=Deleted assignment operator.
voidsendSdp virtual overrideSend an SDP offer or answer to the remote peer.
voidsendCandidate virtual overrideSend an ICE candidate to the remote peer.
voidsendControl virtual overrideSend a control message to the remote peer.
voidreceive
voidsetLocalPeerId inline
const std::string &localPeerId const inline

WebSocketSignaller

explicit

explicit WebSocketSignaller(const std::string & localPeerId = {})

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:32


~WebSocketSignaller

override

~WebSocketSignaller() override

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:33


WebSocketSignaller

WebSocketSignaller(const WebSocketSignaller &) = delete

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:35

Deleted constructor.


operator=

WebSocketSignaller & operator=(const WebSocketSignaller &) = delete

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:36

Deleted assignment operator.


sendSdp

virtual override

virtual void sendSdp(const std::string & peerId, const std::string & type, const std::string & sdp) override

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:38

Send an SDP offer or answer to the remote peer.

Reimplements

Parameters

ParameterTypeDescription
peerIdconst std::string &Remote peer identifier.
typeconst std::string &"offer" or "answer".
sdpconst std::string &The SDP string.

sendCandidate

virtual override

virtual void sendCandidate(const std::string & peerId, const std::string & candidate, const std::string & mid) override

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:42

Send an ICE candidate to the remote peer.

Reimplements

Parameters

ParameterTypeDescription
peerIdconst std::string &Remote peer identifier.
candidateconst std::string &The candidate string (from RTCIceCandidate).
midconst std::string &The sdpMid value.

sendControl

virtual override

virtual void sendControl(const std::string & peerId, const std::string & type, const std::string & reason = {}) override

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:46

Send a control message to the remote peer.

Reimplements

Parameters

ParameterTypeDescription
peerIdconst std::string &Remote peer identifier.
typeconst std::string &Control type: "init", "accept", "reject", "hangup".
reasonconst std::string &Optional reason string (for reject/hangup).

receive

void receive(const std::string & json)

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:50


setLocalPeerId

inline

inline void setLocalPeerId(const std::string & id)

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:54


localPeerId

const inline

inline const std::string & localPeerId() const

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:55

Private Attributes

ReturnNameDescription
std::string_localPeerId
std::mutex_mutex

_localPeerId

std::string _localPeerId

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:60


_mutex

std::mutex _mutex

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:61

Private Methods

ReturnNameDescription
voidsendJson

sendJson

void sendJson(const json::Value & msg)

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:58