1#[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 #[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 #[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
186pub trait RTSPClientExt: IsA<RTSPClient> + 'static {
192 #[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 #[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 #[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 #[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 #[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 #[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 #[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_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 #[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 #[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 #[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 #[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 #[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 #[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 = "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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 = "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 #[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 #[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 {}