gstreamer_rtsp_server/auto/
rtsp_server.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::{
7    ffi, RTSPAuth, RTSPClient, RTSPFilterResult, RTSPMountPoints, RTSPSessionPool, RTSPThreadPool,
8};
9use glib::{
10    object::ObjectType as _,
11    prelude::*,
12    signal::{connect_raw, SignalHandlerId},
13    translate::*,
14};
15use std::boxed::Box as Box_;
16
17glib::wrapper! {
18    /// This object listens on a port, creates and manages the clients connected to
19    /// it.
20    ///
21    /// ## Properties
22    ///
23    ///
24    /// #### `address`
25    ///  Readable | Writeable
26    ///
27    ///
28    /// #### `backlog`
29    ///  Readable | Writeable
30    ///
31    ///
32    /// #### `bound-port`
33    ///  Readable
34    ///
35    ///
36    /// #### `content-length-limit`
37    ///  Readable | Writeable
38    ///
39    ///
40    /// #### `mount-points`
41    ///  Readable | Writeable
42    ///
43    ///
44    /// #### `service`
45    ///  Readable | Writeable
46    ///
47    ///
48    /// #### `session-pool`
49    ///  Readable | Writeable
50    ///
51    /// ## Signals
52    ///
53    ///
54    /// #### `client-connected`
55    ///
56    ///
57    /// # Implements
58    ///
59    /// [`RTSPServerExt`][trait@crate::prelude::RTSPServerExt], [`trait@glib::ObjectExt`], [`RTSPServerExtManual`][trait@crate::prelude::RTSPServerExtManual]
60    #[doc(alias = "GstRTSPServer")]
61    pub struct RTSPServer(Object<ffi::GstRTSPServer, ffi::GstRTSPServerClass>);
62
63    match fn {
64        type_ => || ffi::gst_rtsp_server_get_type(),
65    }
66}
67
68impl RTSPServer {
69    pub const NONE: Option<&'static RTSPServer> = None;
70
71    /// Create a new [`RTSPServer`][crate::RTSPServer] instance.
72    ///
73    /// # Returns
74    ///
75    /// a new [`RTSPServer`][crate::RTSPServer]
76    #[doc(alias = "gst_rtsp_server_new")]
77    pub fn new() -> RTSPServer {
78        assert_initialized_main_thread!();
79        unsafe { from_glib_full(ffi::gst_rtsp_server_new()) }
80    }
81
82    /// A default `GSocketSourceFunc` that creates a new [`RTSPClient`][crate::RTSPClient] to accept and handle a
83    /// new connection on `socket` or `server`.
84    /// ## `socket`
85    /// a [`gio::Socket`][crate::gio::Socket]
86    /// ## `condition`
87    /// the condition on `source`
88    /// ## `server`
89    /// a [`RTSPServer`][crate::RTSPServer]
90    ///
91    /// # Returns
92    ///
93    /// TRUE if the source could be connected, FALSE if an error occurred.
94    #[doc(alias = "gst_rtsp_server_io_func")]
95    pub fn io_func(
96        socket: &impl IsA<gio::Socket>,
97        condition: glib::IOCondition,
98        server: &impl IsA<RTSPServer>,
99    ) -> Result<(), glib::error::BoolError> {
100        skip_assert_initialized!();
101        unsafe {
102            glib::result_from_gboolean!(
103                ffi::gst_rtsp_server_io_func(
104                    socket.as_ref().to_glib_none().0,
105                    condition.into_glib(),
106                    server.as_ref().to_glib_none().0
107                ),
108                "Failed to connect the source"
109            )
110        }
111    }
112}
113
114impl Default for RTSPServer {
115    fn default() -> Self {
116        Self::new()
117    }
118}
119
120unsafe impl Send for RTSPServer {}
121unsafe impl Sync for RTSPServer {}
122
123mod sealed {
124    pub trait Sealed {}
125    impl<T: super::IsA<super::RTSPServer>> Sealed for T {}
126}
127
128/// Trait containing all [`struct@RTSPServer`] methods.
129///
130/// # Implementors
131///
132/// [`RTSPOnvifServer`][struct@crate::RTSPOnvifServer], [`RTSPServer`][struct@crate::RTSPServer]
133pub trait RTSPServerExt: IsA<RTSPServer> + sealed::Sealed + 'static {
134    /// Call `func` for each client managed by `self`. The result value of `func`
135    /// determines what happens to the client. `func` will be called with `self`
136    /// locked so no further actions on `self` can be performed from `func`.
137    ///
138    /// If `func` returns [`RTSPFilterResult::Remove`][crate::RTSPFilterResult::Remove], the client will be removed from
139    /// `self`.
140    ///
141    /// If `func` returns [`RTSPFilterResult::Keep`][crate::RTSPFilterResult::Keep], the client will remain in `self`.
142    ///
143    /// If `func` returns [`RTSPFilterResult::Ref`][crate::RTSPFilterResult::Ref], the client will remain in `self` but
144    /// will also be added with an additional ref to the result `GList` of this
145    /// function..
146    ///
147    /// When `func` is [`None`], [`RTSPFilterResult::Ref`][crate::RTSPFilterResult::Ref] will be assumed for each client.
148    /// ## `func`
149    /// a callback
150    ///
151    /// # Returns
152    ///
153    /// a `GList` with all
154    /// clients for which `func` returned [`RTSPFilterResult::Ref`][crate::RTSPFilterResult::Ref]. After usage, each
155    /// element in the `GList` should be unreffed before the list is freed.
156    #[doc(alias = "gst_rtsp_server_client_filter")]
157    fn client_filter(
158        &self,
159        func: Option<&mut dyn (FnMut(&RTSPServer, &RTSPClient) -> RTSPFilterResult)>,
160    ) -> Vec<RTSPClient> {
161        let mut func_data: Option<&mut dyn (FnMut(&RTSPServer, &RTSPClient) -> RTSPFilterResult)> =
162            func;
163        unsafe extern "C" fn func_func(
164            server: *mut ffi::GstRTSPServer,
165            client: *mut ffi::GstRTSPClient,
166            user_data: glib::ffi::gpointer,
167        ) -> ffi::GstRTSPFilterResult {
168            let server = from_glib_borrow(server);
169            let client = from_glib_borrow(client);
170            let callback = user_data
171                as *mut Option<&mut dyn (FnMut(&RTSPServer, &RTSPClient) -> RTSPFilterResult)>;
172            if let Some(ref mut callback) = *callback {
173                callback(&server, &client)
174            } else {
175                panic!("cannot get closure...")
176            }
177            .into_glib()
178        }
179        let func = if func_data.is_some() {
180            Some(func_func as _)
181        } else {
182            None
183        };
184        let super_callback0: &mut Option<
185            &mut dyn (FnMut(&RTSPServer, &RTSPClient) -> RTSPFilterResult),
186        > = &mut func_data;
187        unsafe {
188            FromGlibPtrContainer::from_glib_full(ffi::gst_rtsp_server_client_filter(
189                self.as_ref().to_glib_none().0,
190                func,
191                super_callback0 as *mut _ as *mut _,
192            ))
193        }
194    }
195
196    /// Create a [`gio::Socket`][crate::gio::Socket] for `self`. The socket will listen on the
197    /// configured service.
198    /// ## `cancellable`
199    /// a [`gio::Cancellable`][crate::gio::Cancellable]
200    ///
201    /// # Returns
202    ///
203    /// the [`gio::Socket`][crate::gio::Socket] for `self` or [`None`] when an error
204    /// occurred.
205    #[doc(alias = "gst_rtsp_server_create_socket")]
206    fn create_socket(
207        &self,
208        cancellable: Option<&impl IsA<gio::Cancellable>>,
209    ) -> Result<gio::Socket, glib::Error> {
210        unsafe {
211            let mut error = std::ptr::null_mut();
212            let ret = ffi::gst_rtsp_server_create_socket(
213                self.as_ref().to_glib_none().0,
214                cancellable.map(|p| p.as_ref()).to_glib_none().0,
215                &mut error,
216            );
217            if error.is_null() {
218                Ok(from_glib_full(ret))
219            } else {
220                Err(from_glib_full(error))
221            }
222        }
223    }
224
225    /// Create a [`glib::Source`][crate::glib::Source] for `self`. The new source will have a default
226    /// `GSocketSourceFunc` of [`RTSPServer::io_func()`][crate::RTSPServer::io_func()].
227    ///
228    /// `cancellable` if not [`None`] can be used to cancel the source, which will cause
229    /// the source to trigger, reporting the current condition (which is likely 0
230    /// unless cancellation happened at the same time as a condition change). You can
231    /// check for this in the callback using [`CancellableExtManual::is_cancelled()`][crate::gio::prelude::CancellableExtManual::is_cancelled()].
232    ///
233    /// This takes a reference on `self` until `source` is destroyed.
234    /// ## `cancellable`
235    /// a [`gio::Cancellable`][crate::gio::Cancellable] or [`None`].
236    ///
237    /// # Returns
238    ///
239    /// the [`glib::Source`][crate::glib::Source] for `self` or [`None`] when an error
240    /// occurred. Free with g_source_unref ()
241    #[doc(alias = "gst_rtsp_server_create_source")]
242    fn create_source(
243        &self,
244        cancellable: Option<&impl IsA<gio::Cancellable>>,
245    ) -> Result<glib::Source, glib::Error> {
246        unsafe {
247            let mut error = std::ptr::null_mut();
248            let ret = ffi::gst_rtsp_server_create_source(
249                self.as_ref().to_glib_none().0,
250                cancellable.map(|p| p.as_ref()).to_glib_none().0,
251                &mut error,
252            );
253            if error.is_null() {
254                Ok(from_glib_full(ret))
255            } else {
256                Err(from_glib_full(error))
257            }
258        }
259    }
260
261    /// Get the address on which the server will accept connections.
262    ///
263    /// # Returns
264    ///
265    /// the server address. `g_free()` after usage.
266    #[doc(alias = "gst_rtsp_server_get_address")]
267    #[doc(alias = "get_address")]
268    fn address(&self) -> Option<glib::GString> {
269        unsafe {
270            from_glib_full(ffi::gst_rtsp_server_get_address(
271                self.as_ref().to_glib_none().0,
272            ))
273        }
274    }
275
276    /// Get the [`RTSPAuth`][crate::RTSPAuth] used as the authentication manager of `self`.
277    ///
278    /// # Returns
279    ///
280    /// the [`RTSPAuth`][crate::RTSPAuth] of `self`. `g_object_unref()` after
281    /// usage.
282    #[doc(alias = "gst_rtsp_server_get_auth")]
283    #[doc(alias = "get_auth")]
284    fn auth(&self) -> Option<RTSPAuth> {
285        unsafe {
286            from_glib_full(ffi::gst_rtsp_server_get_auth(
287                self.as_ref().to_glib_none().0,
288            ))
289        }
290    }
291
292    /// The maximum amount of queued requests for the server.
293    ///
294    /// # Returns
295    ///
296    /// the server backlog.
297    #[doc(alias = "gst_rtsp_server_get_backlog")]
298    #[doc(alias = "get_backlog")]
299    fn backlog(&self) -> i32 {
300        unsafe { ffi::gst_rtsp_server_get_backlog(self.as_ref().to_glib_none().0) }
301    }
302
303    /// Get the port number where the server was bound to.
304    ///
305    /// # Returns
306    ///
307    /// the port number
308    #[doc(alias = "gst_rtsp_server_get_bound_port")]
309    #[doc(alias = "get_bound_port")]
310    #[doc(alias = "bound-port")]
311    fn bound_port(&self) -> i32 {
312        unsafe { ffi::gst_rtsp_server_get_bound_port(self.as_ref().to_glib_none().0) }
313    }
314
315    /// Get the Content-Length limit of `self`.
316    ///
317    /// # Returns
318    ///
319    /// the Content-Length limit.
320    #[cfg(feature = "v1_18")]
321    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
322    #[doc(alias = "gst_rtsp_server_get_content_length_limit")]
323    #[doc(alias = "get_content_length_limit")]
324    #[doc(alias = "content-length-limit")]
325    fn content_length_limit(&self) -> u32 {
326        unsafe { ffi::gst_rtsp_server_get_content_length_limit(self.as_ref().to_glib_none().0) }
327    }
328
329    /// Get the [`RTSPMountPoints`][crate::RTSPMountPoints] used as the mount points of `self`.
330    ///
331    /// # Returns
332    ///
333    /// the [`RTSPMountPoints`][crate::RTSPMountPoints] of `self`. `g_object_unref()` after
334    /// usage.
335    #[doc(alias = "gst_rtsp_server_get_mount_points")]
336    #[doc(alias = "get_mount_points")]
337    #[doc(alias = "mount-points")]
338    fn mount_points(&self) -> Option<RTSPMountPoints> {
339        unsafe {
340            from_glib_full(ffi::gst_rtsp_server_get_mount_points(
341                self.as_ref().to_glib_none().0,
342            ))
343        }
344    }
345
346    /// Get the service on which the server will accept connections.
347    ///
348    /// # Returns
349    ///
350    /// the service. use `g_free()` after usage.
351    #[doc(alias = "gst_rtsp_server_get_service")]
352    #[doc(alias = "get_service")]
353    fn service(&self) -> glib::GString {
354        unsafe {
355            from_glib_full(ffi::gst_rtsp_server_get_service(
356                self.as_ref().to_glib_none().0,
357            ))
358        }
359    }
360
361    /// Get the [`RTSPSessionPool`][crate::RTSPSessionPool] used as the session pool of `self`.
362    ///
363    /// # Returns
364    ///
365    /// the [`RTSPSessionPool`][crate::RTSPSessionPool] used for sessions. `g_object_unref()` after
366    /// usage.
367    #[doc(alias = "gst_rtsp_server_get_session_pool")]
368    #[doc(alias = "get_session_pool")]
369    #[doc(alias = "session-pool")]
370    fn session_pool(&self) -> Option<RTSPSessionPool> {
371        unsafe {
372            from_glib_full(ffi::gst_rtsp_server_get_session_pool(
373                self.as_ref().to_glib_none().0,
374            ))
375        }
376    }
377
378    /// Get the [`RTSPThreadPool`][crate::RTSPThreadPool] used as the thread pool of `self`.
379    ///
380    /// # Returns
381    ///
382    /// the [`RTSPThreadPool`][crate::RTSPThreadPool] of `self`. `g_object_unref()` after
383    /// usage.
384    #[doc(alias = "gst_rtsp_server_get_thread_pool")]
385    #[doc(alias = "get_thread_pool")]
386    fn thread_pool(&self) -> Option<RTSPThreadPool> {
387        unsafe {
388            from_glib_full(ffi::gst_rtsp_server_get_thread_pool(
389                self.as_ref().to_glib_none().0,
390            ))
391        }
392    }
393
394    /// Configure `self` to accept connections on the given address.
395    ///
396    /// This function must be called before the server is bound.
397    /// ## `address`
398    /// the address
399    #[doc(alias = "gst_rtsp_server_set_address")]
400    #[doc(alias = "address")]
401    fn set_address(&self, address: &str) {
402        unsafe {
403            ffi::gst_rtsp_server_set_address(
404                self.as_ref().to_glib_none().0,
405                address.to_glib_none().0,
406            );
407        }
408    }
409
410    /// configure `auth` to be used as the authentication manager of `self`.
411    /// ## `auth`
412    /// a [`RTSPAuth`][crate::RTSPAuth]
413    #[doc(alias = "gst_rtsp_server_set_auth")]
414    fn set_auth(&self, auth: Option<&impl IsA<RTSPAuth>>) {
415        unsafe {
416            ffi::gst_rtsp_server_set_auth(
417                self.as_ref().to_glib_none().0,
418                auth.map(|p| p.as_ref()).to_glib_none().0,
419            );
420        }
421    }
422
423    /// configure the maximum amount of requests that may be queued for the
424    /// server.
425    ///
426    /// This function must be called before the server is bound.
427    /// ## `backlog`
428    /// the backlog
429    #[doc(alias = "gst_rtsp_server_set_backlog")]
430    #[doc(alias = "backlog")]
431    fn set_backlog(&self, backlog: i32) {
432        unsafe {
433            ffi::gst_rtsp_server_set_backlog(self.as_ref().to_glib_none().0, backlog);
434        }
435    }
436
437    /// Define an appropriate request size limit and reject requests exceeding the
438    /// limit.
439    #[cfg(feature = "v1_18")]
440    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
441    #[doc(alias = "gst_rtsp_server_set_content_length_limit")]
442    #[doc(alias = "content-length-limit")]
443    fn set_content_length_limit(&self, limit: u32) {
444        unsafe {
445            ffi::gst_rtsp_server_set_content_length_limit(self.as_ref().to_glib_none().0, limit);
446        }
447    }
448
449    /// configure `mounts` to be used as the mount points of `self`.
450    /// ## `mounts`
451    /// a [`RTSPMountPoints`][crate::RTSPMountPoints]
452    #[doc(alias = "gst_rtsp_server_set_mount_points")]
453    #[doc(alias = "mount-points")]
454    fn set_mount_points(&self, mounts: Option<&impl IsA<RTSPMountPoints>>) {
455        unsafe {
456            ffi::gst_rtsp_server_set_mount_points(
457                self.as_ref().to_glib_none().0,
458                mounts.map(|p| p.as_ref()).to_glib_none().0,
459            );
460        }
461    }
462
463    /// Configure `self` to accept connections on the given service.
464    /// `service` should be a string containing the service name (see services(5)) or
465    /// a string containing a port number between 1 and 65535.
466    ///
467    /// When `service` is set to "0", the server will listen on a random free
468    /// port. The actual used port can be retrieved with
469    /// [`bound_port()`][Self::bound_port()].
470    ///
471    /// This function must be called before the server is bound.
472    /// ## `service`
473    /// the service
474    #[doc(alias = "gst_rtsp_server_set_service")]
475    #[doc(alias = "service")]
476    fn set_service(&self, service: &str) {
477        unsafe {
478            ffi::gst_rtsp_server_set_service(
479                self.as_ref().to_glib_none().0,
480                service.to_glib_none().0,
481            );
482        }
483    }
484
485    /// configure `pool` to be used as the session pool of `self`.
486    /// ## `pool`
487    /// a [`RTSPSessionPool`][crate::RTSPSessionPool]
488    #[doc(alias = "gst_rtsp_server_set_session_pool")]
489    #[doc(alias = "session-pool")]
490    fn set_session_pool(&self, pool: Option<&impl IsA<RTSPSessionPool>>) {
491        unsafe {
492            ffi::gst_rtsp_server_set_session_pool(
493                self.as_ref().to_glib_none().0,
494                pool.map(|p| p.as_ref()).to_glib_none().0,
495            );
496        }
497    }
498
499    /// configure `pool` to be used as the thread pool of `self`.
500    /// ## `pool`
501    /// a [`RTSPThreadPool`][crate::RTSPThreadPool]
502    #[doc(alias = "gst_rtsp_server_set_thread_pool")]
503    fn set_thread_pool(&self, pool: Option<&impl IsA<RTSPThreadPool>>) {
504        unsafe {
505            ffi::gst_rtsp_server_set_thread_pool(
506                self.as_ref().to_glib_none().0,
507                pool.map(|p| p.as_ref()).to_glib_none().0,
508            );
509        }
510    }
511
512    /// Take an existing network socket and use it for an RTSP connection. This
513    /// is used when transferring a socket from an HTTP server which should be used
514    /// as an RTSP over HTTP tunnel. The `initial_buffer` contains any remaining data
515    /// that the HTTP server read from the socket while parsing the HTTP header.
516    /// ## `socket`
517    /// a network socket
518    /// ## `ip`
519    /// the IP address of the remote client
520    /// ## `port`
521    /// the port used by the other end
522    /// ## `initial_buffer`
523    /// any initial data that was already read from the socket
524    ///
525    /// # Returns
526    ///
527    /// TRUE if all was ok, FALSE if an error occurred.
528    #[doc(alias = "gst_rtsp_server_transfer_connection")]
529    fn transfer_connection(
530        &self,
531        socket: impl IsA<gio::Socket>,
532        ip: &str,
533        port: i32,
534        initial_buffer: Option<&str>,
535    ) -> Result<(), glib::error::BoolError> {
536        unsafe {
537            glib::result_from_gboolean!(
538                ffi::gst_rtsp_server_transfer_connection(
539                    self.as_ref().to_glib_none().0,
540                    socket.upcast().into_glib_ptr(),
541                    ip.to_glib_none().0,
542                    port,
543                    initial_buffer.to_glib_none().0
544                ),
545                "Failed to transfer to the connection"
546            )
547        }
548    }
549
550    #[cfg(not(feature = "v1_18"))]
551    #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_18"))))]
552    #[doc(alias = "content-length-limit")]
553    fn content_length_limit(&self) -> u32 {
554        ObjectExt::property(self.as_ref(), "content-length-limit")
555    }
556
557    #[cfg(not(feature = "v1_18"))]
558    #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_18"))))]
559    #[doc(alias = "content-length-limit")]
560    fn set_content_length_limit(&self, content_length_limit: u32) {
561        ObjectExt::set_property(self.as_ref(), "content-length-limit", content_length_limit)
562    }
563
564    #[doc(alias = "client-connected")]
565    fn connect_client_connected<F: Fn(&Self, &RTSPClient) + Send + Sync + 'static>(
566        &self,
567        f: F,
568    ) -> SignalHandlerId {
569        unsafe extern "C" fn client_connected_trampoline<
570            P: IsA<RTSPServer>,
571            F: Fn(&P, &RTSPClient) + Send + Sync + 'static,
572        >(
573            this: *mut ffi::GstRTSPServer,
574            object: *mut ffi::GstRTSPClient,
575            f: glib::ffi::gpointer,
576        ) {
577            let f: &F = &*(f as *const F);
578            f(
579                RTSPServer::from_glib_borrow(this).unsafe_cast_ref(),
580                &from_glib_borrow(object),
581            )
582        }
583        unsafe {
584            let f: Box_<F> = Box_::new(f);
585            connect_raw(
586                self.as_ptr() as *mut _,
587                b"client-connected\0".as_ptr() as *const _,
588                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
589                    client_connected_trampoline::<Self, F> as *const (),
590                )),
591                Box_::into_raw(f),
592            )
593        }
594    }
595
596    #[doc(alias = "address")]
597    fn connect_address_notify<F: Fn(&Self) + Send + Sync + 'static>(
598        &self,
599        f: F,
600    ) -> SignalHandlerId {
601        unsafe extern "C" fn notify_address_trampoline<
602            P: IsA<RTSPServer>,
603            F: Fn(&P) + Send + Sync + 'static,
604        >(
605            this: *mut ffi::GstRTSPServer,
606            _param_spec: glib::ffi::gpointer,
607            f: glib::ffi::gpointer,
608        ) {
609            let f: &F = &*(f as *const F);
610            f(RTSPServer::from_glib_borrow(this).unsafe_cast_ref())
611        }
612        unsafe {
613            let f: Box_<F> = Box_::new(f);
614            connect_raw(
615                self.as_ptr() as *mut _,
616                b"notify::address\0".as_ptr() as *const _,
617                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
618                    notify_address_trampoline::<Self, F> as *const (),
619                )),
620                Box_::into_raw(f),
621            )
622        }
623    }
624
625    #[doc(alias = "backlog")]
626    fn connect_backlog_notify<F: Fn(&Self) + Send + Sync + 'static>(
627        &self,
628        f: F,
629    ) -> SignalHandlerId {
630        unsafe extern "C" fn notify_backlog_trampoline<
631            P: IsA<RTSPServer>,
632            F: Fn(&P) + Send + Sync + 'static,
633        >(
634            this: *mut ffi::GstRTSPServer,
635            _param_spec: glib::ffi::gpointer,
636            f: glib::ffi::gpointer,
637        ) {
638            let f: &F = &*(f as *const F);
639            f(RTSPServer::from_glib_borrow(this).unsafe_cast_ref())
640        }
641        unsafe {
642            let f: Box_<F> = Box_::new(f);
643            connect_raw(
644                self.as_ptr() as *mut _,
645                b"notify::backlog\0".as_ptr() as *const _,
646                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
647                    notify_backlog_trampoline::<Self, F> as *const (),
648                )),
649                Box_::into_raw(f),
650            )
651        }
652    }
653
654    #[doc(alias = "bound-port")]
655    fn connect_bound_port_notify<F: Fn(&Self) + Send + Sync + 'static>(
656        &self,
657        f: F,
658    ) -> SignalHandlerId {
659        unsafe extern "C" fn notify_bound_port_trampoline<
660            P: IsA<RTSPServer>,
661            F: Fn(&P) + Send + Sync + 'static,
662        >(
663            this: *mut ffi::GstRTSPServer,
664            _param_spec: glib::ffi::gpointer,
665            f: glib::ffi::gpointer,
666        ) {
667            let f: &F = &*(f as *const F);
668            f(RTSPServer::from_glib_borrow(this).unsafe_cast_ref())
669        }
670        unsafe {
671            let f: Box_<F> = Box_::new(f);
672            connect_raw(
673                self.as_ptr() as *mut _,
674                b"notify::bound-port\0".as_ptr() as *const _,
675                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
676                    notify_bound_port_trampoline::<Self, F> as *const (),
677                )),
678                Box_::into_raw(f),
679            )
680        }
681    }
682
683    #[doc(alias = "content-length-limit")]
684    fn connect_content_length_limit_notify<F: Fn(&Self) + Send + Sync + 'static>(
685        &self,
686        f: F,
687    ) -> SignalHandlerId {
688        unsafe extern "C" fn notify_content_length_limit_trampoline<
689            P: IsA<RTSPServer>,
690            F: Fn(&P) + Send + Sync + 'static,
691        >(
692            this: *mut ffi::GstRTSPServer,
693            _param_spec: glib::ffi::gpointer,
694            f: glib::ffi::gpointer,
695        ) {
696            let f: &F = &*(f as *const F);
697            f(RTSPServer::from_glib_borrow(this).unsafe_cast_ref())
698        }
699        unsafe {
700            let f: Box_<F> = Box_::new(f);
701            connect_raw(
702                self.as_ptr() as *mut _,
703                b"notify::content-length-limit\0".as_ptr() as *const _,
704                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
705                    notify_content_length_limit_trampoline::<Self, F> as *const (),
706                )),
707                Box_::into_raw(f),
708            )
709        }
710    }
711
712    #[doc(alias = "mount-points")]
713    fn connect_mount_points_notify<F: Fn(&Self) + Send + Sync + 'static>(
714        &self,
715        f: F,
716    ) -> SignalHandlerId {
717        unsafe extern "C" fn notify_mount_points_trampoline<
718            P: IsA<RTSPServer>,
719            F: Fn(&P) + Send + Sync + 'static,
720        >(
721            this: *mut ffi::GstRTSPServer,
722            _param_spec: glib::ffi::gpointer,
723            f: glib::ffi::gpointer,
724        ) {
725            let f: &F = &*(f as *const F);
726            f(RTSPServer::from_glib_borrow(this).unsafe_cast_ref())
727        }
728        unsafe {
729            let f: Box_<F> = Box_::new(f);
730            connect_raw(
731                self.as_ptr() as *mut _,
732                b"notify::mount-points\0".as_ptr() as *const _,
733                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
734                    notify_mount_points_trampoline::<Self, F> as *const (),
735                )),
736                Box_::into_raw(f),
737            )
738        }
739    }
740
741    #[doc(alias = "service")]
742    fn connect_service_notify<F: Fn(&Self) + Send + Sync + 'static>(
743        &self,
744        f: F,
745    ) -> SignalHandlerId {
746        unsafe extern "C" fn notify_service_trampoline<
747            P: IsA<RTSPServer>,
748            F: Fn(&P) + Send + Sync + 'static,
749        >(
750            this: *mut ffi::GstRTSPServer,
751            _param_spec: glib::ffi::gpointer,
752            f: glib::ffi::gpointer,
753        ) {
754            let f: &F = &*(f as *const F);
755            f(RTSPServer::from_glib_borrow(this).unsafe_cast_ref())
756        }
757        unsafe {
758            let f: Box_<F> = Box_::new(f);
759            connect_raw(
760                self.as_ptr() as *mut _,
761                b"notify::service\0".as_ptr() as *const _,
762                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
763                    notify_service_trampoline::<Self, F> as *const (),
764                )),
765                Box_::into_raw(f),
766            )
767        }
768    }
769
770    #[doc(alias = "session-pool")]
771    fn connect_session_pool_notify<F: Fn(&Self) + Send + Sync + 'static>(
772        &self,
773        f: F,
774    ) -> SignalHandlerId {
775        unsafe extern "C" fn notify_session_pool_trampoline<
776            P: IsA<RTSPServer>,
777            F: Fn(&P) + Send + Sync + 'static,
778        >(
779            this: *mut ffi::GstRTSPServer,
780            _param_spec: glib::ffi::gpointer,
781            f: glib::ffi::gpointer,
782        ) {
783            let f: &F = &*(f as *const F);
784            f(RTSPServer::from_glib_borrow(this).unsafe_cast_ref())
785        }
786        unsafe {
787            let f: Box_<F> = Box_::new(f);
788            connect_raw(
789                self.as_ptr() as *mut _,
790                b"notify::session-pool\0".as_ptr() as *const _,
791                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
792                    notify_session_pool_trampoline::<Self, F> as *const (),
793                )),
794                Box_::into_raw(f),
795            )
796        }
797    }
798}
799
800impl<O: IsA<RTSPServer>> RTSPServerExt for O {}