GstWebRTC - API Reference: Difference between revisions
No edit summary |
No edit summary |
||
Line 52: | Line 52: | ||
===Disconnect=== | ===Disconnect=== | ||
The concrete signaler should disconnect | The concrete signaler should disconnect from the signaling mechanism. | ||
<pre> | <pre> | ||
gboolean (*disconnect) (GstBaseSignaler *self) | gboolean (*disconnect) (GstBaseSignaler *self) |
Revision as of 20:51, 20 September 2017
← |
⌂ Home |
→ |
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 from 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: Whether the SDP is for video, audio or data
- sdp: The candidate in SDP format
- 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 Whether the SDP is for video, audio or data
- sdp: The candidate in SDP format
- 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
- error: A GError describing the error. This is used by GstWebRTC to provide feedback to the user.
- Returns
- Nothing
← |
⌂ Home |
→ |