2 * Copyright (C) 2017 Matthew Waters <matthew@centricular.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
20 #ifndef __GST_WEBRTC_FWD_H__
21 #define __GST_WEBRTC_FWD_H__
23 #ifndef GST_USE_UNSTABLE_API
24 #warning "The WebRTC library from gst-plugins-bad is unstable API and may change in future."
25 #warning "You can define GST_USE_UNSTABLE_API to avoid this warning."
31 * SECTION:webrtc_fwd.h
32 * @title: GstWebRTC Enumerations
35 #ifndef GST_WEBRTC_API
36 # ifdef BUILDING_GST_WEBRTC
37 # define GST_WEBRTC_API GST_API_EXPORT /* from config.h */
39 # define GST_WEBRTC_API GST_API_IMPORT
44 * GST_WEBRTC_DEPRECATED: (attributes doc.skip=true)
47 * GST_WEBRTC_DEPRECATED_FOR: (attributes doc.skip=true)
49 #ifndef GST_DISABLE_DEPRECATED
50 #define GST_WEBRTC_DEPRECATED GST_WEBRTC_API
51 #define GST_WEBRTC_DEPRECATED_FOR(f) GST_WEBRTC_API
53 #define GST_WEBRTC_DEPRECATED G_DEPRECATED GST_WEBRTC_API
54 #define GST_WEBRTC_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) GST_WEBRTC_API
57 #include <gst/webrtc/webrtc-enumtypes.h>
60 * GstWebRTCDTLSTransport:
62 typedef struct _GstWebRTCDTLSTransport GstWebRTCDTLSTransport;
63 typedef struct _GstWebRTCDTLSTransportClass GstWebRTCDTLSTransportClass;
70 typedef struct _GstWebRTCICE GstWebRTCICE;
71 typedef struct _GstWebRTCICEClass GstWebRTCICEClass;
74 * GstWebRTCICECandidateStats:
78 typedef struct _GstWebRTCICECandidateStats GstWebRTCICECandidateStats;
85 typedef struct _GstWebRTCICEStream GstWebRTCICEStream;
86 typedef struct _GstWebRTCICEStreamClass GstWebRTCICEStreamClass;
89 * GstWebRTCICETransport:
91 typedef struct _GstWebRTCICETransport GstWebRTCICETransport;
92 typedef struct _GstWebRTCICETransportClass GstWebRTCICETransportClass;
95 * GstWebRTCRTPReceiver:
97 * An object to track the receiving aspect of the stream
99 * Mostly matches the WebRTC RTCRtpReceiver interface.
101 typedef struct _GstWebRTCRTPReceiver GstWebRTCRTPReceiver;
102 typedef struct _GstWebRTCRTPReceiverClass GstWebRTCRTPReceiverClass;
105 * GstWebRTCRTPSender:
107 * An object to track the sending aspect of the stream
109 * Mostly matches the WebRTC RTCRtpSender interface.
111 typedef struct _GstWebRTCRTPSender GstWebRTCRTPSender;
112 typedef struct _GstWebRTCRTPSenderClass GstWebRTCRTPSenderClass;
114 typedef struct _GstWebRTCSessionDescription GstWebRTCSessionDescription;
117 * GstWebRTCRTPTransceiver:
119 * Mostly matches the WebRTC RTCRtpTransceiver interface.
121 typedef struct _GstWebRTCRTPTransceiver GstWebRTCRTPTransceiver;
122 typedef struct _GstWebRTCRTPTransceiverClass GstWebRTCRTPTransceiverClass;
125 * GstWebRTCDataChannel:
129 typedef struct _GstWebRTCDataChannel GstWebRTCDataChannel;
130 typedef struct _GstWebRTCDataChannelClass GstWebRTCDataChannelClass;
132 typedef struct _GstWebRTCSCTPTransport GstWebRTCSCTPTransport;
133 typedef struct _GstWebRTCSCTPTransportClass GstWebRTCSCTPTransportClass;
136 * GstWebRTCDTLSTransportState:
137 * @GST_WEBRTC_DTLS_TRANSPORT_STATE_NEW: new
138 * @GST_WEBRTC_DTLS_TRANSPORT_STATE_CLOSED: closed
139 * @GST_WEBRTC_DTLS_TRANSPORT_STATE_FAILED: failed
140 * @GST_WEBRTC_DTLS_TRANSPORT_STATE_CONNECTING: connecting
141 * @GST_WEBRTC_DTLS_TRANSPORT_STATE_CONNECTED: connected
143 typedef enum /*< underscore_name=gst_webrtc_dtls_transport_state >*/
145 GST_WEBRTC_DTLS_TRANSPORT_STATE_NEW,
146 GST_WEBRTC_DTLS_TRANSPORT_STATE_CLOSED,
147 GST_WEBRTC_DTLS_TRANSPORT_STATE_FAILED,
148 GST_WEBRTC_DTLS_TRANSPORT_STATE_CONNECTING,
149 GST_WEBRTC_DTLS_TRANSPORT_STATE_CONNECTED,
150 } GstWebRTCDTLSTransportState;
153 * GstWebRTCICEGatheringState:
154 * @GST_WEBRTC_ICE_GATHERING_STATE_NEW: new
155 * @GST_WEBRTC_ICE_GATHERING_STATE_GATHERING: gathering
156 * @GST_WEBRTC_ICE_GATHERING_STATE_COMPLETE: complete
158 * See <http://w3c.github.io/webrtc-pc/#dom-rtcicegatheringstate>
160 typedef enum /*< underscore_name=gst_webrtc_ice_gathering_state >*/
162 GST_WEBRTC_ICE_GATHERING_STATE_NEW,
163 GST_WEBRTC_ICE_GATHERING_STATE_GATHERING,
164 GST_WEBRTC_ICE_GATHERING_STATE_COMPLETE,
165 } GstWebRTCICEGatheringState; /*< underscore_name=gst_webrtc_ice_gathering_state >*/
168 * GstWebRTCICEConnectionState:
169 * @GST_WEBRTC_ICE_CONNECTION_STATE_NEW: new
170 * @GST_WEBRTC_ICE_CONNECTION_STATE_CHECKING: checking
171 * @GST_WEBRTC_ICE_CONNECTION_STATE_CONNECTED: connected
172 * @GST_WEBRTC_ICE_CONNECTION_STATE_COMPLETED: completed
173 * @GST_WEBRTC_ICE_CONNECTION_STATE_FAILED: failed
174 * @GST_WEBRTC_ICE_CONNECTION_STATE_DISCONNECTED: disconnected
175 * @GST_WEBRTC_ICE_CONNECTION_STATE_CLOSED: closed
177 * See <http://w3c.github.io/webrtc-pc/#dom-rtciceconnectionstate>
179 typedef enum /*< underscore_name=gst_webrtc_ice_connection_state >*/
181 GST_WEBRTC_ICE_CONNECTION_STATE_NEW,
182 GST_WEBRTC_ICE_CONNECTION_STATE_CHECKING,
183 GST_WEBRTC_ICE_CONNECTION_STATE_CONNECTED,
184 GST_WEBRTC_ICE_CONNECTION_STATE_COMPLETED,
185 GST_WEBRTC_ICE_CONNECTION_STATE_FAILED,
186 GST_WEBRTC_ICE_CONNECTION_STATE_DISCONNECTED,
187 GST_WEBRTC_ICE_CONNECTION_STATE_CLOSED,
188 } GstWebRTCICEConnectionState;
191 * GstWebRTCSignalingState:
192 * @GST_WEBRTC_SIGNALING_STATE_STABLE: stable
193 * @GST_WEBRTC_SIGNALING_STATE_CLOSED: closed
194 * @GST_WEBRTC_SIGNALING_STATE_HAVE_LOCAL_OFFER: have-local-offer
195 * @GST_WEBRTC_SIGNALING_STATE_HAVE_REMOTE_OFFER: have-remote-offer
196 * @GST_WEBRTC_SIGNALING_STATE_HAVE_LOCAL_PRANSWER: have-local-pranswer
197 * @GST_WEBRTC_SIGNALING_STATE_HAVE_REMOTE_PRANSWER: have-remote-pranswer
199 * See <http://w3c.github.io/webrtc-pc/#dom-rtcsignalingstate>
201 typedef enum /*< underscore_name=gst_webrtc_signaling_state >*/
203 GST_WEBRTC_SIGNALING_STATE_STABLE,
204 GST_WEBRTC_SIGNALING_STATE_CLOSED,
205 GST_WEBRTC_SIGNALING_STATE_HAVE_LOCAL_OFFER,
206 GST_WEBRTC_SIGNALING_STATE_HAVE_REMOTE_OFFER,
207 GST_WEBRTC_SIGNALING_STATE_HAVE_LOCAL_PRANSWER,
208 GST_WEBRTC_SIGNALING_STATE_HAVE_REMOTE_PRANSWER,
209 } GstWebRTCSignalingState;
212 * GstWebRTCPeerConnectionState:
213 * @GST_WEBRTC_PEER_CONNECTION_STATE_NEW: new
214 * @GST_WEBRTC_PEER_CONNECTION_STATE_CONNECTING: connecting
215 * @GST_WEBRTC_PEER_CONNECTION_STATE_CONNECTED: connected
216 * @GST_WEBRTC_PEER_CONNECTION_STATE_DISCONNECTED: disconnected
217 * @GST_WEBRTC_PEER_CONNECTION_STATE_FAILED: failed
218 * @GST_WEBRTC_PEER_CONNECTION_STATE_CLOSED: closed
220 * See <http://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectionstate>
222 typedef enum /*< underscore_name=gst_webrtc_peer_connection_state >*/
224 GST_WEBRTC_PEER_CONNECTION_STATE_NEW,
225 GST_WEBRTC_PEER_CONNECTION_STATE_CONNECTING,
226 GST_WEBRTC_PEER_CONNECTION_STATE_CONNECTED,
227 GST_WEBRTC_PEER_CONNECTION_STATE_DISCONNECTED,
228 GST_WEBRTC_PEER_CONNECTION_STATE_FAILED,
229 GST_WEBRTC_PEER_CONNECTION_STATE_CLOSED,
230 } GstWebRTCPeerConnectionState;
234 * @GST_WEBRTC_ICE_ROLE_CONTROLLED: controlled
235 * @GST_WEBRTC_ICE_ROLE_CONTROLLING: controlling
237 typedef enum /*< underscore_name=gst_webrtc_ice_role >*/
239 GST_WEBRTC_ICE_ROLE_CONTROLLED,
240 GST_WEBRTC_ICE_ROLE_CONTROLLING,
244 * GstWebRTCICEComponent:
245 * @GST_WEBRTC_ICE_COMPONENT_RTP: RTP component
246 * @GST_WEBRTC_ICE_COMPONENT_RTCP: RTCP component
248 typedef enum /*< underscore_name=gst_webrtc_ice_component >*/
250 GST_WEBRTC_ICE_COMPONENT_RTP,
251 GST_WEBRTC_ICE_COMPONENT_RTCP,
252 } GstWebRTCICEComponent;
256 * @GST_WEBRTC_SDP_TYPE_OFFER: offer
257 * @GST_WEBRTC_SDP_TYPE_PRANSWER: pranswer
258 * @GST_WEBRTC_SDP_TYPE_ANSWER: answer
259 * @GST_WEBRTC_SDP_TYPE_ROLLBACK: rollback
261 * See <http://w3c.github.io/webrtc-pc/#rtcsdptype>
263 typedef enum /*< underscore_name=gst_webrtc_sdp_type >*/
265 GST_WEBRTC_SDP_TYPE_OFFER = 1,
266 GST_WEBRTC_SDP_TYPE_PRANSWER,
267 GST_WEBRTC_SDP_TYPE_ANSWER,
268 GST_WEBRTC_SDP_TYPE_ROLLBACK,
272 * GstWebRTCRTPTransceiverDirection:
273 * @GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_NONE: none
274 * @GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_INACTIVE: inactive
275 * @GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDONLY: sendonly
276 * @GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_RECVONLY: recvonly
277 * @GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDRECV: sendrecv
279 typedef enum /*< underscore_name=gst_webrtc_rtp_transceiver_direction >*/
281 GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_NONE,
282 GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_INACTIVE,
283 GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDONLY,
284 GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_RECVONLY,
285 GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDRECV,
286 } GstWebRTCRTPTransceiverDirection;
289 * GstWebRTCDTLSSetup:
290 * @GST_WEBRTC_DTLS_SETUP_NONE: none
291 * @GST_WEBRTC_DTLS_SETUP_ACTPASS: actpass
292 * @GST_WEBRTC_DTLS_SETUP_ACTIVE: sendonly
293 * @GST_WEBRTC_DTLS_SETUP_PASSIVE: recvonly
295 typedef enum /*< underscore_name=gst_webrtc_dtls_setup >*/
297 GST_WEBRTC_DTLS_SETUP_NONE,
298 GST_WEBRTC_DTLS_SETUP_ACTPASS,
299 GST_WEBRTC_DTLS_SETUP_ACTIVE,
300 GST_WEBRTC_DTLS_SETUP_PASSIVE,
301 } GstWebRTCDTLSSetup;
304 * GstWebRTCStatsType:
305 * @GST_WEBRTC_STATS_CODEC: codec
306 * @GST_WEBRTC_STATS_INBOUND_RTP: inbound-rtp
307 * @GST_WEBRTC_STATS_OUTBOUND_RTP: outbound-rtp
308 * @GST_WEBRTC_STATS_REMOTE_INBOUND_RTP: remote-inbound-rtp
309 * @GST_WEBRTC_STATS_REMOTE_OUTBOUND_RTP: remote-outbound-rtp
310 * @GST_WEBRTC_STATS_CSRC: csrc
311 * @GST_WEBRTC_STATS_PEER_CONNECTION: peer-connectiion
312 * @GST_WEBRTC_STATS_DATA_CHANNEL: data-channel
313 * @GST_WEBRTC_STATS_STREAM: stream
314 * @GST_WEBRTC_STATS_TRANSPORT: transport
315 * @GST_WEBRTC_STATS_CANDIDATE_PAIR: candidate-pair
316 * @GST_WEBRTC_STATS_LOCAL_CANDIDATE: local-candidate
317 * @GST_WEBRTC_STATS_REMOTE_CANDIDATE: remote-candidate
318 * @GST_WEBRTC_STATS_CERTIFICATE: certificate
320 typedef enum /*< underscore_name=gst_webrtc_stats_type >*/
322 GST_WEBRTC_STATS_CODEC = 1,
323 GST_WEBRTC_STATS_INBOUND_RTP,
324 GST_WEBRTC_STATS_OUTBOUND_RTP,
325 GST_WEBRTC_STATS_REMOTE_INBOUND_RTP,
326 GST_WEBRTC_STATS_REMOTE_OUTBOUND_RTP,
327 GST_WEBRTC_STATS_CSRC,
328 GST_WEBRTC_STATS_PEER_CONNECTION,
329 GST_WEBRTC_STATS_DATA_CHANNEL,
330 GST_WEBRTC_STATS_STREAM,
331 GST_WEBRTC_STATS_TRANSPORT,
332 GST_WEBRTC_STATS_CANDIDATE_PAIR,
333 GST_WEBRTC_STATS_LOCAL_CANDIDATE,
334 GST_WEBRTC_STATS_REMOTE_CANDIDATE,
335 GST_WEBRTC_STATS_CERTIFICATE,
336 } GstWebRTCStatsType;
340 * @GST_WEBRTC_FEC_TYPE_NONE: none
341 * @GST_WEBRTC_FEC_TYPE_ULP_RED: ulpfec + red
345 typedef enum /*< underscore_name=gst_webrtc_fec_type >*/
347 GST_WEBRTC_FEC_TYPE_NONE,
348 GST_WEBRTC_FEC_TYPE_ULP_RED,
352 * GstWebRTCSCTPTransportState:
353 * @GST_WEBRTC_SCTP_TRANSPORT_STATE_NEW: new
354 * @GST_WEBRTC_SCTP_TRANSPORT_STATE_CONNECTING: connecting
355 * @GST_WEBRTC_SCTP_TRANSPORT_STATE_CONNECTED: connected
356 * @GST_WEBRTC_SCTP_TRANSPORT_STATE_CLOSED: closed
358 * See <http://w3c.github.io/webrtc-pc/#dom-rtcsctptransportstate>
362 typedef enum /*< underscore_name=gst_webrtc_sctp_transport_state >*/
364 GST_WEBRTC_SCTP_TRANSPORT_STATE_NEW,
365 GST_WEBRTC_SCTP_TRANSPORT_STATE_CONNECTING,
366 GST_WEBRTC_SCTP_TRANSPORT_STATE_CONNECTED,
367 GST_WEBRTC_SCTP_TRANSPORT_STATE_CLOSED,
368 } GstWebRTCSCTPTransportState;
371 * GstWebRTCPriorityType:
372 * @GST_WEBRTC_PRIORITY_TYPE_VERY_LOW: very-low
373 * @GST_WEBRTC_PRIORITY_TYPE_LOW: low
374 * @GST_WEBRTC_PRIORITY_TYPE_MEDIUM: medium
375 * @GST_WEBRTC_PRIORITY_TYPE_HIGH: high
377 * See <http://w3c.github.io/webrtc-pc/#dom-rtcprioritytype>
381 typedef enum /*< underscore_name=gst_webrtc_priority_type >*/
383 GST_WEBRTC_PRIORITY_TYPE_VERY_LOW = 1,
384 GST_WEBRTC_PRIORITY_TYPE_LOW,
385 GST_WEBRTC_PRIORITY_TYPE_MEDIUM,
386 GST_WEBRTC_PRIORITY_TYPE_HIGH,
387 } GstWebRTCPriorityType;
390 * GstWebRTCDataChannelState:
391 * @GST_WEBRTC_DATA_CHANNEL_STATE_CONNECTING: connecting
392 * @GST_WEBRTC_DATA_CHANNEL_STATE_OPEN: open
393 * @GST_WEBRTC_DATA_CHANNEL_STATE_CLOSING: closing
394 * @GST_WEBRTC_DATA_CHANNEL_STATE_CLOSED: closed
396 * See <http://w3c.github.io/webrtc-pc/#dom-rtcdatachannelstate>
400 typedef enum /*< underscore_name=gst_webrtc_data_channel_state >*/
402 GST_WEBRTC_DATA_CHANNEL_STATE_CONNECTING = 1,
403 GST_WEBRTC_DATA_CHANNEL_STATE_OPEN,
404 GST_WEBRTC_DATA_CHANNEL_STATE_CLOSING,
405 GST_WEBRTC_DATA_CHANNEL_STATE_CLOSED,
406 } GstWebRTCDataChannelState;
409 * GstWebRTCBundlePolicy:
410 * @GST_WEBRTC_BUNDLE_POLICY_NONE: none
411 * @GST_WEBRTC_BUNDLE_POLICY_BALANCED: balanced
412 * @GST_WEBRTC_BUNDLE_POLICY_MAX_COMPAT: max-compat
413 * @GST_WEBRTC_BUNDLE_POLICY_MAX_BUNDLE: max-bundle
415 * See https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-24#section-4.1.1
416 * for more information.
420 typedef enum /*<underscore_name=gst_webrtc_bundle_policy>*/
422 GST_WEBRTC_BUNDLE_POLICY_NONE,
423 GST_WEBRTC_BUNDLE_POLICY_BALANCED,
424 GST_WEBRTC_BUNDLE_POLICY_MAX_COMPAT,
425 GST_WEBRTC_BUNDLE_POLICY_MAX_BUNDLE,
426 } GstWebRTCBundlePolicy;
429 * GstWebRTCICETransportPolicy:
430 * @GST_WEBRTC_ICE_TRANSPORT_POLICY_ALL: all
431 * @GST_WEBRTC_ICE_TRANSPORT_POLICY_RELAY: relay
433 * See https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-24#section-4.1.1
434 * for more information.
438 typedef enum /*<underscore_name=gst_webrtc_ice_transport_policy>*/
440 GST_WEBRTC_ICE_TRANSPORT_POLICY_ALL,
441 GST_WEBRTC_ICE_TRANSPORT_POLICY_RELAY,
442 } GstWebRTCICETransportPolicy;
446 * @GST_WEBRTC_KIND_UNKNOWN: Kind has not yet been set
447 * @GST_WEBRTC_KIND_AUDIO: Kind is audio
448 * @GST_WEBRTC_KIND_VIDEO: Kind is audio
450 * https://w3c.github.io/mediacapture-main/#dom-mediastreamtrack-kind
454 typedef enum /*<underscore_name=gst_webrtc_kind>*/
456 GST_WEBRTC_KIND_UNKNOWN,
457 GST_WEBRTC_KIND_AUDIO,
458 GST_WEBRTC_KIND_VIDEO,
463 GQuark gst_webrtc_error_quark (void);
470 #define GST_WEBRTC_ERROR gst_webrtc_error_quark ()
474 * @GST_WEBRTC_ERROR_DATA_CHANNEL_FAILURE: data-channel-failure
475 * @GST_WEBRTC_ERROR_DTLS_FAILURE: dtls-failure
476 * @GST_WEBRTC_ERROR_FINGERPRINT_FAILURE: fingerprint-failure
477 * @GST_WEBRTC_ERROR_SCTP_FAILURE: sctp-failure
478 * @GST_WEBRTC_ERROR_SDP_SYNTAX_ERROR: sdp-syntax-error
479 * @GST_WEBRTC_ERROR_HARDWARE_ENCODER_NOT_AVAILABLE: hardware-encoder-not-available
480 * @GST_WEBRTC_ERROR_ENCODER_ERROR: encoder-error
481 * @GST_WEBRTC_ERROR_INVALID_STATE: invalid-state (part of WebIDL specification)
482 * @GST_WEBRTC_ERROR_INTERNAL_FAILURE: GStreamer-specific failure, not matching any other value from the specification
484 * See <https://www.w3.org/TR/webrtc/#dom-rtcerrordetailtype> for more information.
489 * GST_WEBRTC_ERROR_TYPE_ERROR:
491 * type-error (maps to JavaScript TypeError)
496 * GST_WEBRTC_ERROR_INVALID_MODIFICATION:
498 * invalid-modification (part of WebIDL specification)
502 typedef enum /*<underscore_name=gst_webrtc_error>*/
504 GST_WEBRTC_ERROR_DATA_CHANNEL_FAILURE,
505 GST_WEBRTC_ERROR_DTLS_FAILURE,
506 GST_WEBRTC_ERROR_FINGERPRINT_FAILURE,
507 GST_WEBRTC_ERROR_SCTP_FAILURE,
508 GST_WEBRTC_ERROR_SDP_SYNTAX_ERROR,
509 GST_WEBRTC_ERROR_HARDWARE_ENCODER_NOT_AVAILABLE,
510 GST_WEBRTC_ERROR_ENCODER_ERROR,
511 GST_WEBRTC_ERROR_INVALID_STATE,
512 GST_WEBRTC_ERROR_TYPE_ERROR,
513 GST_WEBRTC_ERROR_INTERNAL_FAILURE,
514 GST_WEBRTC_ERROR_INVALID_MODIFICATION,
517 #endif /* __GST_WEBRTC_FWD_H__ */