Skip to main content

gstreamer_webrtc/auto/
web_rtcsctp_transport.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
6use crate::{WebRTCDTLSTransport, WebRTCSCTPTransportState, ffi};
7use glib::{
8    prelude::*,
9    signal::{SignalHandlerId, connect_raw},
10    translate::*,
11};
12use std::boxed::Box as Box_;
13
14glib::wrapper! {
15    ///
16    ///
17    /// This is an Abstract Base Class, you cannot instantiate it.
18    ///
19    /// ## Properties
20    ///
21    ///
22    /// #### `max-channels`
23    ///  Readable
24    ///
25    ///
26    /// #### `max-message-size`
27    ///  Readable
28    ///
29    ///
30    /// #### `state`
31    ///  Readable
32    ///
33    ///
34    /// #### `transport`
35    ///  Readable
36    /// <details><summary><h4>Object</h4></summary>
37    ///
38    ///
39    /// #### `name`
40    ///  Readable | Writeable | Construct
41    ///
42    ///
43    /// #### `parent`
44    ///  The parent of the object. Please note, that when changing the 'parent'
45    /// property, we don't emit [`notify`][struct@crate::glib::Object#notify] and [`deep-notify`][struct@crate::gst::Object#deep-notify]
46    /// signals due to locking issues. In some cases one can use
47    /// `GstBin::element-added` or `GstBin::element-removed` signals on the parent to
48    /// achieve a similar effect.
49    ///
50    /// Readable | Writeable
51    /// </details>
52    ///
53    /// # Implements
54    ///
55    /// [`trait@gst::prelude::ObjectExt`], [`trait@glib::ObjectExt`]
56    #[doc(alias = "GstWebRTCSCTPTransport")]
57    pub struct WebRTCSCTPTransport(Object<ffi::GstWebRTCSCTPTransport, ffi::GstWebRTCSCTPTransportClass>) @extends gst::Object;
58
59    match fn {
60        type_ => || ffi::gst_webrtc_sctp_transport_get_type(),
61    }
62}
63
64impl WebRTCSCTPTransport {
65    #[doc(alias = "max-channels")]
66    pub fn max_channels(&self) -> u32 {
67        ObjectExt::property(self, "max-channels")
68    }
69
70    #[doc(alias = "max-message-size")]
71    pub fn max_message_size(&self) -> u64 {
72        ObjectExt::property(self, "max-message-size")
73    }
74
75    pub fn state(&self) -> WebRTCSCTPTransportState {
76        ObjectExt::property(self, "state")
77    }
78
79    pub fn transport(&self) -> Option<WebRTCDTLSTransport> {
80        ObjectExt::property(self, "transport")
81    }
82
83    #[doc(alias = "max-channels")]
84    pub fn connect_max_channels_notify<F: Fn(&Self) + Send + Sync + 'static>(
85        &self,
86        f: F,
87    ) -> SignalHandlerId {
88        unsafe extern "C" fn notify_max_channels_trampoline<
89            F: Fn(&WebRTCSCTPTransport) + Send + Sync + 'static,
90        >(
91            this: *mut ffi::GstWebRTCSCTPTransport,
92            _param_spec: glib::ffi::gpointer,
93            f: glib::ffi::gpointer,
94        ) {
95            unsafe {
96                let f: &F = &*(f as *const F);
97                f(&from_glib_borrow(this))
98            }
99        }
100        unsafe {
101            let f: Box_<F> = Box_::new(f);
102            connect_raw(
103                self.as_ptr() as *mut _,
104                c"notify::max-channels".as_ptr(),
105                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
106                    notify_max_channels_trampoline::<F> as *const (),
107                )),
108                Box_::into_raw(f),
109            )
110        }
111    }
112
113    #[doc(alias = "max-message-size")]
114    pub fn connect_max_message_size_notify<F: Fn(&Self) + Send + Sync + 'static>(
115        &self,
116        f: F,
117    ) -> SignalHandlerId {
118        unsafe extern "C" fn notify_max_message_size_trampoline<
119            F: Fn(&WebRTCSCTPTransport) + Send + Sync + 'static,
120        >(
121            this: *mut ffi::GstWebRTCSCTPTransport,
122            _param_spec: glib::ffi::gpointer,
123            f: glib::ffi::gpointer,
124        ) {
125            unsafe {
126                let f: &F = &*(f as *const F);
127                f(&from_glib_borrow(this))
128            }
129        }
130        unsafe {
131            let f: Box_<F> = Box_::new(f);
132            connect_raw(
133                self.as_ptr() as *mut _,
134                c"notify::max-message-size".as_ptr(),
135                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
136                    notify_max_message_size_trampoline::<F> as *const (),
137                )),
138                Box_::into_raw(f),
139            )
140        }
141    }
142
143    #[doc(alias = "state")]
144    pub fn connect_state_notify<F: Fn(&Self) + Send + Sync + 'static>(
145        &self,
146        f: F,
147    ) -> SignalHandlerId {
148        unsafe extern "C" fn notify_state_trampoline<
149            F: Fn(&WebRTCSCTPTransport) + Send + Sync + 'static,
150        >(
151            this: *mut ffi::GstWebRTCSCTPTransport,
152            _param_spec: glib::ffi::gpointer,
153            f: glib::ffi::gpointer,
154        ) {
155            unsafe {
156                let f: &F = &*(f as *const F);
157                f(&from_glib_borrow(this))
158            }
159        }
160        unsafe {
161            let f: Box_<F> = Box_::new(f);
162            connect_raw(
163                self.as_ptr() as *mut _,
164                c"notify::state".as_ptr(),
165                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
166                    notify_state_trampoline::<F> as *const (),
167                )),
168                Box_::into_raw(f),
169            )
170        }
171    }
172
173    #[doc(alias = "transport")]
174    pub fn connect_transport_notify<F: Fn(&Self) + Send + Sync + 'static>(
175        &self,
176        f: F,
177    ) -> SignalHandlerId {
178        unsafe extern "C" fn notify_transport_trampoline<
179            F: Fn(&WebRTCSCTPTransport) + Send + Sync + 'static,
180        >(
181            this: *mut ffi::GstWebRTCSCTPTransport,
182            _param_spec: glib::ffi::gpointer,
183            f: glib::ffi::gpointer,
184        ) {
185            unsafe {
186                let f: &F = &*(f as *const F);
187                f(&from_glib_borrow(this))
188            }
189        }
190        unsafe {
191            let f: Box_<F> = Box_::new(f);
192            connect_raw(
193                self.as_ptr() as *mut _,
194                c"notify::transport".as_ptr(),
195                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
196                    notify_transport_trampoline::<F> as *const (),
197                )),
198                Box_::into_raw(f),
199            )
200        }
201    }
202}
203
204unsafe impl Send for WebRTCSCTPTransport {}
205unsafe impl Sync for WebRTCSCTPTransport {}