Difference between revisions of "GstWebRTC - API Reference"
Jcaballero (talk | contribs) |
Jcaballero (talk | contribs) |
||
Line 4: | Line 4: | ||
==Classes, Structs and Enums== | ==Classes, Structs and Enums== | ||
+ | This section describes the enumerator and classes involved in the custom signaler creation. | ||
+ | <br> | ||
===GstBaseSignaler Class=== | ===GstBaseSignaler Class=== | ||
Line 16: | Line 18: | ||
;gboolean peer_connected | ;gboolean peer_connected | ||
− | :True if peer is connected | + | :True if peer is currently connected |
;[https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-GstSDPMessage.html GstSDPMessage] *peer_sdp | ;[https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-GstSDPMessage.html GstSDPMessage] *peer_sdp | ||
− | : | + | :Remote SDP negotiated by peer |
;[[GstWebRTC_-_API_Reference#GstBaseSignalerSdpType|GstBaseSignalerSdpType]] type | ;[[GstWebRTC_-_API_Reference#GstBaseSignalerSdpType|GstBaseSignalerSdpType]] type | ||
− | : | + | :Whether we are sending an offer or answering a remote offer. In other words, whether we are starting the call or not. |
<br> | <br> | ||
---- | ---- | ||
===GstBaseSignalerSdpType=== | ===GstBaseSignalerSdpType=== | ||
− | + | ;GST_BASE_SIGNALER_SDP_OFFER | |
− | + | :The SDP is an offer | |
− | + | ;GST_BASE_SIGNALER_SDP_ANSWER | |
− | + | :The SDP is an answer | |
− | + | ;GST_BASE_SIGNALER_SDP_UNKNOWN | |
− | + | :The SDP is unknown, typically an error | |
+ | |||
==Virtual Functions== | ==Virtual Functions== | ||
The subclass must implement the following functions, these functions are called by the base class. | The subclass must implement the following functions, these functions are called by the base class. | ||
+ | |||
===Connect=== | ===Connect=== | ||
<pre> | <pre> | ||
gboolean (*connect) (GstBaseSignaler *self) | gboolean (*connect) (GstBaseSignaler *self) | ||
</pre> | </pre> | ||
− | + | The concrete signaler should connect to the signaling mechanism. | |
<br> | <br> | ||
;Parameters | ;Parameters | ||
− | :''self:'' The | + | :''self:'' The concrete signaler |
;Returns | ;Returns | ||
− | :True if connection was successful | + | :True if connection was successful |
+ | |||
---- | ---- | ||
+ | |||
===Disconnect=== | ===Disconnect=== | ||
− | + | The concrete signaler should disconnect to the signaling mechanism. | |
<pre> | <pre> | ||
gboolean (*disconnect) (GstBaseSignaler *self) | gboolean (*disconnect) (GstBaseSignaler *self) | ||
</pre> | </pre> | ||
;Parameters | ;Parameters | ||
− | :''self:'' The | + | :''self:'' The concrete signaler |
;Returns | ;Returns | ||
:True if disconnection was successful. | :True if disconnection was successful. | ||
+ | |||
---- | ---- | ||
+ | |||
===Send SDP=== | ===Send SDP=== | ||
− | + | The concrete signaler should send the given SDP to the peer via its signaling mechanism. | |
<pre> | <pre> | ||
gboolean (*send_sdp) (GstBaseSignaler *self, GstSDPMessage *sdp, GstBaseSignalerSdpType type) | gboolean (*send_sdp) (GstBaseSignaler *self, GstSDPMessage *sdp, GstBaseSignalerSdpType type) | ||
Line 62: | Line 70: | ||
;Parameters | ;Parameters | ||
− | :''self:'' The | + | :''self:'' The concrete signaler |
− | :''sdp:'' The | + | :''sdp:'' The SDP that should be sent. |
− | :''type:'' | + | :''type:'' Whether the SDP is an OFFER or an ANSWER |
;Returns | ;Returns | ||
− | :True if | + | :True if the SDP was succesfully sent. |
+ | |||
---- | ---- | ||
+ | |||
===Send Candidates=== | ===Send Candidates=== | ||
− | + | The concrete signaler should send the given candidates to the peer via its signaling mechanism. The candidates are given in a SDP form. This method can be called several times. | |
<pre> | <pre> | ||
gboolean (*send_candidates) (GstBaseSignaler *self, GstSDPMessage *candidates) | gboolean (*send_candidates) (GstBaseSignaler *self, GstSDPMessage *candidates) | ||
Line 75: | Line 85: | ||
;Parameters | ;Parameters | ||
− | :''self:'' The | + | :''self:'' The concrete signaler |
− | :''candidates:'' | + | :''candidates:'' The candidates to be sent. |
;Returns | ;Returns | ||
− | :True if sent candidates | + | :True if sent candidates successfully was successful. |
+ | |||
---- | ---- | ||
==Signals== | ==Signals== | ||
− | The following signals must be emitted by the subclass: | + | The following signals must be emitted by the subclass using the [https://developer.gnome.org/gobject/stable/gobject-Signals.html#g-signal-emit-by-name g_signal_emit_by_name]: |
+ | |||
===Signaling bound=== | ===Signaling bound=== | ||
+ | The concrete signaler should emit the "signaling-bound" when the local peer connects to the signaling mechanism. | ||
<pre> | <pre> | ||
void (*signaling_bound) (GstBaseSignaler *self) | void (*signaling_bound) (GstBaseSignaler *self) | ||
</pre> | </pre> | ||
;Parameters | ;Parameters | ||
− | :''self:'' The | + | :''self:'' The concrete signaler |
;Returns | ;Returns | ||
:Nothing | :Nothing | ||
+ | |||
---- | ---- | ||
+ | |||
===Peer Connected=== | ===Peer Connected=== | ||
+ | The concrete signaler should emit the "peer-connected" when the remote peer connects to the signaling mechanism. | ||
<pre> | <pre> | ||
void (*peer_connected) (GstBaseSignaler *self) | void (*peer_connected) (GstBaseSignaler *self) | ||
</pre> | </pre> | ||
;Parameters | ;Parameters | ||
− | :''self:'' The | + | :''self:'' The concrete signaler |
;Returns | ;Returns | ||
:Nothing | :Nothing | ||
+ | |||
---- | ---- | ||
+ | |||
===Peer Disconnected=== | ===Peer Disconnected=== | ||
+ | The concrete signaler should emit the "peer-disconnected" when the local peer disconnects from the signaling mechanism. | ||
<pre> | <pre> | ||
void (*peer_disconnected) (GstBaseSignaler *self) | void (*peer_disconnected) (GstBaseSignaler *self) | ||
</pre> | </pre> | ||
;Parameters | ;Parameters | ||
− | :''self:'' The | + | :''self:'' The concrete signaler |
;Returns | ;Returns | ||
:Nothing | :Nothing | ||
+ | |||
---- | ---- | ||
+ | |||
===Peer SDP=== | ===Peer SDP=== | ||
+ | The concrete signaler should emit the "peer-SDP" when the peer SDP has been sent via the signaling mechanism. | ||
<pre> | <pre> | ||
void (*peer_sdp) (GstBaseSignaler *self, GstBaseSignalerSdpType * type, GstSDPMessage * sdp) | void (*peer_sdp) (GstBaseSignaler *self, GstBaseSignalerSdpType * type, GstSDPMessage * sdp) | ||
</pre> | </pre> | ||
;Parameters | ;Parameters | ||
− | :''self:'' The | + | :''self:'' The concrete signaler |
:''type:'' | :''type:'' | ||
:''sdp:'' | :''sdp:'' | ||
;Returns | ;Returns | ||
:Nothing | :Nothing | ||
+ | |||
---- | ---- | ||
+ | |||
===Peer Candidate=== | ===Peer Candidate=== | ||
+ | The concrete signaler should emit the "peer-candidate" when the peer candidate has been sent via the signaling mechanism. | ||
<pre> | <pre> | ||
void (*peer_candidate) (GstBaseSignaler *self, gint sdp_index, gchar * sdp) | void (*peer_candidate) (GstBaseSignaler *self, gint sdp_index, gchar * sdp) | ||
</pre> | </pre> | ||
;Parameters | ;Parameters | ||
− | :''self:'' The | + | :''self:'' The concrete signaler |
:''sdp_index'' | :''sdp_index'' | ||
:''sdp:'' | :''sdp:'' | ||
Line 133: | Line 158: | ||
---- | ---- | ||
===Signaling Error=== | ===Signaling Error=== | ||
+ | The concrete signaler should emit the "signaling-error" when there is an unrecoverable signaling error. The internal state machine will terminate the pipeline. The concrete signaler should fill the GError respectively. | ||
<pre> | <pre> | ||
− | void (*signaling_error) (GstBaseSignaler *self) | + | void (*signaling_error) (GstBaseSignaler *self, GError *error) |
</pre> | </pre> | ||
;Parameters | ;Parameters | ||
− | :''self:'' The | + | :''self:'' The concrete signaler |
;Returns | ;Returns | ||
:Nothing | :Nothing | ||
}} | }} |
Revision as of 15:39, 20 September 2017
← |
⌂ Home |
→ |
Contents
Classes, Structs and Enums
This section describes the enumerator and classes involved in the custom signaler creation.
GstBaseSignaler Class
Base class for custom signalers.
Members
- guint id
- The ID of the local endpoint
- gchar *peer_id
- The ID of the remote endpoint
- gboolean peer_connected
- True if peer is currently connected
- GstSDPMessage *peer_sdp
- Remote SDP negotiated by peer
- GstBaseSignalerSdpType type
- Whether we are sending an offer or answering a remote offer. In other words, whether we are starting the call or not.
GstBaseSignalerSdpType
- GST_BASE_SIGNALER_SDP_OFFER
- The SDP is an offer
- GST_BASE_SIGNALER_SDP_ANSWER
- The SDP is an answer
- GST_BASE_SIGNALER_SDP_UNKNOWN
- The SDP is unknown, typically an error
Virtual Functions
The subclass must implement the following functions, these functions are called by the base class.
Connect
gboolean (*connect) (GstBaseSignaler *self)
The concrete signaler should connect to the signaling mechanism.
- Parameters
- self: The concrete signaler
- Returns
- True if connection was successful
Disconnect
The concrete signaler should disconnect to the signaling mechanism.
gboolean (*disconnect) (GstBaseSignaler *self)
- Parameters
- self: The concrete signaler
- Returns
- True if disconnection was successful.
Send SDP
The concrete signaler should send the given SDP to the peer via its signaling mechanism.
gboolean (*send_sdp) (GstBaseSignaler *self, GstSDPMessage *sdp, GstBaseSignalerSdpType type)
- Parameters
- self: The concrete signaler
- sdp: The SDP that should be sent.
- type: Whether the SDP is an OFFER or an ANSWER
- Returns
- True if the SDP was succesfully sent.
Send Candidates
The concrete signaler should send the given candidates to the peer via its signaling mechanism. The candidates are given in a SDP form. This method can be called several times.
gboolean (*send_candidates) (GstBaseSignaler *self, GstSDPMessage *candidates)
- Parameters
- self: The concrete signaler
- candidates: The candidates to be sent.
- Returns
- True if sent candidates successfully was successful.
Signals
The following signals must be emitted by the subclass using the g_signal_emit_by_name:
Signaling bound
The concrete signaler should emit the "signaling-bound" when the local peer connects to the signaling mechanism.
void (*signaling_bound) (GstBaseSignaler *self)
- Parameters
- self: The concrete signaler
- Returns
- Nothing
Peer Connected
The concrete signaler should emit the "peer-connected" when the remote peer connects to the signaling mechanism.
void (*peer_connected) (GstBaseSignaler *self)
- Parameters
- self: The concrete signaler
- Returns
- Nothing
Peer Disconnected
The concrete signaler should emit the "peer-disconnected" when the local peer disconnects from the signaling mechanism.
void (*peer_disconnected) (GstBaseSignaler *self)
- Parameters
- self: The concrete signaler
- Returns
- Nothing
Peer SDP
The concrete signaler should emit the "peer-SDP" when the peer SDP has been sent via the signaling mechanism.
void (*peer_sdp) (GstBaseSignaler *self, GstBaseSignalerSdpType * type, GstSDPMessage * sdp)
- Parameters
- self: The concrete signaler
- type:
- sdp:
- Returns
- Nothing
Peer Candidate
The concrete signaler should emit the "peer-candidate" when the peer candidate has been sent via the signaling mechanism.
void (*peer_candidate) (GstBaseSignaler *self, gint sdp_index, gchar * sdp)
- Parameters
- self: The concrete signaler
- sdp_index
- sdp:
- Returns
- Nothing
Signaling Error
The concrete signaler should emit the "signaling-error" when there is an unrecoverable signaling error. The internal state machine will terminate the pipeline. The concrete signaler should fill the GError respectively.
void (*signaling_error) (GstBaseSignaler *self, GError *error)
- Parameters
- self: The concrete signaler
- Returns
- Nothing
← |
⌂ Home |
→ |