gstreamer_webrtc_sys/
lib.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
4// DO NOT EDIT
5
6#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
7#![allow(
8    clippy::approx_constant,
9    clippy::type_complexity,
10    clippy::unreadable_literal,
11    clippy::upper_case_acronyms
12)]
13#![cfg_attr(docsrs, feature(doc_cfg))]
14
15use glib_sys as glib;
16use gstreamer_sdp_sys as gst_sdp;
17use gstreamer_sys as gst;
18
19#[cfg(unix)]
20#[allow(unused_imports)]
21use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t};
22#[allow(unused_imports)]
23use libc::{intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE};
24#[allow(unused_imports)]
25use std::ffi::{
26    c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
27};
28
29#[allow(unused_imports)]
30use glib::{gboolean, gconstpointer, gpointer, GType};
31
32// Enums
33pub type GstWebRTCBundlePolicy = c_int;
34pub const GST_WEBRTC_BUNDLE_POLICY_NONE: GstWebRTCBundlePolicy = 0;
35pub const GST_WEBRTC_BUNDLE_POLICY_BALANCED: GstWebRTCBundlePolicy = 1;
36pub const GST_WEBRTC_BUNDLE_POLICY_MAX_COMPAT: GstWebRTCBundlePolicy = 2;
37pub const GST_WEBRTC_BUNDLE_POLICY_MAX_BUNDLE: GstWebRTCBundlePolicy = 3;
38
39pub type GstWebRTCDTLSSetup = c_int;
40pub const GST_WEBRTC_DTLS_SETUP_NONE: GstWebRTCDTLSSetup = 0;
41pub const GST_WEBRTC_DTLS_SETUP_ACTPASS: GstWebRTCDTLSSetup = 1;
42pub const GST_WEBRTC_DTLS_SETUP_ACTIVE: GstWebRTCDTLSSetup = 2;
43pub const GST_WEBRTC_DTLS_SETUP_PASSIVE: GstWebRTCDTLSSetup = 3;
44
45pub type GstWebRTCDTLSTransportState = c_int;
46pub const GST_WEBRTC_DTLS_TRANSPORT_STATE_NEW: GstWebRTCDTLSTransportState = 0;
47pub const GST_WEBRTC_DTLS_TRANSPORT_STATE_CLOSED: GstWebRTCDTLSTransportState = 1;
48pub const GST_WEBRTC_DTLS_TRANSPORT_STATE_FAILED: GstWebRTCDTLSTransportState = 2;
49pub const GST_WEBRTC_DTLS_TRANSPORT_STATE_CONNECTING: GstWebRTCDTLSTransportState = 3;
50pub const GST_WEBRTC_DTLS_TRANSPORT_STATE_CONNECTED: GstWebRTCDTLSTransportState = 4;
51
52pub type GstWebRTCDataChannelState = c_int;
53pub const GST_WEBRTC_DATA_CHANNEL_STATE_CONNECTING: GstWebRTCDataChannelState = 1;
54pub const GST_WEBRTC_DATA_CHANNEL_STATE_OPEN: GstWebRTCDataChannelState = 2;
55pub const GST_WEBRTC_DATA_CHANNEL_STATE_CLOSING: GstWebRTCDataChannelState = 3;
56pub const GST_WEBRTC_DATA_CHANNEL_STATE_CLOSED: GstWebRTCDataChannelState = 4;
57
58pub type GstWebRTCError = c_int;
59pub const GST_WEBRTC_ERROR_DATA_CHANNEL_FAILURE: GstWebRTCError = 0;
60pub const GST_WEBRTC_ERROR_DTLS_FAILURE: GstWebRTCError = 1;
61pub const GST_WEBRTC_ERROR_FINGERPRINT_FAILURE: GstWebRTCError = 2;
62pub const GST_WEBRTC_ERROR_SCTP_FAILURE: GstWebRTCError = 3;
63pub const GST_WEBRTC_ERROR_SDP_SYNTAX_ERROR: GstWebRTCError = 4;
64pub const GST_WEBRTC_ERROR_HARDWARE_ENCODER_NOT_AVAILABLE: GstWebRTCError = 5;
65pub const GST_WEBRTC_ERROR_ENCODER_ERROR: GstWebRTCError = 6;
66pub const GST_WEBRTC_ERROR_INVALID_STATE: GstWebRTCError = 7;
67pub const GST_WEBRTC_ERROR_INTERNAL_FAILURE: GstWebRTCError = 8;
68#[cfg(feature = "v1_22")]
69#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
70pub const GST_WEBRTC_ERROR_INVALID_MODIFICATION: GstWebRTCError = 9;
71#[cfg(feature = "v1_22")]
72#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
73pub const GST_WEBRTC_ERROR_TYPE_ERROR: GstWebRTCError = 10;
74
75pub type GstWebRTCFECType = c_int;
76pub const GST_WEBRTC_FEC_TYPE_NONE: GstWebRTCFECType = 0;
77pub const GST_WEBRTC_FEC_TYPE_ULP_RED: GstWebRTCFECType = 1;
78
79pub type GstWebRTCICEComponent = c_int;
80pub const GST_WEBRTC_ICE_COMPONENT_RTP: GstWebRTCICEComponent = 0;
81pub const GST_WEBRTC_ICE_COMPONENT_RTCP: GstWebRTCICEComponent = 1;
82
83pub type GstWebRTCICEConnectionState = c_int;
84pub const GST_WEBRTC_ICE_CONNECTION_STATE_NEW: GstWebRTCICEConnectionState = 0;
85pub const GST_WEBRTC_ICE_CONNECTION_STATE_CHECKING: GstWebRTCICEConnectionState = 1;
86pub const GST_WEBRTC_ICE_CONNECTION_STATE_CONNECTED: GstWebRTCICEConnectionState = 2;
87pub const GST_WEBRTC_ICE_CONNECTION_STATE_COMPLETED: GstWebRTCICEConnectionState = 3;
88pub const GST_WEBRTC_ICE_CONNECTION_STATE_FAILED: GstWebRTCICEConnectionState = 4;
89pub const GST_WEBRTC_ICE_CONNECTION_STATE_DISCONNECTED: GstWebRTCICEConnectionState = 5;
90pub const GST_WEBRTC_ICE_CONNECTION_STATE_CLOSED: GstWebRTCICEConnectionState = 6;
91
92pub type GstWebRTCICEGatheringState = c_int;
93pub const GST_WEBRTC_ICE_GATHERING_STATE_NEW: GstWebRTCICEGatheringState = 0;
94pub const GST_WEBRTC_ICE_GATHERING_STATE_GATHERING: GstWebRTCICEGatheringState = 1;
95pub const GST_WEBRTC_ICE_GATHERING_STATE_COMPLETE: GstWebRTCICEGatheringState = 2;
96
97pub type GstWebRTCICERole = c_int;
98pub const GST_WEBRTC_ICE_ROLE_CONTROLLED: GstWebRTCICERole = 0;
99pub const GST_WEBRTC_ICE_ROLE_CONTROLLING: GstWebRTCICERole = 1;
100
101pub type GstWebRTCICETransportPolicy = c_int;
102pub const GST_WEBRTC_ICE_TRANSPORT_POLICY_ALL: GstWebRTCICETransportPolicy = 0;
103pub const GST_WEBRTC_ICE_TRANSPORT_POLICY_RELAY: GstWebRTCICETransportPolicy = 1;
104
105pub type GstWebRTCKind = c_int;
106pub const GST_WEBRTC_KIND_UNKNOWN: GstWebRTCKind = 0;
107pub const GST_WEBRTC_KIND_AUDIO: GstWebRTCKind = 1;
108pub const GST_WEBRTC_KIND_VIDEO: GstWebRTCKind = 2;
109
110pub type GstWebRTCPeerConnectionState = c_int;
111pub const GST_WEBRTC_PEER_CONNECTION_STATE_NEW: GstWebRTCPeerConnectionState = 0;
112pub const GST_WEBRTC_PEER_CONNECTION_STATE_CONNECTING: GstWebRTCPeerConnectionState = 1;
113pub const GST_WEBRTC_PEER_CONNECTION_STATE_CONNECTED: GstWebRTCPeerConnectionState = 2;
114pub const GST_WEBRTC_PEER_CONNECTION_STATE_DISCONNECTED: GstWebRTCPeerConnectionState = 3;
115pub const GST_WEBRTC_PEER_CONNECTION_STATE_FAILED: GstWebRTCPeerConnectionState = 4;
116pub const GST_WEBRTC_PEER_CONNECTION_STATE_CLOSED: GstWebRTCPeerConnectionState = 5;
117
118pub type GstWebRTCPriorityType = c_int;
119pub const GST_WEBRTC_PRIORITY_TYPE_VERY_LOW: GstWebRTCPriorityType = 1;
120pub const GST_WEBRTC_PRIORITY_TYPE_LOW: GstWebRTCPriorityType = 2;
121pub const GST_WEBRTC_PRIORITY_TYPE_MEDIUM: GstWebRTCPriorityType = 3;
122pub const GST_WEBRTC_PRIORITY_TYPE_HIGH: GstWebRTCPriorityType = 4;
123
124pub type GstWebRTCRTPTransceiverDirection = c_int;
125pub const GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_NONE: GstWebRTCRTPTransceiverDirection = 0;
126pub const GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_INACTIVE: GstWebRTCRTPTransceiverDirection = 1;
127pub const GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDONLY: GstWebRTCRTPTransceiverDirection = 2;
128pub const GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_RECVONLY: GstWebRTCRTPTransceiverDirection = 3;
129pub const GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDRECV: GstWebRTCRTPTransceiverDirection = 4;
130
131pub type GstWebRTCSCTPTransportState = c_int;
132pub const GST_WEBRTC_SCTP_TRANSPORT_STATE_NEW: GstWebRTCSCTPTransportState = 0;
133pub const GST_WEBRTC_SCTP_TRANSPORT_STATE_CONNECTING: GstWebRTCSCTPTransportState = 1;
134pub const GST_WEBRTC_SCTP_TRANSPORT_STATE_CONNECTED: GstWebRTCSCTPTransportState = 2;
135pub const GST_WEBRTC_SCTP_TRANSPORT_STATE_CLOSED: GstWebRTCSCTPTransportState = 3;
136
137pub type GstWebRTCSDPType = c_int;
138pub const GST_WEBRTC_SDP_TYPE_OFFER: GstWebRTCSDPType = 1;
139pub const GST_WEBRTC_SDP_TYPE_PRANSWER: GstWebRTCSDPType = 2;
140pub const GST_WEBRTC_SDP_TYPE_ANSWER: GstWebRTCSDPType = 3;
141pub const GST_WEBRTC_SDP_TYPE_ROLLBACK: GstWebRTCSDPType = 4;
142
143pub type GstWebRTCSignalingState = c_int;
144pub const GST_WEBRTC_SIGNALING_STATE_STABLE: GstWebRTCSignalingState = 0;
145pub const GST_WEBRTC_SIGNALING_STATE_CLOSED: GstWebRTCSignalingState = 1;
146pub const GST_WEBRTC_SIGNALING_STATE_HAVE_LOCAL_OFFER: GstWebRTCSignalingState = 2;
147pub const GST_WEBRTC_SIGNALING_STATE_HAVE_REMOTE_OFFER: GstWebRTCSignalingState = 3;
148pub const GST_WEBRTC_SIGNALING_STATE_HAVE_LOCAL_PRANSWER: GstWebRTCSignalingState = 4;
149pub const GST_WEBRTC_SIGNALING_STATE_HAVE_REMOTE_PRANSWER: GstWebRTCSignalingState = 5;
150
151pub type GstWebRTCStatsType = c_int;
152pub const GST_WEBRTC_STATS_CODEC: GstWebRTCStatsType = 1;
153pub const GST_WEBRTC_STATS_INBOUND_RTP: GstWebRTCStatsType = 2;
154pub const GST_WEBRTC_STATS_OUTBOUND_RTP: GstWebRTCStatsType = 3;
155pub const GST_WEBRTC_STATS_REMOTE_INBOUND_RTP: GstWebRTCStatsType = 4;
156pub const GST_WEBRTC_STATS_REMOTE_OUTBOUND_RTP: GstWebRTCStatsType = 5;
157pub const GST_WEBRTC_STATS_CSRC: GstWebRTCStatsType = 6;
158pub const GST_WEBRTC_STATS_PEER_CONNECTION: GstWebRTCStatsType = 7;
159pub const GST_WEBRTC_STATS_DATA_CHANNEL: GstWebRTCStatsType = 8;
160pub const GST_WEBRTC_STATS_STREAM: GstWebRTCStatsType = 9;
161pub const GST_WEBRTC_STATS_TRANSPORT: GstWebRTCStatsType = 10;
162pub const GST_WEBRTC_STATS_CANDIDATE_PAIR: GstWebRTCStatsType = 11;
163pub const GST_WEBRTC_STATS_LOCAL_CANDIDATE: GstWebRTCStatsType = 12;
164pub const GST_WEBRTC_STATS_REMOTE_CANDIDATE: GstWebRTCStatsType = 13;
165pub const GST_WEBRTC_STATS_CERTIFICATE: GstWebRTCStatsType = 14;
166
167// Callbacks
168pub type GstWebRTCICEOnCandidateFunc =
169    Option<unsafe extern "C" fn(*mut GstWebRTCICE, c_uint, *const c_char, gpointer)>;
170
171// Records
172#[repr(C)]
173#[allow(dead_code)]
174pub struct _GstWebRTCDTLSTransportClass {
175    _data: [u8; 0],
176    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
177}
178
179pub type GstWebRTCDTLSTransportClass = _GstWebRTCDTLSTransportClass;
180
181#[repr(C)]
182#[allow(dead_code)]
183pub struct _GstWebRTCDataChannelClass {
184    _data: [u8; 0],
185    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
186}
187
188pub type GstWebRTCDataChannelClass = _GstWebRTCDataChannelClass;
189
190#[derive(Copy, Clone)]
191#[repr(C)]
192pub struct GstWebRTCICECandidateStats {
193    pub ipaddr: *mut c_char,
194    pub port: c_uint,
195    pub stream_id: c_uint,
196    pub type_: *const c_char,
197    pub proto: *const c_char,
198    pub relay_proto: *const c_char,
199    pub prio: c_uint,
200    pub url: *mut c_char,
201    pub _gst_reserved: [gpointer; 20],
202}
203
204impl ::std::fmt::Debug for GstWebRTCICECandidateStats {
205    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
206        f.debug_struct(&format!("GstWebRTCICECandidateStats @ {self:p}"))
207            .field("ipaddr", &self.ipaddr)
208            .field("port", &self.port)
209            .field("stream_id", &self.stream_id)
210            .field("type_", &self.type_)
211            .field("proto", &self.proto)
212            .field("relay_proto", &self.relay_proto)
213            .field("prio", &self.prio)
214            .field("url", &self.url)
215            .field("_gst_reserved", &self._gst_reserved)
216            .finish()
217    }
218}
219
220#[derive(Copy, Clone)]
221#[repr(C)]
222pub struct GstWebRTCICEClass {
223    pub parent_class: gst::GstObjectClass,
224    pub add_stream:
225        Option<unsafe extern "C" fn(*mut GstWebRTCICE, c_uint) -> *mut GstWebRTCICEStream>,
226    pub find_transport: Option<
227        unsafe extern "C" fn(
228            *mut GstWebRTCICE,
229            *mut GstWebRTCICEStream,
230            GstWebRTCICEComponent,
231        ) -> *mut GstWebRTCICETransport,
232    >,
233    pub gather_candidates:
234        Option<unsafe extern "C" fn(*mut GstWebRTCICE, *mut GstWebRTCICEStream) -> gboolean>,
235    pub add_candidate: Option<
236        unsafe extern "C" fn(
237            *mut GstWebRTCICE,
238            *mut GstWebRTCICEStream,
239            *const c_char,
240            *mut gst::GstPromise,
241        ),
242    >,
243    pub set_local_credentials: Option<
244        unsafe extern "C" fn(
245            *mut GstWebRTCICE,
246            *mut GstWebRTCICEStream,
247            *const c_char,
248            *const c_char,
249        ) -> gboolean,
250    >,
251    pub set_remote_credentials: Option<
252        unsafe extern "C" fn(
253            *mut GstWebRTCICE,
254            *mut GstWebRTCICEStream,
255            *const c_char,
256            *const c_char,
257        ) -> gboolean,
258    >,
259    pub add_turn_server: Option<unsafe extern "C" fn(*mut GstWebRTCICE, *const c_char) -> gboolean>,
260    pub set_is_controller: Option<unsafe extern "C" fn(*mut GstWebRTCICE, gboolean)>,
261    pub get_is_controller: Option<unsafe extern "C" fn(*mut GstWebRTCICE) -> gboolean>,
262    pub set_force_relay: Option<unsafe extern "C" fn(*mut GstWebRTCICE, gboolean)>,
263    pub set_stun_server: Option<unsafe extern "C" fn(*mut GstWebRTCICE, *const c_char)>,
264    pub get_stun_server: Option<unsafe extern "C" fn(*mut GstWebRTCICE) -> *mut c_char>,
265    pub set_turn_server: Option<unsafe extern "C" fn(*mut GstWebRTCICE, *const c_char)>,
266    pub get_turn_server: Option<unsafe extern "C" fn(*mut GstWebRTCICE) -> *mut c_char>,
267    pub set_http_proxy: Option<unsafe extern "C" fn(*mut GstWebRTCICE, *const c_char)>,
268    pub get_http_proxy: Option<unsafe extern "C" fn(*mut GstWebRTCICE) -> *mut c_char>,
269    pub set_tos: Option<unsafe extern "C" fn(*mut GstWebRTCICE, *mut GstWebRTCICEStream, c_uint)>,
270    pub set_on_ice_candidate: Option<
271        unsafe extern "C" fn(
272            *mut GstWebRTCICE,
273            GstWebRTCICEOnCandidateFunc,
274            gpointer,
275            glib::GDestroyNotify,
276        ),
277    >,
278    pub get_local_candidates: Option<
279        unsafe extern "C" fn(
280            *mut GstWebRTCICE,
281            *mut GstWebRTCICEStream,
282        ) -> *mut *mut GstWebRTCICECandidateStats,
283    >,
284    pub get_remote_candidates: Option<
285        unsafe extern "C" fn(
286            *mut GstWebRTCICE,
287            *mut GstWebRTCICEStream,
288        ) -> *mut *mut GstWebRTCICECandidateStats,
289    >,
290    pub get_selected_pair: Option<
291        unsafe extern "C" fn(
292            *mut GstWebRTCICE,
293            *mut GstWebRTCICEStream,
294            *mut *mut GstWebRTCICECandidateStats,
295            *mut *mut GstWebRTCICECandidateStats,
296        ) -> gboolean,
297    >,
298    pub _gst_reserved: [gpointer; 4],
299}
300
301impl ::std::fmt::Debug for GstWebRTCICEClass {
302    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
303        f.debug_struct(&format!("GstWebRTCICEClass @ {self:p}"))
304            .field("parent_class", &self.parent_class)
305            .field("add_stream", &self.add_stream)
306            .field("find_transport", &self.find_transport)
307            .field("gather_candidates", &self.gather_candidates)
308            .field("add_candidate", &self.add_candidate)
309            .field("set_local_credentials", &self.set_local_credentials)
310            .field("set_remote_credentials", &self.set_remote_credentials)
311            .field("add_turn_server", &self.add_turn_server)
312            .field("set_is_controller", &self.set_is_controller)
313            .field("get_is_controller", &self.get_is_controller)
314            .field("set_force_relay", &self.set_force_relay)
315            .field("set_stun_server", &self.set_stun_server)
316            .field("get_stun_server", &self.get_stun_server)
317            .field("set_turn_server", &self.set_turn_server)
318            .field("get_turn_server", &self.get_turn_server)
319            .field("set_http_proxy", &self.set_http_proxy)
320            .field("get_http_proxy", &self.get_http_proxy)
321            .field("set_tos", &self.set_tos)
322            .field("set_on_ice_candidate", &self.set_on_ice_candidate)
323            .field("get_local_candidates", &self.get_local_candidates)
324            .field("get_remote_candidates", &self.get_remote_candidates)
325            .field("get_selected_pair", &self.get_selected_pair)
326            .field("_gst_reserved", &self._gst_reserved)
327            .finish()
328    }
329}
330
331#[derive(Copy, Clone)]
332#[repr(C)]
333pub struct GstWebRTCICEStreamClass {
334    pub parent_class: gst::GstObjectClass,
335    pub find_transport: Option<
336        unsafe extern "C" fn(
337            *mut GstWebRTCICEStream,
338            GstWebRTCICEComponent,
339        ) -> *mut GstWebRTCICETransport,
340    >,
341    pub gather_candidates: Option<unsafe extern "C" fn(*mut GstWebRTCICEStream) -> gboolean>,
342}
343
344impl ::std::fmt::Debug for GstWebRTCICEStreamClass {
345    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
346        f.debug_struct(&format!("GstWebRTCICEStreamClass @ {self:p}"))
347            .field("parent_class", &self.parent_class)
348            .field("find_transport", &self.find_transport)
349            .field("gather_candidates", &self.gather_candidates)
350            .finish()
351    }
352}
353
354#[derive(Copy, Clone)]
355#[repr(C)]
356pub struct GstWebRTCICETransportClass {
357    pub parent_class: gst::GstObjectClass,
358    pub gather_candidates: Option<unsafe extern "C" fn(*mut GstWebRTCICETransport) -> gboolean>,
359    pub _padding: [gpointer; 4],
360}
361
362impl ::std::fmt::Debug for GstWebRTCICETransportClass {
363    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
364        f.debug_struct(&format!("GstWebRTCICETransportClass @ {self:p}"))
365            .field("parent_class", &self.parent_class)
366            .field("gather_candidates", &self.gather_candidates)
367            .field("_padding", &self._padding)
368            .finish()
369    }
370}
371
372#[repr(C)]
373#[allow(dead_code)]
374pub struct _GstWebRTCRTPReceiverClass {
375    _data: [u8; 0],
376    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
377}
378
379pub type GstWebRTCRTPReceiverClass = _GstWebRTCRTPReceiverClass;
380
381#[repr(C)]
382#[allow(dead_code)]
383pub struct _GstWebRTCRTPSenderClass {
384    _data: [u8; 0],
385    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
386}
387
388pub type GstWebRTCRTPSenderClass = _GstWebRTCRTPSenderClass;
389
390#[repr(C)]
391#[allow(dead_code)]
392pub struct _GstWebRTCRTPTransceiverClass {
393    _data: [u8; 0],
394    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
395}
396
397pub type GstWebRTCRTPTransceiverClass = _GstWebRTCRTPTransceiverClass;
398
399#[repr(C)]
400#[allow(dead_code)]
401pub struct _GstWebRTCSCTPTransportClass {
402    _data: [u8; 0],
403    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
404}
405
406pub type GstWebRTCSCTPTransportClass = _GstWebRTCSCTPTransportClass;
407
408#[derive(Copy, Clone)]
409#[repr(C)]
410pub struct GstWebRTCSessionDescription {
411    pub type_: GstWebRTCSDPType,
412    pub sdp: *mut gst_sdp::GstSDPMessage,
413}
414
415impl ::std::fmt::Debug for GstWebRTCSessionDescription {
416    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
417        f.debug_struct(&format!("GstWebRTCSessionDescription @ {self:p}"))
418            .field("type_", &self.type_)
419            .field("sdp", &self.sdp)
420            .finish()
421    }
422}
423
424// Classes
425#[repr(C)]
426#[allow(dead_code)]
427pub struct GstWebRTCDTLSTransport {
428    _data: [u8; 0],
429    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
430}
431
432impl ::std::fmt::Debug for GstWebRTCDTLSTransport {
433    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
434        f.debug_struct(&format!("GstWebRTCDTLSTransport @ {self:p}"))
435            .finish()
436    }
437}
438
439#[repr(C)]
440#[allow(dead_code)]
441pub struct GstWebRTCDataChannel {
442    _data: [u8; 0],
443    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
444}
445
446impl ::std::fmt::Debug for GstWebRTCDataChannel {
447    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
448        f.debug_struct(&format!("GstWebRTCDataChannel @ {self:p}"))
449            .finish()
450    }
451}
452
453#[derive(Copy, Clone)]
454#[repr(C)]
455pub struct GstWebRTCICE {
456    pub parent: gst::GstObject,
457    pub ice_gathering_state: GstWebRTCICEGatheringState,
458    pub ice_connection_state: GstWebRTCICEConnectionState,
459    pub min_rtp_port: c_uint,
460    pub max_rtp_port: c_uint,
461    pub _gst_reserved: [gpointer; 4],
462}
463
464impl ::std::fmt::Debug for GstWebRTCICE {
465    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
466        f.debug_struct(&format!("GstWebRTCICE @ {self:p}"))
467            .field("parent", &self.parent)
468            .field("ice_gathering_state", &self.ice_gathering_state)
469            .field("ice_connection_state", &self.ice_connection_state)
470            .field("min_rtp_port", &self.min_rtp_port)
471            .field("max_rtp_port", &self.max_rtp_port)
472            .field("_gst_reserved", &self._gst_reserved)
473            .finish()
474    }
475}
476
477#[derive(Copy, Clone)]
478#[repr(C)]
479pub struct GstWebRTCICEStream {
480    pub parent: gst::GstObject,
481    pub stream_id: c_uint,
482}
483
484impl ::std::fmt::Debug for GstWebRTCICEStream {
485    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
486        f.debug_struct(&format!("GstWebRTCICEStream @ {self:p}"))
487            .field("parent", &self.parent)
488            .field("stream_id", &self.stream_id)
489            .finish()
490    }
491}
492
493#[derive(Copy, Clone)]
494#[repr(C)]
495pub struct GstWebRTCICETransport {
496    pub parent: gst::GstObject,
497    pub role: GstWebRTCICERole,
498    pub component: GstWebRTCICEComponent,
499    pub state: GstWebRTCICEConnectionState,
500    pub gathering_state: GstWebRTCICEGatheringState,
501    pub src: *mut gst::GstElement,
502    pub sink: *mut gst::GstElement,
503    pub _padding: [gpointer; 4],
504}
505
506impl ::std::fmt::Debug for GstWebRTCICETransport {
507    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
508        f.debug_struct(&format!("GstWebRTCICETransport @ {self:p}"))
509            .field("parent", &self.parent)
510            .field("role", &self.role)
511            .field("component", &self.component)
512            .field("state", &self.state)
513            .field("gathering_state", &self.gathering_state)
514            .field("src", &self.src)
515            .field("sink", &self.sink)
516            .field("_padding", &self._padding)
517            .finish()
518    }
519}
520
521#[repr(C)]
522#[allow(dead_code)]
523pub struct GstWebRTCRTPReceiver {
524    _data: [u8; 0],
525    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
526}
527
528impl ::std::fmt::Debug for GstWebRTCRTPReceiver {
529    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
530        f.debug_struct(&format!("GstWebRTCRTPReceiver @ {self:p}"))
531            .finish()
532    }
533}
534
535#[repr(C)]
536#[allow(dead_code)]
537pub struct GstWebRTCRTPSender {
538    _data: [u8; 0],
539    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
540}
541
542impl ::std::fmt::Debug for GstWebRTCRTPSender {
543    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
544        f.debug_struct(&format!("GstWebRTCRTPSender @ {self:p}"))
545            .finish()
546    }
547}
548
549#[repr(C)]
550#[allow(dead_code)]
551pub struct GstWebRTCRTPTransceiver {
552    _data: [u8; 0],
553    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
554}
555
556impl ::std::fmt::Debug for GstWebRTCRTPTransceiver {
557    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
558        f.debug_struct(&format!("GstWebRTCRTPTransceiver @ {self:p}"))
559            .finish()
560    }
561}
562
563#[repr(C)]
564#[allow(dead_code)]
565pub struct GstWebRTCSCTPTransport {
566    _data: [u8; 0],
567    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
568}
569
570impl ::std::fmt::Debug for GstWebRTCSCTPTransport {
571    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
572        f.debug_struct(&format!("GstWebRTCSCTPTransport @ {self:p}"))
573            .finish()
574    }
575}
576
577extern "C" {
578
579    //=========================================================================
580    // GstWebRTCBundlePolicy
581    //=========================================================================
582    #[cfg(feature = "v1_16")]
583    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
584    pub fn gst_webrtc_bundle_policy_get_type() -> GType;
585
586    //=========================================================================
587    // GstWebRTCDTLSSetup
588    //=========================================================================
589    pub fn gst_webrtc_dtls_setup_get_type() -> GType;
590
591    //=========================================================================
592    // GstWebRTCDTLSTransportState
593    //=========================================================================
594    pub fn gst_webrtc_dtls_transport_state_get_type() -> GType;
595
596    //=========================================================================
597    // GstWebRTCDataChannelState
598    //=========================================================================
599    #[cfg(feature = "v1_16")]
600    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
601    pub fn gst_webrtc_data_channel_state_get_type() -> GType;
602
603    //=========================================================================
604    // GstWebRTCError
605    //=========================================================================
606    #[cfg(feature = "v1_20")]
607    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
608    pub fn gst_webrtc_error_get_type() -> GType;
609    #[cfg(feature = "v1_20")]
610    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
611    pub fn gst_webrtc_error_quark() -> glib::GQuark;
612
613    //=========================================================================
614    // GstWebRTCFECType
615    //=========================================================================
616    #[cfg(feature = "v1_14_1")]
617    #[cfg_attr(docsrs, doc(cfg(feature = "v1_14_1")))]
618    pub fn gst_webrtc_fec_type_get_type() -> GType;
619
620    //=========================================================================
621    // GstWebRTCICEComponent
622    //=========================================================================
623    pub fn gst_webrtc_ice_component_get_type() -> GType;
624
625    //=========================================================================
626    // GstWebRTCICEConnectionState
627    //=========================================================================
628    pub fn gst_webrtc_ice_connection_state_get_type() -> GType;
629
630    //=========================================================================
631    // GstWebRTCICEGatheringState
632    //=========================================================================
633    pub fn gst_webrtc_ice_gathering_state_get_type() -> GType;
634
635    //=========================================================================
636    // GstWebRTCICERole
637    //=========================================================================
638    pub fn gst_webrtc_ice_role_get_type() -> GType;
639
640    //=========================================================================
641    // GstWebRTCICETransportPolicy
642    //=========================================================================
643    #[cfg(feature = "v1_16")]
644    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
645    pub fn gst_webrtc_ice_transport_policy_get_type() -> GType;
646
647    //=========================================================================
648    // GstWebRTCKind
649    //=========================================================================
650    #[cfg(feature = "v1_20")]
651    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
652    pub fn gst_webrtc_kind_get_type() -> GType;
653
654    //=========================================================================
655    // GstWebRTCPeerConnectionState
656    //=========================================================================
657    pub fn gst_webrtc_peer_connection_state_get_type() -> GType;
658
659    //=========================================================================
660    // GstWebRTCPriorityType
661    //=========================================================================
662    #[cfg(feature = "v1_16")]
663    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
664    pub fn gst_webrtc_priority_type_get_type() -> GType;
665
666    //=========================================================================
667    // GstWebRTCRTPTransceiverDirection
668    //=========================================================================
669    pub fn gst_webrtc_rtp_transceiver_direction_get_type() -> GType;
670
671    //=========================================================================
672    // GstWebRTCSCTPTransportState
673    //=========================================================================
674    #[cfg(feature = "v1_16")]
675    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
676    pub fn gst_webrtc_sctp_transport_state_get_type() -> GType;
677
678    //=========================================================================
679    // GstWebRTCSDPType
680    //=========================================================================
681    pub fn gst_webrtc_sdp_type_get_type() -> GType;
682    pub fn gst_webrtc_sdp_type_to_string(type_: GstWebRTCSDPType) -> *const c_char;
683
684    //=========================================================================
685    // GstWebRTCSignalingState
686    //=========================================================================
687    pub fn gst_webrtc_signaling_state_get_type() -> GType;
688
689    //=========================================================================
690    // GstWebRTCStatsType
691    //=========================================================================
692    pub fn gst_webrtc_stats_type_get_type() -> GType;
693
694    //=========================================================================
695    // GstWebRTCICECandidateStats
696    //=========================================================================
697    #[cfg(feature = "v1_22")]
698    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
699    pub fn gst_webrtc_ice_candidate_stats_get_type() -> GType;
700    #[cfg(feature = "v1_22")]
701    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
702    pub fn gst_webrtc_ice_candidate_stats_copy(
703        stats: *mut GstWebRTCICECandidateStats,
704    ) -> *mut GstWebRTCICECandidateStats;
705    #[cfg(feature = "v1_22")]
706    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
707    pub fn gst_webrtc_ice_candidate_stats_free(stats: *mut GstWebRTCICECandidateStats);
708
709    //=========================================================================
710    // GstWebRTCSessionDescription
711    //=========================================================================
712    pub fn gst_webrtc_session_description_get_type() -> GType;
713    pub fn gst_webrtc_session_description_new(
714        type_: GstWebRTCSDPType,
715        sdp: *mut gst_sdp::GstSDPMessage,
716    ) -> *mut GstWebRTCSessionDescription;
717    pub fn gst_webrtc_session_description_copy(
718        src: *const GstWebRTCSessionDescription,
719    ) -> *mut GstWebRTCSessionDescription;
720    pub fn gst_webrtc_session_description_free(desc: *mut GstWebRTCSessionDescription);
721
722    //=========================================================================
723    // GstWebRTCDTLSTransport
724    //=========================================================================
725    pub fn gst_webrtc_dtls_transport_get_type() -> GType;
726
727    //=========================================================================
728    // GstWebRTCDataChannel
729    //=========================================================================
730    #[cfg(feature = "v1_18")]
731    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
732    pub fn gst_webrtc_data_channel_get_type() -> GType;
733    #[cfg(feature = "v1_18")]
734    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
735    pub fn gst_webrtc_data_channel_close(channel: *mut GstWebRTCDataChannel);
736    #[cfg(feature = "v1_18")]
737    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
738    pub fn gst_webrtc_data_channel_send_data(
739        channel: *mut GstWebRTCDataChannel,
740        data: *mut glib::GBytes,
741    );
742    #[cfg(feature = "v1_22")]
743    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
744    pub fn gst_webrtc_data_channel_send_data_full(
745        channel: *mut GstWebRTCDataChannel,
746        data: *mut glib::GBytes,
747        error: *mut *mut glib::GError,
748    ) -> gboolean;
749    #[cfg(feature = "v1_18")]
750    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
751    pub fn gst_webrtc_data_channel_send_string(
752        channel: *mut GstWebRTCDataChannel,
753        str: *const c_char,
754    );
755    #[cfg(feature = "v1_22")]
756    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
757    pub fn gst_webrtc_data_channel_send_string_full(
758        channel: *mut GstWebRTCDataChannel,
759        str: *const c_char,
760        error: *mut *mut glib::GError,
761    ) -> gboolean;
762
763    //=========================================================================
764    // GstWebRTCICE
765    //=========================================================================
766    #[cfg(feature = "v1_22")]
767    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
768    pub fn gst_webrtc_ice_get_type() -> GType;
769    #[cfg(feature = "v1_22")]
770    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
771    pub fn gst_webrtc_ice_add_candidate(
772        ice: *mut GstWebRTCICE,
773        stream: *mut GstWebRTCICEStream,
774        candidate: *const c_char,
775        promise: *mut gst::GstPromise,
776    );
777    #[cfg(feature = "v1_22")]
778    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
779    pub fn gst_webrtc_ice_add_stream(
780        ice: *mut GstWebRTCICE,
781        session_id: c_uint,
782    ) -> *mut GstWebRTCICEStream;
783    #[cfg(feature = "v1_22")]
784    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
785    pub fn gst_webrtc_ice_add_turn_server(ice: *mut GstWebRTCICE, uri: *const c_char) -> gboolean;
786    #[cfg(feature = "v1_22")]
787    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
788    pub fn gst_webrtc_ice_find_transport(
789        ice: *mut GstWebRTCICE,
790        stream: *mut GstWebRTCICEStream,
791        component: GstWebRTCICEComponent,
792    ) -> *mut GstWebRTCICETransport;
793    #[cfg(feature = "v1_22")]
794    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
795    pub fn gst_webrtc_ice_gather_candidates(
796        ice: *mut GstWebRTCICE,
797        stream: *mut GstWebRTCICEStream,
798    ) -> gboolean;
799    #[cfg(feature = "v1_22")]
800    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
801    pub fn gst_webrtc_ice_get_http_proxy(ice: *mut GstWebRTCICE) -> *mut c_char;
802    #[cfg(feature = "v1_22")]
803    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
804    pub fn gst_webrtc_ice_get_is_controller(ice: *mut GstWebRTCICE) -> gboolean;
805    #[cfg(feature = "v1_22")]
806    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
807    pub fn gst_webrtc_ice_get_local_candidates(
808        ice: *mut GstWebRTCICE,
809        stream: *mut GstWebRTCICEStream,
810    ) -> *mut *mut GstWebRTCICECandidateStats;
811    #[cfg(feature = "v1_22")]
812    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
813    pub fn gst_webrtc_ice_get_remote_candidates(
814        ice: *mut GstWebRTCICE,
815        stream: *mut GstWebRTCICEStream,
816    ) -> *mut *mut GstWebRTCICECandidateStats;
817    #[cfg(feature = "v1_22")]
818    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
819    pub fn gst_webrtc_ice_get_selected_pair(
820        ice: *mut GstWebRTCICE,
821        stream: *mut GstWebRTCICEStream,
822        local_stats: *mut *mut GstWebRTCICECandidateStats,
823        remote_stats: *mut *mut GstWebRTCICECandidateStats,
824    ) -> gboolean;
825    #[cfg(feature = "v1_22")]
826    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
827    pub fn gst_webrtc_ice_get_stun_server(ice: *mut GstWebRTCICE) -> *mut c_char;
828    #[cfg(feature = "v1_22")]
829    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
830    pub fn gst_webrtc_ice_get_turn_server(ice: *mut GstWebRTCICE) -> *mut c_char;
831    #[cfg(feature = "v1_22")]
832    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
833    pub fn gst_webrtc_ice_set_force_relay(ice: *mut GstWebRTCICE, force_relay: gboolean);
834    #[cfg(feature = "v1_22")]
835    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
836    pub fn gst_webrtc_ice_set_http_proxy(ice: *mut GstWebRTCICE, uri: *const c_char);
837    #[cfg(feature = "v1_22")]
838    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
839    pub fn gst_webrtc_ice_set_is_controller(ice: *mut GstWebRTCICE, controller: gboolean);
840    #[cfg(feature = "v1_22")]
841    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
842    pub fn gst_webrtc_ice_set_local_credentials(
843        ice: *mut GstWebRTCICE,
844        stream: *mut GstWebRTCICEStream,
845        ufrag: *const c_char,
846        pwd: *const c_char,
847    ) -> gboolean;
848    #[cfg(feature = "v1_22")]
849    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
850    pub fn gst_webrtc_ice_set_on_ice_candidate(
851        ice: *mut GstWebRTCICE,
852        func: GstWebRTCICEOnCandidateFunc,
853        user_data: gpointer,
854        notify: glib::GDestroyNotify,
855    );
856    #[cfg(feature = "v1_22")]
857    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
858    pub fn gst_webrtc_ice_set_remote_credentials(
859        ice: *mut GstWebRTCICE,
860        stream: *mut GstWebRTCICEStream,
861        ufrag: *const c_char,
862        pwd: *const c_char,
863    ) -> gboolean;
864    #[cfg(feature = "v1_22")]
865    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
866    pub fn gst_webrtc_ice_set_stun_server(ice: *mut GstWebRTCICE, uri: *const c_char);
867    #[cfg(feature = "v1_22")]
868    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
869    pub fn gst_webrtc_ice_set_tos(
870        ice: *mut GstWebRTCICE,
871        stream: *mut GstWebRTCICEStream,
872        tos: c_uint,
873    );
874    #[cfg(feature = "v1_22")]
875    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
876    pub fn gst_webrtc_ice_set_turn_server(ice: *mut GstWebRTCICE, uri: *const c_char);
877
878    //=========================================================================
879    // GstWebRTCICEStream
880    //=========================================================================
881    #[cfg(feature = "v1_22")]
882    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
883    pub fn gst_webrtc_ice_stream_get_type() -> GType;
884    #[cfg(feature = "v1_22")]
885    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
886    pub fn gst_webrtc_ice_stream_find_transport(
887        stream: *mut GstWebRTCICEStream,
888        component: GstWebRTCICEComponent,
889    ) -> *mut GstWebRTCICETransport;
890    #[cfg(feature = "v1_22")]
891    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
892    pub fn gst_webrtc_ice_stream_gather_candidates(ice: *mut GstWebRTCICEStream) -> gboolean;
893
894    //=========================================================================
895    // GstWebRTCICETransport
896    //=========================================================================
897    pub fn gst_webrtc_ice_transport_get_type() -> GType;
898    pub fn gst_webrtc_ice_transport_connection_state_change(
899        ice: *mut GstWebRTCICETransport,
900        new_state: GstWebRTCICEConnectionState,
901    );
902    pub fn gst_webrtc_ice_transport_gathering_state_change(
903        ice: *mut GstWebRTCICETransport,
904        new_state: GstWebRTCICEGatheringState,
905    );
906    pub fn gst_webrtc_ice_transport_new_candidate(
907        ice: *mut GstWebRTCICETransport,
908        stream_id: c_uint,
909        component: GstWebRTCICEComponent,
910        attr: *const c_char,
911    );
912    pub fn gst_webrtc_ice_transport_selected_pair_change(ice: *mut GstWebRTCICETransport);
913
914    //=========================================================================
915    // GstWebRTCRTPReceiver
916    //=========================================================================
917    pub fn gst_webrtc_rtp_receiver_get_type() -> GType;
918
919    //=========================================================================
920    // GstWebRTCRTPSender
921    //=========================================================================
922    pub fn gst_webrtc_rtp_sender_get_type() -> GType;
923    #[cfg(feature = "v1_20")]
924    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
925    pub fn gst_webrtc_rtp_sender_set_priority(
926        sender: *mut GstWebRTCRTPSender,
927        priority: GstWebRTCPriorityType,
928    );
929
930    //=========================================================================
931    // GstWebRTCRTPTransceiver
932    //=========================================================================
933    pub fn gst_webrtc_rtp_transceiver_get_type() -> GType;
934
935    //=========================================================================
936    // GstWebRTCSCTPTransport
937    //=========================================================================
938    #[cfg(feature = "v1_20")]
939    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
940    pub fn gst_webrtc_sctp_transport_get_type() -> GType;
941
942}