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::{ffi, WebRTCDTLSTransport, WebRTCSCTPTransportState};
7use glib::{
8    prelude::*,
9    signal::{connect_raw, SignalHandlerId},
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 `GstObject::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@glib::ObjectExt`]
56    #[doc(alias = "GstWebRTCSCTPTransport")]
57    pub struct WebRTCSCTPTransport(Object<ffi::GstWebRTCSCTPTransport, ffi::GstWebRTCSCTPTransportClass>);
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            let f: &F = &*(f as *const F);
96            f(&from_glib_borrow(this))
97        }
98        unsafe {
99            let f: Box_<F> = Box_::new(f);
100            connect_raw(
101                self.as_ptr() as *mut _,
102                c"notify::max-channels".as_ptr() as *const _,
103                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
104                    notify_max_channels_trampoline::<F> as *const (),
105                )),
106                Box_::into_raw(f),
107            )
108        }
109    }
110
111    #[doc(alias = "max-message-size")]
112    pub fn connect_max_message_size_notify<F: Fn(&Self) + Send + Sync + 'static>(
113        &self,
114        f: F,
115    ) -> SignalHandlerId {
116        unsafe extern "C" fn notify_max_message_size_trampoline<
117            F: Fn(&WebRTCSCTPTransport) + Send + Sync + 'static,
118        >(
119            this: *mut ffi::GstWebRTCSCTPTransport,
120            _param_spec: glib::ffi::gpointer,
121            f: glib::ffi::gpointer,
122        ) {
123            let f: &F = &*(f as *const F);
124            f(&from_glib_borrow(this))
125        }
126        unsafe {
127            let f: Box_<F> = Box_::new(f);
128            connect_raw(
129                self.as_ptr() as *mut _,
130                c"notify::max-message-size".as_ptr() as *const _,
131                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
132                    notify_max_message_size_trampoline::<F> as *const (),
133                )),
134                Box_::into_raw(f),
135            )
136        }
137    }
138
139    #[doc(alias = "state")]
140    pub fn connect_state_notify<F: Fn(&Self) + Send + Sync + 'static>(
141        &self,
142        f: F,
143    ) -> SignalHandlerId {
144        unsafe extern "C" fn notify_state_trampoline<
145            F: Fn(&WebRTCSCTPTransport) + Send + Sync + 'static,
146        >(
147            this: *mut ffi::GstWebRTCSCTPTransport,
148            _param_spec: glib::ffi::gpointer,
149            f: glib::ffi::gpointer,
150        ) {
151            let f: &F = &*(f as *const F);
152            f(&from_glib_borrow(this))
153        }
154        unsafe {
155            let f: Box_<F> = Box_::new(f);
156            connect_raw(
157                self.as_ptr() as *mut _,
158                c"notify::state".as_ptr() as *const _,
159                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
160                    notify_state_trampoline::<F> as *const (),
161                )),
162                Box_::into_raw(f),
163            )
164        }
165    }
166
167    #[doc(alias = "transport")]
168    pub fn connect_transport_notify<F: Fn(&Self) + Send + Sync + 'static>(
169        &self,
170        f: F,
171    ) -> SignalHandlerId {
172        unsafe extern "C" fn notify_transport_trampoline<
173            F: Fn(&WebRTCSCTPTransport) + Send + Sync + 'static,
174        >(
175            this: *mut ffi::GstWebRTCSCTPTransport,
176            _param_spec: glib::ffi::gpointer,
177            f: glib::ffi::gpointer,
178        ) {
179            let f: &F = &*(f as *const F);
180            f(&from_glib_borrow(this))
181        }
182        unsafe {
183            let f: Box_<F> = Box_::new(f);
184            connect_raw(
185                self.as_ptr() as *mut _,
186                c"notify::transport".as_ptr() as *const _,
187                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
188                    notify_transport_trampoline::<F> as *const (),
189                )),
190                Box_::into_raw(f),
191            )
192        }
193    }
194}
195
196unsafe impl Send for WebRTCSCTPTransport {}
197unsafe impl Sync for WebRTCSCTPTransport {}