Skip to main content

gstreamer_rtsp_server/auto/
rtsp_client.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#[cfg(feature = "v1_18")]
7#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
8use crate::RTSPStreamTransport;
9use crate::{
10    RTSPAuth, RTSPContext, RTSPFilterResult, RTSPMountPoints, RTSPSession, RTSPSessionPool,
11    RTSPThreadPool, ffi,
12};
13use glib::{
14    object::ObjectType as _,
15    prelude::*,
16    signal::{SignalHandlerId, connect_raw},
17    translate::*,
18};
19use std::boxed::Box as Box_;
20
21glib::wrapper! {
22    /// The client object represents the connection and its state with a client.
23    ///
24    /// ## Properties
25    ///
26    ///
27    /// #### `drop-backlog`
28    ///  Readable | Writeable
29    ///
30    ///
31    /// #### `mount-points`
32    ///  Readable | Writeable
33    ///
34    ///
35    /// #### `post-session-timeout`
36    ///  Readable | Writeable
37    ///
38    ///
39    /// #### `session-pool`
40    ///  Readable | Writeable
41    ///
42    /// ## Signals
43    ///
44    ///
45    /// #### `announce-request`
46    ///
47    ///
48    ///
49    /// #### `check-requirements`
50    ///
51    ///
52    ///
53    /// #### `closed`
54    ///
55    ///
56    ///
57    /// #### `describe-request`
58    ///
59    ///
60    ///
61    /// #### `get-parameter-request`
62    ///
63    ///
64    ///
65    /// #### `handle-response`
66    ///
67    ///
68    ///
69    /// #### `new-session`
70    ///
71    ///
72    ///
73    /// #### `options-request`
74    ///
75    ///
76    ///
77    /// #### `pause-request`
78    ///
79    ///
80    ///
81    /// #### `play-request`
82    ///
83    ///
84    ///
85    /// #### `pre-announce-request`
86    ///
87    ///
88    ///
89    /// #### `pre-closed`
90    ///  Provide a way for an application to be notified when a connection is closed,
91    /// before the client's sessions are cleaned up.
92    ///
93    ///
94    ///
95    ///
96    /// #### `pre-describe-request`
97    ///
98    ///
99    ///
100    /// #### `pre-get-parameter-request`
101    ///
102    ///
103    ///
104    /// #### `pre-options-request`
105    ///
106    ///
107    ///
108    /// #### `pre-pause-request`
109    ///
110    ///
111    ///
112    /// #### `pre-play-request`
113    ///
114    ///
115    ///
116    /// #### `pre-record-request`
117    ///
118    ///
119    ///
120    /// #### `pre-set-parameter-request`
121    ///
122    ///
123    ///
124    /// #### `pre-setup-request`
125    ///
126    ///
127    ///
128    /// #### `pre-teardown-request`
129    ///
130    ///
131    ///
132    /// #### `record-request`
133    ///
134    ///
135    ///
136    /// #### `send-message`
137    ///
138    ///
139    ///
140    /// #### `set-parameter-request`
141    ///
142    ///
143    ///
144    /// #### `setup-request`
145    ///
146    ///
147    ///
148    /// #### `teardown-request`
149    ///
150    ///
151    /// # Implements
152    ///
153    /// [`RTSPClientExt`][trait@crate::prelude::RTSPClientExt], [`trait@glib::ObjectExt`], [`RTSPClientExtManual`][trait@crate::prelude::RTSPClientExtManual]
154    #[doc(alias = "GstRTSPClient")]
155    pub struct RTSPClient(Object<ffi::GstRTSPClient, ffi::GstRTSPClientClass>);
156
157    match fn {
158        type_ => || ffi::gst_rtsp_client_get_type(),
159    }
160}
161
162impl RTSPClient {
163    pub const NONE: Option<&'static RTSPClient> = None;
164
165    /// Create a new [`RTSPClient`][crate::RTSPClient] instance.
166    ///
167    /// # Returns
168    ///
169    /// a new [`RTSPClient`][crate::RTSPClient]
170    #[doc(alias = "gst_rtsp_client_new")]
171    pub fn new() -> RTSPClient {
172        assert_initialized_main_thread!();
173        unsafe { from_glib_full(ffi::gst_rtsp_client_new()) }
174    }
175}
176
177impl Default for RTSPClient {
178    fn default() -> Self {
179        Self::new()
180    }
181}
182
183unsafe impl Send for RTSPClient {}
184unsafe impl Sync for RTSPClient {}
185
186/// Trait containing all [`struct@RTSPClient`] methods.
187///
188/// # Implementors
189///
190/// [`RTSPClient`][struct@crate::RTSPClient], [`RTSPOnvifClient`][struct@crate::RTSPOnvifClient]
191pub trait RTSPClientExt: IsA<RTSPClient> + 'static {
192    /// Close the connection of `self` and remove all media it was managing.
193    #[doc(alias = "gst_rtsp_client_close")]
194    fn close(&self) {
195        unsafe {
196            ffi::gst_rtsp_client_close(self.as_ref().to_glib_none().0);
197        }
198    }
199
200    /// Get the [`RTSPAuth`][crate::RTSPAuth] used as the authentication manager of `self`.
201    ///
202    /// # Returns
203    ///
204    /// the [`RTSPAuth`][crate::RTSPAuth] of `self`.
205    /// `g_object_unref()` after usage.
206    #[doc(alias = "gst_rtsp_client_get_auth")]
207    #[doc(alias = "get_auth")]
208    fn auth(&self) -> Option<RTSPAuth> {
209        unsafe {
210            from_glib_full(ffi::gst_rtsp_client_get_auth(
211                self.as_ref().to_glib_none().0,
212            ))
213        }
214    }
215
216    //#[doc(alias = "gst_rtsp_client_get_connection")]
217    //#[doc(alias = "get_connection")]
218    //fn connection(&self) -> /*Ignored*/Option<gst_rtsp::RTSPConnection> {
219    //    unsafe { TODO: call ffi:gst_rtsp_client_get_connection() }
220    //}
221
222    /// Get the Content-Length limit of `self`.
223    ///
224    /// # Returns
225    ///
226    /// the Content-Length limit.
227    #[cfg(feature = "v1_18")]
228    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
229    #[doc(alias = "gst_rtsp_client_get_content_length_limit")]
230    #[doc(alias = "get_content_length_limit")]
231    fn content_length_limit(&self) -> u32 {
232        unsafe { ffi::gst_rtsp_client_get_content_length_limit(self.as_ref().to_glib_none().0) }
233    }
234
235    /// Get the [`RTSPMountPoints`][crate::RTSPMountPoints] object that `self` uses to manage its sessions.
236    ///
237    /// # Returns
238    ///
239    /// a [`RTSPMountPoints`][crate::RTSPMountPoints], unref after usage.
240    #[doc(alias = "gst_rtsp_client_get_mount_points")]
241    #[doc(alias = "get_mount_points")]
242    #[doc(alias = "mount-points")]
243    fn mount_points(&self) -> Option<RTSPMountPoints> {
244        unsafe {
245            from_glib_full(ffi::gst_rtsp_client_get_mount_points(
246                self.as_ref().to_glib_none().0,
247            ))
248        }
249    }
250
251    /// Get the [`RTSPSessionPool`][crate::RTSPSessionPool] object that `self` uses to manage its sessions.
252    ///
253    /// # Returns
254    ///
255    /// a [`RTSPSessionPool`][crate::RTSPSessionPool], unref after usage.
256    #[doc(alias = "gst_rtsp_client_get_session_pool")]
257    #[doc(alias = "get_session_pool")]
258    #[doc(alias = "session-pool")]
259    fn session_pool(&self) -> Option<RTSPSessionPool> {
260        unsafe {
261            from_glib_full(ffi::gst_rtsp_client_get_session_pool(
262                self.as_ref().to_glib_none().0,
263            ))
264        }
265    }
266
267    /// This is useful when providing a send function through
268    /// `gst_rtsp_client_set_send_func()` when doing RTSP over TCP:
269    /// the send function must call gst_rtsp_stream_transport_message_sent ()
270    /// on the appropriate transport when data has been received for streaming
271    /// to continue.
272    ///
273    /// # Returns
274    ///
275    /// the [`RTSPStreamTransport`][crate::RTSPStreamTransport] associated with `channel`.
276    #[cfg(feature = "v1_18")]
277    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
278    #[doc(alias = "gst_rtsp_client_get_stream_transport")]
279    #[doc(alias = "get_stream_transport")]
280    fn stream_transport(&self, channel: u8) -> Option<RTSPStreamTransport> {
281        unsafe {
282            from_glib_none(ffi::gst_rtsp_client_get_stream_transport(
283                self.as_ref().to_glib_none().0,
284                channel,
285            ))
286        }
287    }
288
289    /// Get the [`RTSPThreadPool`][crate::RTSPThreadPool] used as the thread pool of `self`.
290    ///
291    /// # Returns
292    ///
293    /// the [`RTSPThreadPool`][crate::RTSPThreadPool] of `self`. `g_object_unref()` after
294    /// usage.
295    #[doc(alias = "gst_rtsp_client_get_thread_pool")]
296    #[doc(alias = "get_thread_pool")]
297    fn thread_pool(&self) -> Option<RTSPThreadPool> {
298        unsafe {
299            from_glib_full(ffi::gst_rtsp_client_get_thread_pool(
300                self.as_ref().to_glib_none().0,
301            ))
302        }
303    }
304
305    //#[doc(alias = "gst_rtsp_client_handle_message")]
306    //fn handle_message(&self, message: /*Ignored*/&mut gst_rtsp::RTSPMessage) -> gst_rtsp::RTSPResult {
307    //    unsafe { TODO: call ffi:gst_rtsp_client_handle_message() }
308    //}
309
310    //#[doc(alias = "gst_rtsp_client_send_message")]
311    //fn send_message(&self, session: Option<&impl IsA<RTSPSession>>, message: /*Ignored*/&mut gst_rtsp::RTSPMessage) -> gst_rtsp::RTSPResult {
312    //    unsafe { TODO: call ffi:gst_rtsp_client_send_message() }
313    //}
314
315    /// Call `func` for each session managed by `self`. The result value of `func`
316    /// determines what happens to the session. `func` will be called with `self`
317    /// locked so no further actions on `self` can be performed from `func`.
318    ///
319    /// If `func` returns [`RTSPFilterResult::Remove`][crate::RTSPFilterResult::Remove], the session will be removed from
320    /// `self`.
321    ///
322    /// If `func` returns [`RTSPFilterResult::Keep`][crate::RTSPFilterResult::Keep], the session will remain in `self`.
323    ///
324    /// If `func` returns [`RTSPFilterResult::Ref`][crate::RTSPFilterResult::Ref], the session will remain in `self` but
325    /// will also be added with an additional ref to the result `GList` of this
326    /// function..
327    ///
328    /// When `func` is [`None`], [`RTSPFilterResult::Ref`][crate::RTSPFilterResult::Ref] will be assumed for each session.
329    /// ## `func`
330    /// a callback
331    ///
332    /// # Returns
333    ///
334    /// a `GList` with all
335    /// sessions for which `func` returned [`RTSPFilterResult::Ref`][crate::RTSPFilterResult::Ref]. After usage, each
336    /// element in the `GList` should be unreffed before the list is freed.
337    #[doc(alias = "gst_rtsp_client_session_filter")]
338    fn session_filter(
339        &self,
340        func: Option<&mut dyn FnMut(&RTSPClient, &RTSPSession) -> RTSPFilterResult>,
341    ) -> Vec<RTSPSession> {
342        let mut func_data: Option<&mut dyn FnMut(&RTSPClient, &RTSPSession) -> RTSPFilterResult> =
343            func;
344        unsafe extern "C" fn func_func(
345            client: *mut ffi::GstRTSPClient,
346            sess: *mut ffi::GstRTSPSession,
347            user_data: glib::ffi::gpointer,
348        ) -> ffi::GstRTSPFilterResult {
349            unsafe {
350                let client = from_glib_borrow(client);
351                let sess = from_glib_borrow(sess);
352                let callback = user_data
353                    as *mut Option<&mut dyn FnMut(&RTSPClient, &RTSPSession) -> RTSPFilterResult>;
354                if let Some(ref mut callback) = *callback {
355                    callback(&client, &sess)
356                } else {
357                    panic!("cannot get closure...")
358                }
359                .into_glib()
360            }
361        }
362        let func = if func_data.is_some() {
363            Some(func_func as _)
364        } else {
365            None
366        };
367        let super_callback0: &mut Option<
368            &mut dyn FnMut(&RTSPClient, &RTSPSession) -> RTSPFilterResult,
369        > = &mut func_data;
370        unsafe {
371            FromGlibPtrContainer::from_glib_full(ffi::gst_rtsp_client_session_filter(
372                self.as_ref().to_glib_none().0,
373                func,
374                super_callback0 as *mut _ as *mut _,
375            ))
376        }
377    }
378
379    /// configure `auth` to be used as the authentication manager of `self`.
380    /// ## `auth`
381    /// a [`RTSPAuth`][crate::RTSPAuth]
382    #[doc(alias = "gst_rtsp_client_set_auth")]
383    fn set_auth(&self, auth: Option<&impl IsA<RTSPAuth>>) {
384        unsafe {
385            ffi::gst_rtsp_client_set_auth(
386                self.as_ref().to_glib_none().0,
387                auth.map(|p| p.as_ref()).to_glib_none().0,
388            );
389        }
390    }
391
392    //#[doc(alias = "gst_rtsp_client_set_connection")]
393    //fn set_connection(&self, conn: /*Ignored*/gst_rtsp::RTSPConnection) -> bool {
394    //    unsafe { TODO: call ffi:gst_rtsp_client_set_connection() }
395    //}
396
397    /// Configure `self` to use the specified Content-Length limit.
398    ///
399    /// Define an appropriate request size limit and reject requests exceeding the
400    /// limit with response status 413 Request Entity Too Large
401    /// ## `limit`
402    /// Content-Length limit
403    #[cfg(feature = "v1_18")]
404    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
405    #[doc(alias = "gst_rtsp_client_set_content_length_limit")]
406    fn set_content_length_limit(&self, limit: u32) {
407        unsafe {
408            ffi::gst_rtsp_client_set_content_length_limit(self.as_ref().to_glib_none().0, limit);
409        }
410    }
411
412    /// Set `mounts` as the mount points for `self` which it will use to map urls
413    /// to media streams. These mount points are usually inherited from the server that
414    /// created the client but can be overriden later.
415    /// ## `mounts`
416    /// a [`RTSPMountPoints`][crate::RTSPMountPoints]
417    #[doc(alias = "gst_rtsp_client_set_mount_points")]
418    #[doc(alias = "mount-points")]
419    fn set_mount_points(&self, mounts: Option<&impl IsA<RTSPMountPoints>>) {
420        unsafe {
421            ffi::gst_rtsp_client_set_mount_points(
422                self.as_ref().to_glib_none().0,
423                mounts.map(|p| p.as_ref()).to_glib_none().0,
424            );
425        }
426    }
427
428    //#[cfg(feature = "v1_16")]
429    //#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
430    //#[doc(alias = "gst_rtsp_client_set_send_messages_func")]
431    //fn set_send_messages_func(&self, func: /*Unimplemented*/Fn(&RTSPClient, /*Ignored*/gst_rtsp::RTSPMessage, u32, bool) -> bool, user_data: /*Unimplemented*/Option<Basic: Pointer>) {
432    //    unsafe { TODO: call ffi:gst_rtsp_client_set_send_messages_func() }
433    //}
434
435    /// Set `pool` as the sessionpool for `self` which it will use to find
436    /// or allocate sessions. the sessionpool is usually inherited from the server
437    /// that created the client but can be overridden later.
438    /// ## `pool`
439    /// a [`RTSPSessionPool`][crate::RTSPSessionPool]
440    #[doc(alias = "gst_rtsp_client_set_session_pool")]
441    #[doc(alias = "session-pool")]
442    fn set_session_pool(&self, pool: Option<&impl IsA<RTSPSessionPool>>) {
443        unsafe {
444            ffi::gst_rtsp_client_set_session_pool(
445                self.as_ref().to_glib_none().0,
446                pool.map(|p| p.as_ref()).to_glib_none().0,
447            );
448        }
449    }
450
451    /// configure `pool` to be used as the thread pool of `self`.
452    /// ## `pool`
453    /// a [`RTSPThreadPool`][crate::RTSPThreadPool]
454    #[doc(alias = "gst_rtsp_client_set_thread_pool")]
455    fn set_thread_pool(&self, pool: Option<&impl IsA<RTSPThreadPool>>) {
456        unsafe {
457            ffi::gst_rtsp_client_set_thread_pool(
458                self.as_ref().to_glib_none().0,
459                pool.map(|p| p.as_ref()).to_glib_none().0,
460            );
461        }
462    }
463
464    #[doc(alias = "drop-backlog")]
465    fn is_drop_backlog(&self) -> bool {
466        ObjectExt::property(self.as_ref(), "drop-backlog")
467    }
468
469    #[doc(alias = "drop-backlog")]
470    fn set_drop_backlog(&self, drop_backlog: bool) {
471        ObjectExt::set_property(self.as_ref(), "drop-backlog", drop_backlog)
472    }
473
474    #[doc(alias = "post-session-timeout")]
475    fn post_session_timeout(&self) -> i32 {
476        ObjectExt::property(self.as_ref(), "post-session-timeout")
477    }
478
479    #[doc(alias = "post-session-timeout")]
480    fn set_post_session_timeout(&self, post_session_timeout: i32) {
481        ObjectExt::set_property(self.as_ref(), "post-session-timeout", post_session_timeout)
482    }
483
484    /// ## `ctx`
485    /// a [`RTSPContext`][crate::RTSPContext]
486    #[doc(alias = "announce-request")]
487    fn connect_announce_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
488        &self,
489        f: F,
490    ) -> SignalHandlerId {
491        unsafe extern "C" fn announce_request_trampoline<
492            P: IsA<RTSPClient>,
493            F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
494        >(
495            this: *mut ffi::GstRTSPClient,
496            ctx: *mut ffi::GstRTSPContext,
497            f: glib::ffi::gpointer,
498        ) {
499            unsafe {
500                let f: &F = &*(f as *const F);
501                f(
502                    RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
503                    &from_glib_borrow(ctx),
504                )
505            }
506        }
507        unsafe {
508            let f: Box_<F> = Box_::new(f);
509            connect_raw(
510                self.as_ptr() as *mut _,
511                c"announce-request".as_ptr(),
512                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
513                    announce_request_trampoline::<Self, F> as *const (),
514                )),
515                Box_::into_raw(f),
516            )
517        }
518    }
519
520    //#[doc(alias = "check-requirements")]
521    //fn connect_check_requirements<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
522    //    Empty ctype arr: *.CArray TypeId { ns_id: 0, id: 28 }
523    //}
524
525    #[doc(alias = "closed")]
526    fn connect_closed<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
527        unsafe extern "C" fn closed_trampoline<
528            P: IsA<RTSPClient>,
529            F: Fn(&P) + Send + Sync + 'static,
530        >(
531            this: *mut ffi::GstRTSPClient,
532            f: glib::ffi::gpointer,
533        ) {
534            unsafe {
535                let f: &F = &*(f as *const F);
536                f(RTSPClient::from_glib_borrow(this).unsafe_cast_ref())
537            }
538        }
539        unsafe {
540            let f: Box_<F> = Box_::new(f);
541            connect_raw(
542                self.as_ptr() as *mut _,
543                c"closed".as_ptr(),
544                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
545                    closed_trampoline::<Self, F> as *const (),
546                )),
547                Box_::into_raw(f),
548            )
549        }
550    }
551
552    /// ## `ctx`
553    /// a [`RTSPContext`][crate::RTSPContext]
554    #[doc(alias = "describe-request")]
555    fn connect_describe_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
556        &self,
557        f: F,
558    ) -> SignalHandlerId {
559        unsafe extern "C" fn describe_request_trampoline<
560            P: IsA<RTSPClient>,
561            F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
562        >(
563            this: *mut ffi::GstRTSPClient,
564            ctx: *mut ffi::GstRTSPContext,
565            f: glib::ffi::gpointer,
566        ) {
567            unsafe {
568                let f: &F = &*(f as *const F);
569                f(
570                    RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
571                    &from_glib_borrow(ctx),
572                )
573            }
574        }
575        unsafe {
576            let f: Box_<F> = Box_::new(f);
577            connect_raw(
578                self.as_ptr() as *mut _,
579                c"describe-request".as_ptr(),
580                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
581                    describe_request_trampoline::<Self, F> as *const (),
582                )),
583                Box_::into_raw(f),
584            )
585        }
586    }
587
588    /// ## `ctx`
589    /// a [`RTSPContext`][crate::RTSPContext]
590    #[doc(alias = "get-parameter-request")]
591    fn connect_get_parameter_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
592        &self,
593        f: F,
594    ) -> SignalHandlerId {
595        unsafe extern "C" fn get_parameter_request_trampoline<
596            P: IsA<RTSPClient>,
597            F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
598        >(
599            this: *mut ffi::GstRTSPClient,
600            ctx: *mut ffi::GstRTSPContext,
601            f: glib::ffi::gpointer,
602        ) {
603            unsafe {
604                let f: &F = &*(f as *const F);
605                f(
606                    RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
607                    &from_glib_borrow(ctx),
608                )
609            }
610        }
611        unsafe {
612            let f: Box_<F> = Box_::new(f);
613            connect_raw(
614                self.as_ptr() as *mut _,
615                c"get-parameter-request".as_ptr(),
616                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
617                    get_parameter_request_trampoline::<Self, F> as *const (),
618                )),
619                Box_::into_raw(f),
620            )
621        }
622    }
623
624    /// ## `ctx`
625    /// a [`RTSPContext`][crate::RTSPContext]
626    #[doc(alias = "handle-response")]
627    fn connect_handle_response<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
628        &self,
629        f: F,
630    ) -> SignalHandlerId {
631        unsafe extern "C" fn handle_response_trampoline<
632            P: IsA<RTSPClient>,
633            F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
634        >(
635            this: *mut ffi::GstRTSPClient,
636            ctx: *mut ffi::GstRTSPContext,
637            f: glib::ffi::gpointer,
638        ) {
639            unsafe {
640                let f: &F = &*(f as *const F);
641                f(
642                    RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
643                    &from_glib_borrow(ctx),
644                )
645            }
646        }
647        unsafe {
648            let f: Box_<F> = Box_::new(f);
649            connect_raw(
650                self.as_ptr() as *mut _,
651                c"handle-response".as_ptr(),
652                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
653                    handle_response_trampoline::<Self, F> as *const (),
654                )),
655                Box_::into_raw(f),
656            )
657        }
658    }
659
660    #[doc(alias = "new-session")]
661    fn connect_new_session<F: Fn(&Self, &RTSPSession) + Send + Sync + 'static>(
662        &self,
663        f: F,
664    ) -> SignalHandlerId {
665        unsafe extern "C" fn new_session_trampoline<
666            P: IsA<RTSPClient>,
667            F: Fn(&P, &RTSPSession) + Send + Sync + 'static,
668        >(
669            this: *mut ffi::GstRTSPClient,
670            object: *mut ffi::GstRTSPSession,
671            f: glib::ffi::gpointer,
672        ) {
673            unsafe {
674                let f: &F = &*(f as *const F);
675                f(
676                    RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
677                    &from_glib_borrow(object),
678                )
679            }
680        }
681        unsafe {
682            let f: Box_<F> = Box_::new(f);
683            connect_raw(
684                self.as_ptr() as *mut _,
685                c"new-session".as_ptr(),
686                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
687                    new_session_trampoline::<Self, F> as *const (),
688                )),
689                Box_::into_raw(f),
690            )
691        }
692    }
693
694    /// ## `ctx`
695    /// a [`RTSPContext`][crate::RTSPContext]
696    #[doc(alias = "options-request")]
697    fn connect_options_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
698        &self,
699        f: F,
700    ) -> SignalHandlerId {
701        unsafe extern "C" fn options_request_trampoline<
702            P: IsA<RTSPClient>,
703            F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
704        >(
705            this: *mut ffi::GstRTSPClient,
706            ctx: *mut ffi::GstRTSPContext,
707            f: glib::ffi::gpointer,
708        ) {
709            unsafe {
710                let f: &F = &*(f as *const F);
711                f(
712                    RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
713                    &from_glib_borrow(ctx),
714                )
715            }
716        }
717        unsafe {
718            let f: Box_<F> = Box_::new(f);
719            connect_raw(
720                self.as_ptr() as *mut _,
721                c"options-request".as_ptr(),
722                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
723                    options_request_trampoline::<Self, F> as *const (),
724                )),
725                Box_::into_raw(f),
726            )
727        }
728    }
729
730    /// ## `ctx`
731    /// a [`RTSPContext`][crate::RTSPContext]
732    #[doc(alias = "pause-request")]
733    fn connect_pause_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
734        &self,
735        f: F,
736    ) -> SignalHandlerId {
737        unsafe extern "C" fn pause_request_trampoline<
738            P: IsA<RTSPClient>,
739            F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
740        >(
741            this: *mut ffi::GstRTSPClient,
742            ctx: *mut ffi::GstRTSPContext,
743            f: glib::ffi::gpointer,
744        ) {
745            unsafe {
746                let f: &F = &*(f as *const F);
747                f(
748                    RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
749                    &from_glib_borrow(ctx),
750                )
751            }
752        }
753        unsafe {
754            let f: Box_<F> = Box_::new(f);
755            connect_raw(
756                self.as_ptr() as *mut _,
757                c"pause-request".as_ptr(),
758                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
759                    pause_request_trampoline::<Self, F> as *const (),
760                )),
761                Box_::into_raw(f),
762            )
763        }
764    }
765
766    /// ## `ctx`
767    /// a [`RTSPContext`][crate::RTSPContext]
768    #[doc(alias = "play-request")]
769    fn connect_play_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
770        &self,
771        f: F,
772    ) -> SignalHandlerId {
773        unsafe extern "C" fn play_request_trampoline<
774            P: IsA<RTSPClient>,
775            F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
776        >(
777            this: *mut ffi::GstRTSPClient,
778            ctx: *mut ffi::GstRTSPContext,
779            f: glib::ffi::gpointer,
780        ) {
781            unsafe {
782                let f: &F = &*(f as *const F);
783                f(
784                    RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
785                    &from_glib_borrow(ctx),
786                )
787            }
788        }
789        unsafe {
790            let f: Box_<F> = Box_::new(f);
791            connect_raw(
792                self.as_ptr() as *mut _,
793                c"play-request".as_ptr(),
794                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
795                    play_request_trampoline::<Self, F> as *const (),
796                )),
797                Box_::into_raw(f),
798            )
799        }
800    }
801
802    /// ## `ctx`
803    /// a [`RTSPContext`][crate::RTSPContext]
804    ///
805    /// # Returns
806    ///
807    /// a [`gst_rtsp::RTSPStatusCode`][crate::gst_rtsp::RTSPStatusCode], GST_RTSP_STS_OK in case of success,
808    ///  otherwise an appropriate return code
809    #[doc(alias = "pre-announce-request")]
810    fn connect_pre_announce_request<
811        F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
812    >(
813        &self,
814        f: F,
815    ) -> SignalHandlerId {
816        unsafe extern "C" fn pre_announce_request_trampoline<
817            P: IsA<RTSPClient>,
818            F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
819        >(
820            this: *mut ffi::GstRTSPClient,
821            ctx: *mut ffi::GstRTSPContext,
822            f: glib::ffi::gpointer,
823        ) -> gst_rtsp::ffi::GstRTSPStatusCode {
824            unsafe {
825                let f: &F = &*(f as *const F);
826                f(
827                    RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
828                    &from_glib_borrow(ctx),
829                )
830                .into_glib()
831            }
832        }
833        unsafe {
834            let f: Box_<F> = Box_::new(f);
835            connect_raw(
836                self.as_ptr() as *mut _,
837                c"pre-announce-request".as_ptr(),
838                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
839                    pre_announce_request_trampoline::<Self, F> as *const (),
840                )),
841                Box_::into_raw(f),
842            )
843        }
844    }
845
846    /// Provide a way for an application to be notified when a connection is closed,
847    /// before the client's sessions are cleaned up.
848    #[cfg(feature = "v1_28")]
849    #[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
850    #[doc(alias = "pre-closed")]
851    fn connect_pre_closed<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
852        unsafe extern "C" fn pre_closed_trampoline<
853            P: IsA<RTSPClient>,
854            F: Fn(&P) + Send + Sync + 'static,
855        >(
856            this: *mut ffi::GstRTSPClient,
857            f: glib::ffi::gpointer,
858        ) {
859            unsafe {
860                let f: &F = &*(f as *const F);
861                f(RTSPClient::from_glib_borrow(this).unsafe_cast_ref())
862            }
863        }
864        unsafe {
865            let f: Box_<F> = Box_::new(f);
866            connect_raw(
867                self.as_ptr() as *mut _,
868                c"pre-closed".as_ptr(),
869                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
870                    pre_closed_trampoline::<Self, F> as *const (),
871                )),
872                Box_::into_raw(f),
873            )
874        }
875    }
876
877    /// ## `ctx`
878    /// a [`RTSPContext`][crate::RTSPContext]
879    ///
880    /// # Returns
881    ///
882    /// a [`gst_rtsp::RTSPStatusCode`][crate::gst_rtsp::RTSPStatusCode], GST_RTSP_STS_OK in case of success,
883    ///  otherwise an appropriate return code
884    #[doc(alias = "pre-describe-request")]
885    fn connect_pre_describe_request<
886        F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
887    >(
888        &self,
889        f: F,
890    ) -> SignalHandlerId {
891        unsafe extern "C" fn pre_describe_request_trampoline<
892            P: IsA<RTSPClient>,
893            F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
894        >(
895            this: *mut ffi::GstRTSPClient,
896            ctx: *mut ffi::GstRTSPContext,
897            f: glib::ffi::gpointer,
898        ) -> gst_rtsp::ffi::GstRTSPStatusCode {
899            unsafe {
900                let f: &F = &*(f as *const F);
901                f(
902                    RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
903                    &from_glib_borrow(ctx),
904                )
905                .into_glib()
906            }
907        }
908        unsafe {
909            let f: Box_<F> = Box_::new(f);
910            connect_raw(
911                self.as_ptr() as *mut _,
912                c"pre-describe-request".as_ptr(),
913                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
914                    pre_describe_request_trampoline::<Self, F> as *const (),
915                )),
916                Box_::into_raw(f),
917            )
918        }
919    }
920
921    /// ## `ctx`
922    /// a [`RTSPContext`][crate::RTSPContext]
923    ///
924    /// # Returns
925    ///
926    /// a [`gst_rtsp::RTSPStatusCode`][crate::gst_rtsp::RTSPStatusCode], GST_RTSP_STS_OK in case of success,
927    ///  otherwise an appropriate return code
928    #[doc(alias = "pre-get-parameter-request")]
929    fn connect_pre_get_parameter_request<
930        F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
931    >(
932        &self,
933        f: F,
934    ) -> SignalHandlerId {
935        unsafe extern "C" fn pre_get_parameter_request_trampoline<
936            P: IsA<RTSPClient>,
937            F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
938        >(
939            this: *mut ffi::GstRTSPClient,
940            ctx: *mut ffi::GstRTSPContext,
941            f: glib::ffi::gpointer,
942        ) -> gst_rtsp::ffi::GstRTSPStatusCode {
943            unsafe {
944                let f: &F = &*(f as *const F);
945                f(
946                    RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
947                    &from_glib_borrow(ctx),
948                )
949                .into_glib()
950            }
951        }
952        unsafe {
953            let f: Box_<F> = Box_::new(f);
954            connect_raw(
955                self.as_ptr() as *mut _,
956                c"pre-get-parameter-request".as_ptr(),
957                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
958                    pre_get_parameter_request_trampoline::<Self, F> as *const (),
959                )),
960                Box_::into_raw(f),
961            )
962        }
963    }
964
965    /// ## `ctx`
966    /// a [`RTSPContext`][crate::RTSPContext]
967    ///
968    /// # Returns
969    ///
970    /// a [`gst_rtsp::RTSPStatusCode`][crate::gst_rtsp::RTSPStatusCode], GST_RTSP_STS_OK in case of success,
971    ///  otherwise an appropriate return code
972    #[doc(alias = "pre-options-request")]
973    fn connect_pre_options_request<
974        F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
975    >(
976        &self,
977        f: F,
978    ) -> SignalHandlerId {
979        unsafe extern "C" fn pre_options_request_trampoline<
980            P: IsA<RTSPClient>,
981            F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
982        >(
983            this: *mut ffi::GstRTSPClient,
984            ctx: *mut ffi::GstRTSPContext,
985            f: glib::ffi::gpointer,
986        ) -> gst_rtsp::ffi::GstRTSPStatusCode {
987            unsafe {
988                let f: &F = &*(f as *const F);
989                f(
990                    RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
991                    &from_glib_borrow(ctx),
992                )
993                .into_glib()
994            }
995        }
996        unsafe {
997            let f: Box_<F> = Box_::new(f);
998            connect_raw(
999                self.as_ptr() as *mut _,
1000                c"pre-options-request".as_ptr(),
1001                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1002                    pre_options_request_trampoline::<Self, F> as *const (),
1003                )),
1004                Box_::into_raw(f),
1005            )
1006        }
1007    }
1008
1009    /// ## `ctx`
1010    /// a [`RTSPContext`][crate::RTSPContext]
1011    ///
1012    /// # Returns
1013    ///
1014    /// a [`gst_rtsp::RTSPStatusCode`][crate::gst_rtsp::RTSPStatusCode], GST_RTSP_STS_OK in case of success,
1015    ///  otherwise an appropriate return code
1016    #[doc(alias = "pre-pause-request")]
1017    fn connect_pre_pause_request<
1018        F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
1019    >(
1020        &self,
1021        f: F,
1022    ) -> SignalHandlerId {
1023        unsafe extern "C" fn pre_pause_request_trampoline<
1024            P: IsA<RTSPClient>,
1025            F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
1026        >(
1027            this: *mut ffi::GstRTSPClient,
1028            ctx: *mut ffi::GstRTSPContext,
1029            f: glib::ffi::gpointer,
1030        ) -> gst_rtsp::ffi::GstRTSPStatusCode {
1031            unsafe {
1032                let f: &F = &*(f as *const F);
1033                f(
1034                    RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
1035                    &from_glib_borrow(ctx),
1036                )
1037                .into_glib()
1038            }
1039        }
1040        unsafe {
1041            let f: Box_<F> = Box_::new(f);
1042            connect_raw(
1043                self.as_ptr() as *mut _,
1044                c"pre-pause-request".as_ptr(),
1045                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1046                    pre_pause_request_trampoline::<Self, F> as *const (),
1047                )),
1048                Box_::into_raw(f),
1049            )
1050        }
1051    }
1052
1053    /// ## `ctx`
1054    /// a [`RTSPContext`][crate::RTSPContext]
1055    ///
1056    /// # Returns
1057    ///
1058    /// a [`gst_rtsp::RTSPStatusCode`][crate::gst_rtsp::RTSPStatusCode], GST_RTSP_STS_OK in case of success,
1059    ///  otherwise an appropriate return code
1060    #[doc(alias = "pre-play-request")]
1061    fn connect_pre_play_request<
1062        F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
1063    >(
1064        &self,
1065        f: F,
1066    ) -> SignalHandlerId {
1067        unsafe extern "C" fn pre_play_request_trampoline<
1068            P: IsA<RTSPClient>,
1069            F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
1070        >(
1071            this: *mut ffi::GstRTSPClient,
1072            ctx: *mut ffi::GstRTSPContext,
1073            f: glib::ffi::gpointer,
1074        ) -> gst_rtsp::ffi::GstRTSPStatusCode {
1075            unsafe {
1076                let f: &F = &*(f as *const F);
1077                f(
1078                    RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
1079                    &from_glib_borrow(ctx),
1080                )
1081                .into_glib()
1082            }
1083        }
1084        unsafe {
1085            let f: Box_<F> = Box_::new(f);
1086            connect_raw(
1087                self.as_ptr() as *mut _,
1088                c"pre-play-request".as_ptr(),
1089                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1090                    pre_play_request_trampoline::<Self, F> as *const (),
1091                )),
1092                Box_::into_raw(f),
1093            )
1094        }
1095    }
1096
1097    /// ## `ctx`
1098    /// a [`RTSPContext`][crate::RTSPContext]
1099    ///
1100    /// # Returns
1101    ///
1102    /// a [`gst_rtsp::RTSPStatusCode`][crate::gst_rtsp::RTSPStatusCode], GST_RTSP_STS_OK in case of success,
1103    ///  otherwise an appropriate return code
1104    #[doc(alias = "pre-record-request")]
1105    fn connect_pre_record_request<
1106        F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
1107    >(
1108        &self,
1109        f: F,
1110    ) -> SignalHandlerId {
1111        unsafe extern "C" fn pre_record_request_trampoline<
1112            P: IsA<RTSPClient>,
1113            F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
1114        >(
1115            this: *mut ffi::GstRTSPClient,
1116            ctx: *mut ffi::GstRTSPContext,
1117            f: glib::ffi::gpointer,
1118        ) -> gst_rtsp::ffi::GstRTSPStatusCode {
1119            unsafe {
1120                let f: &F = &*(f as *const F);
1121                f(
1122                    RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
1123                    &from_glib_borrow(ctx),
1124                )
1125                .into_glib()
1126            }
1127        }
1128        unsafe {
1129            let f: Box_<F> = Box_::new(f);
1130            connect_raw(
1131                self.as_ptr() as *mut _,
1132                c"pre-record-request".as_ptr(),
1133                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1134                    pre_record_request_trampoline::<Self, F> as *const (),
1135                )),
1136                Box_::into_raw(f),
1137            )
1138        }
1139    }
1140
1141    /// ## `ctx`
1142    /// a [`RTSPContext`][crate::RTSPContext]
1143    ///
1144    /// # Returns
1145    ///
1146    /// a [`gst_rtsp::RTSPStatusCode`][crate::gst_rtsp::RTSPStatusCode], GST_RTSP_STS_OK in case of success,
1147    ///  otherwise an appropriate return code
1148    #[doc(alias = "pre-set-parameter-request")]
1149    fn connect_pre_set_parameter_request<
1150        F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
1151    >(
1152        &self,
1153        f: F,
1154    ) -> SignalHandlerId {
1155        unsafe extern "C" fn pre_set_parameter_request_trampoline<
1156            P: IsA<RTSPClient>,
1157            F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
1158        >(
1159            this: *mut ffi::GstRTSPClient,
1160            ctx: *mut ffi::GstRTSPContext,
1161            f: glib::ffi::gpointer,
1162        ) -> gst_rtsp::ffi::GstRTSPStatusCode {
1163            unsafe {
1164                let f: &F = &*(f as *const F);
1165                f(
1166                    RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
1167                    &from_glib_borrow(ctx),
1168                )
1169                .into_glib()
1170            }
1171        }
1172        unsafe {
1173            let f: Box_<F> = Box_::new(f);
1174            connect_raw(
1175                self.as_ptr() as *mut _,
1176                c"pre-set-parameter-request".as_ptr(),
1177                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1178                    pre_set_parameter_request_trampoline::<Self, F> as *const (),
1179                )),
1180                Box_::into_raw(f),
1181            )
1182        }
1183    }
1184
1185    /// ## `ctx`
1186    /// a [`RTSPContext`][crate::RTSPContext]
1187    ///
1188    /// # Returns
1189    ///
1190    /// a [`gst_rtsp::RTSPStatusCode`][crate::gst_rtsp::RTSPStatusCode], GST_RTSP_STS_OK in case of success,
1191    ///  otherwise an appropriate return code
1192    #[doc(alias = "pre-setup-request")]
1193    fn connect_pre_setup_request<
1194        F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
1195    >(
1196        &self,
1197        f: F,
1198    ) -> SignalHandlerId {
1199        unsafe extern "C" fn pre_setup_request_trampoline<
1200            P: IsA<RTSPClient>,
1201            F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
1202        >(
1203            this: *mut ffi::GstRTSPClient,
1204            ctx: *mut ffi::GstRTSPContext,
1205            f: glib::ffi::gpointer,
1206        ) -> gst_rtsp::ffi::GstRTSPStatusCode {
1207            unsafe {
1208                let f: &F = &*(f as *const F);
1209                f(
1210                    RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
1211                    &from_glib_borrow(ctx),
1212                )
1213                .into_glib()
1214            }
1215        }
1216        unsafe {
1217            let f: Box_<F> = Box_::new(f);
1218            connect_raw(
1219                self.as_ptr() as *mut _,
1220                c"pre-setup-request".as_ptr(),
1221                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1222                    pre_setup_request_trampoline::<Self, F> as *const (),
1223                )),
1224                Box_::into_raw(f),
1225            )
1226        }
1227    }
1228
1229    /// ## `ctx`
1230    /// a [`RTSPContext`][crate::RTSPContext]
1231    ///
1232    /// # Returns
1233    ///
1234    /// a [`gst_rtsp::RTSPStatusCode`][crate::gst_rtsp::RTSPStatusCode], GST_RTSP_STS_OK in case of success,
1235    ///  otherwise an appropriate return code
1236    #[doc(alias = "pre-teardown-request")]
1237    fn connect_pre_teardown_request<
1238        F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
1239    >(
1240        &self,
1241        f: F,
1242    ) -> SignalHandlerId {
1243        unsafe extern "C" fn pre_teardown_request_trampoline<
1244            P: IsA<RTSPClient>,
1245            F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
1246        >(
1247            this: *mut ffi::GstRTSPClient,
1248            ctx: *mut ffi::GstRTSPContext,
1249            f: glib::ffi::gpointer,
1250        ) -> gst_rtsp::ffi::GstRTSPStatusCode {
1251            unsafe {
1252                let f: &F = &*(f as *const F);
1253                f(
1254                    RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
1255                    &from_glib_borrow(ctx),
1256                )
1257                .into_glib()
1258            }
1259        }
1260        unsafe {
1261            let f: Box_<F> = Box_::new(f);
1262            connect_raw(
1263                self.as_ptr() as *mut _,
1264                c"pre-teardown-request".as_ptr(),
1265                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1266                    pre_teardown_request_trampoline::<Self, F> as *const (),
1267                )),
1268                Box_::into_raw(f),
1269            )
1270        }
1271    }
1272
1273    /// ## `ctx`
1274    /// a [`RTSPContext`][crate::RTSPContext]
1275    #[doc(alias = "record-request")]
1276    fn connect_record_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
1277        &self,
1278        f: F,
1279    ) -> SignalHandlerId {
1280        unsafe extern "C" fn record_request_trampoline<
1281            P: IsA<RTSPClient>,
1282            F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
1283        >(
1284            this: *mut ffi::GstRTSPClient,
1285            ctx: *mut ffi::GstRTSPContext,
1286            f: glib::ffi::gpointer,
1287        ) {
1288            unsafe {
1289                let f: &F = &*(f as *const F);
1290                f(
1291                    RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
1292                    &from_glib_borrow(ctx),
1293                )
1294            }
1295        }
1296        unsafe {
1297            let f: Box_<F> = Box_::new(f);
1298            connect_raw(
1299                self.as_ptr() as *mut _,
1300                c"record-request".as_ptr(),
1301                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1302                    record_request_trampoline::<Self, F> as *const (),
1303                )),
1304                Box_::into_raw(f),
1305            )
1306        }
1307    }
1308
1309    //#[doc(alias = "send-message")]
1310    //fn connect_send_message<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
1311    //    Ignored message: GstRtsp.RTSPMessage
1312    //}
1313
1314    /// ## `ctx`
1315    /// a [`RTSPContext`][crate::RTSPContext]
1316    #[doc(alias = "set-parameter-request")]
1317    fn connect_set_parameter_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
1318        &self,
1319        f: F,
1320    ) -> SignalHandlerId {
1321        unsafe extern "C" fn set_parameter_request_trampoline<
1322            P: IsA<RTSPClient>,
1323            F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
1324        >(
1325            this: *mut ffi::GstRTSPClient,
1326            ctx: *mut ffi::GstRTSPContext,
1327            f: glib::ffi::gpointer,
1328        ) {
1329            unsafe {
1330                let f: &F = &*(f as *const F);
1331                f(
1332                    RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
1333                    &from_glib_borrow(ctx),
1334                )
1335            }
1336        }
1337        unsafe {
1338            let f: Box_<F> = Box_::new(f);
1339            connect_raw(
1340                self.as_ptr() as *mut _,
1341                c"set-parameter-request".as_ptr(),
1342                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1343                    set_parameter_request_trampoline::<Self, F> as *const (),
1344                )),
1345                Box_::into_raw(f),
1346            )
1347        }
1348    }
1349
1350    /// ## `ctx`
1351    /// a [`RTSPContext`][crate::RTSPContext]
1352    #[doc(alias = "setup-request")]
1353    fn connect_setup_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
1354        &self,
1355        f: F,
1356    ) -> SignalHandlerId {
1357        unsafe extern "C" fn setup_request_trampoline<
1358            P: IsA<RTSPClient>,
1359            F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
1360        >(
1361            this: *mut ffi::GstRTSPClient,
1362            ctx: *mut ffi::GstRTSPContext,
1363            f: glib::ffi::gpointer,
1364        ) {
1365            unsafe {
1366                let f: &F = &*(f as *const F);
1367                f(
1368                    RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
1369                    &from_glib_borrow(ctx),
1370                )
1371            }
1372        }
1373        unsafe {
1374            let f: Box_<F> = Box_::new(f);
1375            connect_raw(
1376                self.as_ptr() as *mut _,
1377                c"setup-request".as_ptr(),
1378                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1379                    setup_request_trampoline::<Self, F> as *const (),
1380                )),
1381                Box_::into_raw(f),
1382            )
1383        }
1384    }
1385
1386    /// ## `ctx`
1387    /// a [`RTSPContext`][crate::RTSPContext]
1388    #[doc(alias = "teardown-request")]
1389    fn connect_teardown_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
1390        &self,
1391        f: F,
1392    ) -> SignalHandlerId {
1393        unsafe extern "C" fn teardown_request_trampoline<
1394            P: IsA<RTSPClient>,
1395            F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
1396        >(
1397            this: *mut ffi::GstRTSPClient,
1398            ctx: *mut ffi::GstRTSPContext,
1399            f: glib::ffi::gpointer,
1400        ) {
1401            unsafe {
1402                let f: &F = &*(f as *const F);
1403                f(
1404                    RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
1405                    &from_glib_borrow(ctx),
1406                )
1407            }
1408        }
1409        unsafe {
1410            let f: Box_<F> = Box_::new(f);
1411            connect_raw(
1412                self.as_ptr() as *mut _,
1413                c"teardown-request".as_ptr(),
1414                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1415                    teardown_request_trampoline::<Self, F> as *const (),
1416                )),
1417                Box_::into_raw(f),
1418            )
1419        }
1420    }
1421
1422    #[doc(alias = "drop-backlog")]
1423    fn connect_drop_backlog_notify<F: Fn(&Self) + Send + Sync + 'static>(
1424        &self,
1425        f: F,
1426    ) -> SignalHandlerId {
1427        unsafe extern "C" fn notify_drop_backlog_trampoline<
1428            P: IsA<RTSPClient>,
1429            F: Fn(&P) + Send + Sync + 'static,
1430        >(
1431            this: *mut ffi::GstRTSPClient,
1432            _param_spec: glib::ffi::gpointer,
1433            f: glib::ffi::gpointer,
1434        ) {
1435            unsafe {
1436                let f: &F = &*(f as *const F);
1437                f(RTSPClient::from_glib_borrow(this).unsafe_cast_ref())
1438            }
1439        }
1440        unsafe {
1441            let f: Box_<F> = Box_::new(f);
1442            connect_raw(
1443                self.as_ptr() as *mut _,
1444                c"notify::drop-backlog".as_ptr(),
1445                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1446                    notify_drop_backlog_trampoline::<Self, F> as *const (),
1447                )),
1448                Box_::into_raw(f),
1449            )
1450        }
1451    }
1452
1453    #[doc(alias = "mount-points")]
1454    fn connect_mount_points_notify<F: Fn(&Self) + Send + Sync + 'static>(
1455        &self,
1456        f: F,
1457    ) -> SignalHandlerId {
1458        unsafe extern "C" fn notify_mount_points_trampoline<
1459            P: IsA<RTSPClient>,
1460            F: Fn(&P) + Send + Sync + 'static,
1461        >(
1462            this: *mut ffi::GstRTSPClient,
1463            _param_spec: glib::ffi::gpointer,
1464            f: glib::ffi::gpointer,
1465        ) {
1466            unsafe {
1467                let f: &F = &*(f as *const F);
1468                f(RTSPClient::from_glib_borrow(this).unsafe_cast_ref())
1469            }
1470        }
1471        unsafe {
1472            let f: Box_<F> = Box_::new(f);
1473            connect_raw(
1474                self.as_ptr() as *mut _,
1475                c"notify::mount-points".as_ptr(),
1476                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1477                    notify_mount_points_trampoline::<Self, F> as *const (),
1478                )),
1479                Box_::into_raw(f),
1480            )
1481        }
1482    }
1483
1484    #[doc(alias = "post-session-timeout")]
1485    fn connect_post_session_timeout_notify<F: Fn(&Self) + Send + Sync + 'static>(
1486        &self,
1487        f: F,
1488    ) -> SignalHandlerId {
1489        unsafe extern "C" fn notify_post_session_timeout_trampoline<
1490            P: IsA<RTSPClient>,
1491            F: Fn(&P) + Send + Sync + 'static,
1492        >(
1493            this: *mut ffi::GstRTSPClient,
1494            _param_spec: glib::ffi::gpointer,
1495            f: glib::ffi::gpointer,
1496        ) {
1497            unsafe {
1498                let f: &F = &*(f as *const F);
1499                f(RTSPClient::from_glib_borrow(this).unsafe_cast_ref())
1500            }
1501        }
1502        unsafe {
1503            let f: Box_<F> = Box_::new(f);
1504            connect_raw(
1505                self.as_ptr() as *mut _,
1506                c"notify::post-session-timeout".as_ptr(),
1507                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1508                    notify_post_session_timeout_trampoline::<Self, F> as *const (),
1509                )),
1510                Box_::into_raw(f),
1511            )
1512        }
1513    }
1514
1515    #[doc(alias = "session-pool")]
1516    fn connect_session_pool_notify<F: Fn(&Self) + Send + Sync + 'static>(
1517        &self,
1518        f: F,
1519    ) -> SignalHandlerId {
1520        unsafe extern "C" fn notify_session_pool_trampoline<
1521            P: IsA<RTSPClient>,
1522            F: Fn(&P) + Send + Sync + 'static,
1523        >(
1524            this: *mut ffi::GstRTSPClient,
1525            _param_spec: glib::ffi::gpointer,
1526            f: glib::ffi::gpointer,
1527        ) {
1528            unsafe {
1529                let f: &F = &*(f as *const F);
1530                f(RTSPClient::from_glib_borrow(this).unsafe_cast_ref())
1531            }
1532        }
1533        unsafe {
1534            let f: Box_<F> = Box_::new(f);
1535            connect_raw(
1536                self.as_ptr() as *mut _,
1537                c"notify::session-pool".as_ptr(),
1538                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1539                    notify_session_pool_trampoline::<Self, F> as *const (),
1540                )),
1541                Box_::into_raw(f),
1542            )
1543        }
1544    }
1545}
1546
1547impl<O: IsA<RTSPClient>> RTSPClientExt for O {}