1#[cfg(feature = "v1_18")]
7#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
8use crate::RTSPStreamTransport;
9use crate::{
10 ffi, RTSPAuth, RTSPContext, RTSPFilterResult, RTSPMountPoints, RTSPSession, RTSPSessionPool,
11 RTSPThreadPool,
12};
13use glib::{
14 object::ObjectType as _,
15 prelude::*,
16 signal::{connect_raw, SignalHandlerId},
17 translate::*,
18};
19use std::boxed::Box as Box_;
20
21glib::wrapper! {
22 #[doc(alias = "GstRTSPClient")]
148 pub struct RTSPClient(Object<ffi::GstRTSPClient, ffi::GstRTSPClientClass>);
149
150 match fn {
151 type_ => || ffi::gst_rtsp_client_get_type(),
152 }
153}
154
155impl RTSPClient {
156 pub const NONE: Option<&'static RTSPClient> = None;
157
158 #[doc(alias = "gst_rtsp_client_new")]
164 pub fn new() -> RTSPClient {
165 assert_initialized_main_thread!();
166 unsafe { from_glib_full(ffi::gst_rtsp_client_new()) }
167 }
168}
169
170impl Default for RTSPClient {
171 fn default() -> Self {
172 Self::new()
173 }
174}
175
176unsafe impl Send for RTSPClient {}
177unsafe impl Sync for RTSPClient {}
178
179pub trait RTSPClientExt: IsA<RTSPClient> + 'static {
185 #[doc(alias = "gst_rtsp_client_close")]
187 fn close(&self) {
188 unsafe {
189 ffi::gst_rtsp_client_close(self.as_ref().to_glib_none().0);
190 }
191 }
192
193 #[doc(alias = "gst_rtsp_client_get_auth")]
200 #[doc(alias = "get_auth")]
201 fn auth(&self) -> Option<RTSPAuth> {
202 unsafe {
203 from_glib_full(ffi::gst_rtsp_client_get_auth(
204 self.as_ref().to_glib_none().0,
205 ))
206 }
207 }
208
209 #[cfg(feature = "v1_18")]
221 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
222 #[doc(alias = "gst_rtsp_client_get_content_length_limit")]
223 #[doc(alias = "get_content_length_limit")]
224 fn content_length_limit(&self) -> u32 {
225 unsafe { ffi::gst_rtsp_client_get_content_length_limit(self.as_ref().to_glib_none().0) }
226 }
227
228 #[doc(alias = "gst_rtsp_client_get_mount_points")]
234 #[doc(alias = "get_mount_points")]
235 #[doc(alias = "mount-points")]
236 fn mount_points(&self) -> Option<RTSPMountPoints> {
237 unsafe {
238 from_glib_full(ffi::gst_rtsp_client_get_mount_points(
239 self.as_ref().to_glib_none().0,
240 ))
241 }
242 }
243
244 #[doc(alias = "gst_rtsp_client_get_session_pool")]
250 #[doc(alias = "get_session_pool")]
251 #[doc(alias = "session-pool")]
252 fn session_pool(&self) -> Option<RTSPSessionPool> {
253 unsafe {
254 from_glib_full(ffi::gst_rtsp_client_get_session_pool(
255 self.as_ref().to_glib_none().0,
256 ))
257 }
258 }
259
260 #[cfg(feature = "v1_18")]
270 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
271 #[doc(alias = "gst_rtsp_client_get_stream_transport")]
272 #[doc(alias = "get_stream_transport")]
273 fn stream_transport(&self, channel: u8) -> Option<RTSPStreamTransport> {
274 unsafe {
275 from_glib_none(ffi::gst_rtsp_client_get_stream_transport(
276 self.as_ref().to_glib_none().0,
277 channel,
278 ))
279 }
280 }
281
282 #[doc(alias = "gst_rtsp_client_get_thread_pool")]
289 #[doc(alias = "get_thread_pool")]
290 fn thread_pool(&self) -> Option<RTSPThreadPool> {
291 unsafe {
292 from_glib_full(ffi::gst_rtsp_client_get_thread_pool(
293 self.as_ref().to_glib_none().0,
294 ))
295 }
296 }
297
298 #[doc(alias = "gst_rtsp_client_session_filter")]
331 fn session_filter(
332 &self,
333 func: Option<&mut dyn (FnMut(&RTSPClient, &RTSPSession) -> RTSPFilterResult)>,
334 ) -> Vec<RTSPSession> {
335 let mut func_data: Option<&mut dyn (FnMut(&RTSPClient, &RTSPSession) -> RTSPFilterResult)> =
336 func;
337 unsafe extern "C" fn func_func(
338 client: *mut ffi::GstRTSPClient,
339 sess: *mut ffi::GstRTSPSession,
340 user_data: glib::ffi::gpointer,
341 ) -> ffi::GstRTSPFilterResult {
342 let client = from_glib_borrow(client);
343 let sess = from_glib_borrow(sess);
344 let callback = user_data
345 as *mut Option<&mut dyn (FnMut(&RTSPClient, &RTSPSession) -> RTSPFilterResult)>;
346 if let Some(ref mut callback) = *callback {
347 callback(&client, &sess)
348 } else {
349 panic!("cannot get closure...")
350 }
351 .into_glib()
352 }
353 let func = if func_data.is_some() {
354 Some(func_func as _)
355 } else {
356 None
357 };
358 let super_callback0: &mut Option<
359 &mut dyn (FnMut(&RTSPClient, &RTSPSession) -> RTSPFilterResult),
360 > = &mut func_data;
361 unsafe {
362 FromGlibPtrContainer::from_glib_full(ffi::gst_rtsp_client_session_filter(
363 self.as_ref().to_glib_none().0,
364 func,
365 super_callback0 as *mut _ as *mut _,
366 ))
367 }
368 }
369
370 #[doc(alias = "gst_rtsp_client_set_auth")]
374 fn set_auth(&self, auth: Option<&impl IsA<RTSPAuth>>) {
375 unsafe {
376 ffi::gst_rtsp_client_set_auth(
377 self.as_ref().to_glib_none().0,
378 auth.map(|p| p.as_ref()).to_glib_none().0,
379 );
380 }
381 }
382
383 #[cfg(feature = "v1_18")]
395 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
396 #[doc(alias = "gst_rtsp_client_set_content_length_limit")]
397 fn set_content_length_limit(&self, limit: u32) {
398 unsafe {
399 ffi::gst_rtsp_client_set_content_length_limit(self.as_ref().to_glib_none().0, limit);
400 }
401 }
402
403 #[doc(alias = "gst_rtsp_client_set_mount_points")]
409 #[doc(alias = "mount-points")]
410 fn set_mount_points(&self, mounts: Option<&impl IsA<RTSPMountPoints>>) {
411 unsafe {
412 ffi::gst_rtsp_client_set_mount_points(
413 self.as_ref().to_glib_none().0,
414 mounts.map(|p| p.as_ref()).to_glib_none().0,
415 );
416 }
417 }
418
419 #[doc(alias = "gst_rtsp_client_set_session_pool")]
432 #[doc(alias = "session-pool")]
433 fn set_session_pool(&self, pool: Option<&impl IsA<RTSPSessionPool>>) {
434 unsafe {
435 ffi::gst_rtsp_client_set_session_pool(
436 self.as_ref().to_glib_none().0,
437 pool.map(|p| p.as_ref()).to_glib_none().0,
438 );
439 }
440 }
441
442 #[doc(alias = "gst_rtsp_client_set_thread_pool")]
446 fn set_thread_pool(&self, pool: Option<&impl IsA<RTSPThreadPool>>) {
447 unsafe {
448 ffi::gst_rtsp_client_set_thread_pool(
449 self.as_ref().to_glib_none().0,
450 pool.map(|p| p.as_ref()).to_glib_none().0,
451 );
452 }
453 }
454
455 #[doc(alias = "drop-backlog")]
456 fn is_drop_backlog(&self) -> bool {
457 ObjectExt::property(self.as_ref(), "drop-backlog")
458 }
459
460 #[doc(alias = "drop-backlog")]
461 fn set_drop_backlog(&self, drop_backlog: bool) {
462 ObjectExt::set_property(self.as_ref(), "drop-backlog", drop_backlog)
463 }
464
465 #[doc(alias = "post-session-timeout")]
466 fn post_session_timeout(&self) -> i32 {
467 ObjectExt::property(self.as_ref(), "post-session-timeout")
468 }
469
470 #[doc(alias = "post-session-timeout")]
471 fn set_post_session_timeout(&self, post_session_timeout: i32) {
472 ObjectExt::set_property(self.as_ref(), "post-session-timeout", post_session_timeout)
473 }
474
475 #[doc(alias = "announce-request")]
478 fn connect_announce_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
479 &self,
480 f: F,
481 ) -> SignalHandlerId {
482 unsafe extern "C" fn announce_request_trampoline<
483 P: IsA<RTSPClient>,
484 F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
485 >(
486 this: *mut ffi::GstRTSPClient,
487 ctx: *mut ffi::GstRTSPContext,
488 f: glib::ffi::gpointer,
489 ) {
490 let f: &F = &*(f as *const F);
491 f(
492 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
493 &from_glib_borrow(ctx),
494 )
495 }
496 unsafe {
497 let f: Box_<F> = Box_::new(f);
498 connect_raw(
499 self.as_ptr() as *mut _,
500 c"announce-request".as_ptr() as *const _,
501 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
502 announce_request_trampoline::<Self, F> as *const (),
503 )),
504 Box_::into_raw(f),
505 )
506 }
507 }
508
509 #[doc(alias = "closed")]
515 fn connect_closed<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
516 unsafe extern "C" fn closed_trampoline<
517 P: IsA<RTSPClient>,
518 F: Fn(&P) + Send + Sync + 'static,
519 >(
520 this: *mut ffi::GstRTSPClient,
521 f: glib::ffi::gpointer,
522 ) {
523 let f: &F = &*(f as *const F);
524 f(RTSPClient::from_glib_borrow(this).unsafe_cast_ref())
525 }
526 unsafe {
527 let f: Box_<F> = Box_::new(f);
528 connect_raw(
529 self.as_ptr() as *mut _,
530 c"closed".as_ptr() as *const _,
531 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
532 closed_trampoline::<Self, F> as *const (),
533 )),
534 Box_::into_raw(f),
535 )
536 }
537 }
538
539 #[doc(alias = "describe-request")]
542 fn connect_describe_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
543 &self,
544 f: F,
545 ) -> SignalHandlerId {
546 unsafe extern "C" fn describe_request_trampoline<
547 P: IsA<RTSPClient>,
548 F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
549 >(
550 this: *mut ffi::GstRTSPClient,
551 ctx: *mut ffi::GstRTSPContext,
552 f: glib::ffi::gpointer,
553 ) {
554 let f: &F = &*(f as *const F);
555 f(
556 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
557 &from_glib_borrow(ctx),
558 )
559 }
560 unsafe {
561 let f: Box_<F> = Box_::new(f);
562 connect_raw(
563 self.as_ptr() as *mut _,
564 c"describe-request".as_ptr() as *const _,
565 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
566 describe_request_trampoline::<Self, F> as *const (),
567 )),
568 Box_::into_raw(f),
569 )
570 }
571 }
572
573 #[doc(alias = "get-parameter-request")]
576 fn connect_get_parameter_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
577 &self,
578 f: F,
579 ) -> SignalHandlerId {
580 unsafe extern "C" fn get_parameter_request_trampoline<
581 P: IsA<RTSPClient>,
582 F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
583 >(
584 this: *mut ffi::GstRTSPClient,
585 ctx: *mut ffi::GstRTSPContext,
586 f: glib::ffi::gpointer,
587 ) {
588 let f: &F = &*(f as *const F);
589 f(
590 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
591 &from_glib_borrow(ctx),
592 )
593 }
594 unsafe {
595 let f: Box_<F> = Box_::new(f);
596 connect_raw(
597 self.as_ptr() as *mut _,
598 c"get-parameter-request".as_ptr() as *const _,
599 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
600 get_parameter_request_trampoline::<Self, F> as *const (),
601 )),
602 Box_::into_raw(f),
603 )
604 }
605 }
606
607 #[doc(alias = "handle-response")]
610 fn connect_handle_response<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
611 &self,
612 f: F,
613 ) -> SignalHandlerId {
614 unsafe extern "C" fn handle_response_trampoline<
615 P: IsA<RTSPClient>,
616 F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
617 >(
618 this: *mut ffi::GstRTSPClient,
619 ctx: *mut ffi::GstRTSPContext,
620 f: glib::ffi::gpointer,
621 ) {
622 let f: &F = &*(f as *const F);
623 f(
624 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
625 &from_glib_borrow(ctx),
626 )
627 }
628 unsafe {
629 let f: Box_<F> = Box_::new(f);
630 connect_raw(
631 self.as_ptr() as *mut _,
632 c"handle-response".as_ptr() as *const _,
633 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
634 handle_response_trampoline::<Self, F> as *const (),
635 )),
636 Box_::into_raw(f),
637 )
638 }
639 }
640
641 #[doc(alias = "new-session")]
642 fn connect_new_session<F: Fn(&Self, &RTSPSession) + Send + Sync + 'static>(
643 &self,
644 f: F,
645 ) -> SignalHandlerId {
646 unsafe extern "C" fn new_session_trampoline<
647 P: IsA<RTSPClient>,
648 F: Fn(&P, &RTSPSession) + Send + Sync + 'static,
649 >(
650 this: *mut ffi::GstRTSPClient,
651 object: *mut ffi::GstRTSPSession,
652 f: glib::ffi::gpointer,
653 ) {
654 let f: &F = &*(f as *const F);
655 f(
656 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
657 &from_glib_borrow(object),
658 )
659 }
660 unsafe {
661 let f: Box_<F> = Box_::new(f);
662 connect_raw(
663 self.as_ptr() as *mut _,
664 c"new-session".as_ptr() as *const _,
665 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
666 new_session_trampoline::<Self, F> as *const (),
667 )),
668 Box_::into_raw(f),
669 )
670 }
671 }
672
673 #[doc(alias = "options-request")]
676 fn connect_options_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
677 &self,
678 f: F,
679 ) -> SignalHandlerId {
680 unsafe extern "C" fn options_request_trampoline<
681 P: IsA<RTSPClient>,
682 F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
683 >(
684 this: *mut ffi::GstRTSPClient,
685 ctx: *mut ffi::GstRTSPContext,
686 f: glib::ffi::gpointer,
687 ) {
688 let f: &F = &*(f as *const F);
689 f(
690 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
691 &from_glib_borrow(ctx),
692 )
693 }
694 unsafe {
695 let f: Box_<F> = Box_::new(f);
696 connect_raw(
697 self.as_ptr() as *mut _,
698 c"options-request".as_ptr() as *const _,
699 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
700 options_request_trampoline::<Self, F> as *const (),
701 )),
702 Box_::into_raw(f),
703 )
704 }
705 }
706
707 #[doc(alias = "pause-request")]
710 fn connect_pause_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
711 &self,
712 f: F,
713 ) -> SignalHandlerId {
714 unsafe extern "C" fn pause_request_trampoline<
715 P: IsA<RTSPClient>,
716 F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
717 >(
718 this: *mut ffi::GstRTSPClient,
719 ctx: *mut ffi::GstRTSPContext,
720 f: glib::ffi::gpointer,
721 ) {
722 let f: &F = &*(f as *const F);
723 f(
724 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
725 &from_glib_borrow(ctx),
726 )
727 }
728 unsafe {
729 let f: Box_<F> = Box_::new(f);
730 connect_raw(
731 self.as_ptr() as *mut _,
732 c"pause-request".as_ptr() as *const _,
733 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
734 pause_request_trampoline::<Self, F> as *const (),
735 )),
736 Box_::into_raw(f),
737 )
738 }
739 }
740
741 #[doc(alias = "play-request")]
744 fn connect_play_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
745 &self,
746 f: F,
747 ) -> SignalHandlerId {
748 unsafe extern "C" fn play_request_trampoline<
749 P: IsA<RTSPClient>,
750 F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
751 >(
752 this: *mut ffi::GstRTSPClient,
753 ctx: *mut ffi::GstRTSPContext,
754 f: glib::ffi::gpointer,
755 ) {
756 let f: &F = &*(f as *const F);
757 f(
758 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
759 &from_glib_borrow(ctx),
760 )
761 }
762 unsafe {
763 let f: Box_<F> = Box_::new(f);
764 connect_raw(
765 self.as_ptr() as *mut _,
766 c"play-request".as_ptr() as *const _,
767 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
768 play_request_trampoline::<Self, F> as *const (),
769 )),
770 Box_::into_raw(f),
771 )
772 }
773 }
774
775 #[doc(alias = "pre-announce-request")]
783 fn connect_pre_announce_request<
784 F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
785 >(
786 &self,
787 f: F,
788 ) -> SignalHandlerId {
789 unsafe extern "C" fn pre_announce_request_trampoline<
790 P: IsA<RTSPClient>,
791 F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
792 >(
793 this: *mut ffi::GstRTSPClient,
794 ctx: *mut ffi::GstRTSPContext,
795 f: glib::ffi::gpointer,
796 ) -> gst_rtsp::ffi::GstRTSPStatusCode {
797 let f: &F = &*(f as *const F);
798 f(
799 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
800 &from_glib_borrow(ctx),
801 )
802 .into_glib()
803 }
804 unsafe {
805 let f: Box_<F> = Box_::new(f);
806 connect_raw(
807 self.as_ptr() as *mut _,
808 c"pre-announce-request".as_ptr() as *const _,
809 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
810 pre_announce_request_trampoline::<Self, F> as *const (),
811 )),
812 Box_::into_raw(f),
813 )
814 }
815 }
816
817 #[doc(alias = "pre-describe-request")]
825 fn connect_pre_describe_request<
826 F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
827 >(
828 &self,
829 f: F,
830 ) -> SignalHandlerId {
831 unsafe extern "C" fn pre_describe_request_trampoline<
832 P: IsA<RTSPClient>,
833 F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
834 >(
835 this: *mut ffi::GstRTSPClient,
836 ctx: *mut ffi::GstRTSPContext,
837 f: glib::ffi::gpointer,
838 ) -> gst_rtsp::ffi::GstRTSPStatusCode {
839 let f: &F = &*(f as *const F);
840 f(
841 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
842 &from_glib_borrow(ctx),
843 )
844 .into_glib()
845 }
846 unsafe {
847 let f: Box_<F> = Box_::new(f);
848 connect_raw(
849 self.as_ptr() as *mut _,
850 c"pre-describe-request".as_ptr() as *const _,
851 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
852 pre_describe_request_trampoline::<Self, F> as *const (),
853 )),
854 Box_::into_raw(f),
855 )
856 }
857 }
858
859 #[doc(alias = "pre-get-parameter-request")]
867 fn connect_pre_get_parameter_request<
868 F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
869 >(
870 &self,
871 f: F,
872 ) -> SignalHandlerId {
873 unsafe extern "C" fn pre_get_parameter_request_trampoline<
874 P: IsA<RTSPClient>,
875 F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
876 >(
877 this: *mut ffi::GstRTSPClient,
878 ctx: *mut ffi::GstRTSPContext,
879 f: glib::ffi::gpointer,
880 ) -> gst_rtsp::ffi::GstRTSPStatusCode {
881 let f: &F = &*(f as *const F);
882 f(
883 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
884 &from_glib_borrow(ctx),
885 )
886 .into_glib()
887 }
888 unsafe {
889 let f: Box_<F> = Box_::new(f);
890 connect_raw(
891 self.as_ptr() as *mut _,
892 c"pre-get-parameter-request".as_ptr() as *const _,
893 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
894 pre_get_parameter_request_trampoline::<Self, F> as *const (),
895 )),
896 Box_::into_raw(f),
897 )
898 }
899 }
900
901 #[doc(alias = "pre-options-request")]
909 fn connect_pre_options_request<
910 F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
911 >(
912 &self,
913 f: F,
914 ) -> SignalHandlerId {
915 unsafe extern "C" fn pre_options_request_trampoline<
916 P: IsA<RTSPClient>,
917 F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
918 >(
919 this: *mut ffi::GstRTSPClient,
920 ctx: *mut ffi::GstRTSPContext,
921 f: glib::ffi::gpointer,
922 ) -> gst_rtsp::ffi::GstRTSPStatusCode {
923 let f: &F = &*(f as *const F);
924 f(
925 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
926 &from_glib_borrow(ctx),
927 )
928 .into_glib()
929 }
930 unsafe {
931 let f: Box_<F> = Box_::new(f);
932 connect_raw(
933 self.as_ptr() as *mut _,
934 c"pre-options-request".as_ptr() as *const _,
935 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
936 pre_options_request_trampoline::<Self, F> as *const (),
937 )),
938 Box_::into_raw(f),
939 )
940 }
941 }
942
943 #[doc(alias = "pre-pause-request")]
951 fn connect_pre_pause_request<
952 F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
953 >(
954 &self,
955 f: F,
956 ) -> SignalHandlerId {
957 unsafe extern "C" fn pre_pause_request_trampoline<
958 P: IsA<RTSPClient>,
959 F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
960 >(
961 this: *mut ffi::GstRTSPClient,
962 ctx: *mut ffi::GstRTSPContext,
963 f: glib::ffi::gpointer,
964 ) -> gst_rtsp::ffi::GstRTSPStatusCode {
965 let f: &F = &*(f as *const F);
966 f(
967 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
968 &from_glib_borrow(ctx),
969 )
970 .into_glib()
971 }
972 unsafe {
973 let f: Box_<F> = Box_::new(f);
974 connect_raw(
975 self.as_ptr() as *mut _,
976 c"pre-pause-request".as_ptr() as *const _,
977 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
978 pre_pause_request_trampoline::<Self, F> as *const (),
979 )),
980 Box_::into_raw(f),
981 )
982 }
983 }
984
985 #[doc(alias = "pre-play-request")]
993 fn connect_pre_play_request<
994 F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
995 >(
996 &self,
997 f: F,
998 ) -> SignalHandlerId {
999 unsafe extern "C" fn pre_play_request_trampoline<
1000 P: IsA<RTSPClient>,
1001 F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
1002 >(
1003 this: *mut ffi::GstRTSPClient,
1004 ctx: *mut ffi::GstRTSPContext,
1005 f: glib::ffi::gpointer,
1006 ) -> gst_rtsp::ffi::GstRTSPStatusCode {
1007 let f: &F = &*(f as *const F);
1008 f(
1009 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
1010 &from_glib_borrow(ctx),
1011 )
1012 .into_glib()
1013 }
1014 unsafe {
1015 let f: Box_<F> = Box_::new(f);
1016 connect_raw(
1017 self.as_ptr() as *mut _,
1018 c"pre-play-request".as_ptr() as *const _,
1019 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1020 pre_play_request_trampoline::<Self, F> as *const (),
1021 )),
1022 Box_::into_raw(f),
1023 )
1024 }
1025 }
1026
1027 #[doc(alias = "pre-record-request")]
1035 fn connect_pre_record_request<
1036 F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
1037 >(
1038 &self,
1039 f: F,
1040 ) -> SignalHandlerId {
1041 unsafe extern "C" fn pre_record_request_trampoline<
1042 P: IsA<RTSPClient>,
1043 F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
1044 >(
1045 this: *mut ffi::GstRTSPClient,
1046 ctx: *mut ffi::GstRTSPContext,
1047 f: glib::ffi::gpointer,
1048 ) -> gst_rtsp::ffi::GstRTSPStatusCode {
1049 let f: &F = &*(f as *const F);
1050 f(
1051 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
1052 &from_glib_borrow(ctx),
1053 )
1054 .into_glib()
1055 }
1056 unsafe {
1057 let f: Box_<F> = Box_::new(f);
1058 connect_raw(
1059 self.as_ptr() as *mut _,
1060 c"pre-record-request".as_ptr() as *const _,
1061 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1062 pre_record_request_trampoline::<Self, F> as *const (),
1063 )),
1064 Box_::into_raw(f),
1065 )
1066 }
1067 }
1068
1069 #[doc(alias = "pre-set-parameter-request")]
1077 fn connect_pre_set_parameter_request<
1078 F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
1079 >(
1080 &self,
1081 f: F,
1082 ) -> SignalHandlerId {
1083 unsafe extern "C" fn pre_set_parameter_request_trampoline<
1084 P: IsA<RTSPClient>,
1085 F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
1086 >(
1087 this: *mut ffi::GstRTSPClient,
1088 ctx: *mut ffi::GstRTSPContext,
1089 f: glib::ffi::gpointer,
1090 ) -> gst_rtsp::ffi::GstRTSPStatusCode {
1091 let f: &F = &*(f as *const F);
1092 f(
1093 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
1094 &from_glib_borrow(ctx),
1095 )
1096 .into_glib()
1097 }
1098 unsafe {
1099 let f: Box_<F> = Box_::new(f);
1100 connect_raw(
1101 self.as_ptr() as *mut _,
1102 c"pre-set-parameter-request".as_ptr() as *const _,
1103 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1104 pre_set_parameter_request_trampoline::<Self, F> as *const (),
1105 )),
1106 Box_::into_raw(f),
1107 )
1108 }
1109 }
1110
1111 #[doc(alias = "pre-setup-request")]
1119 fn connect_pre_setup_request<
1120 F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
1121 >(
1122 &self,
1123 f: F,
1124 ) -> SignalHandlerId {
1125 unsafe extern "C" fn pre_setup_request_trampoline<
1126 P: IsA<RTSPClient>,
1127 F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
1128 >(
1129 this: *mut ffi::GstRTSPClient,
1130 ctx: *mut ffi::GstRTSPContext,
1131 f: glib::ffi::gpointer,
1132 ) -> gst_rtsp::ffi::GstRTSPStatusCode {
1133 let f: &F = &*(f as *const F);
1134 f(
1135 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
1136 &from_glib_borrow(ctx),
1137 )
1138 .into_glib()
1139 }
1140 unsafe {
1141 let f: Box_<F> = Box_::new(f);
1142 connect_raw(
1143 self.as_ptr() as *mut _,
1144 c"pre-setup-request".as_ptr() as *const _,
1145 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1146 pre_setup_request_trampoline::<Self, F> as *const (),
1147 )),
1148 Box_::into_raw(f),
1149 )
1150 }
1151 }
1152
1153 #[doc(alias = "pre-teardown-request")]
1161 fn connect_pre_teardown_request<
1162 F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
1163 >(
1164 &self,
1165 f: F,
1166 ) -> SignalHandlerId {
1167 unsafe extern "C" fn pre_teardown_request_trampoline<
1168 P: IsA<RTSPClient>,
1169 F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
1170 >(
1171 this: *mut ffi::GstRTSPClient,
1172 ctx: *mut ffi::GstRTSPContext,
1173 f: glib::ffi::gpointer,
1174 ) -> gst_rtsp::ffi::GstRTSPStatusCode {
1175 let f: &F = &*(f as *const F);
1176 f(
1177 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
1178 &from_glib_borrow(ctx),
1179 )
1180 .into_glib()
1181 }
1182 unsafe {
1183 let f: Box_<F> = Box_::new(f);
1184 connect_raw(
1185 self.as_ptr() as *mut _,
1186 c"pre-teardown-request".as_ptr() as *const _,
1187 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1188 pre_teardown_request_trampoline::<Self, F> as *const (),
1189 )),
1190 Box_::into_raw(f),
1191 )
1192 }
1193 }
1194
1195 #[doc(alias = "record-request")]
1198 fn connect_record_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
1199 &self,
1200 f: F,
1201 ) -> SignalHandlerId {
1202 unsafe extern "C" fn record_request_trampoline<
1203 P: IsA<RTSPClient>,
1204 F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
1205 >(
1206 this: *mut ffi::GstRTSPClient,
1207 ctx: *mut ffi::GstRTSPContext,
1208 f: glib::ffi::gpointer,
1209 ) {
1210 let f: &F = &*(f as *const F);
1211 f(
1212 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
1213 &from_glib_borrow(ctx),
1214 )
1215 }
1216 unsafe {
1217 let f: Box_<F> = Box_::new(f);
1218 connect_raw(
1219 self.as_ptr() as *mut _,
1220 c"record-request".as_ptr() as *const _,
1221 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1222 record_request_trampoline::<Self, F> as *const (),
1223 )),
1224 Box_::into_raw(f),
1225 )
1226 }
1227 }
1228
1229 #[doc(alias = "set-parameter-request")]
1237 fn connect_set_parameter_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
1238 &self,
1239 f: F,
1240 ) -> SignalHandlerId {
1241 unsafe extern "C" fn set_parameter_request_trampoline<
1242 P: IsA<RTSPClient>,
1243 F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
1244 >(
1245 this: *mut ffi::GstRTSPClient,
1246 ctx: *mut ffi::GstRTSPContext,
1247 f: glib::ffi::gpointer,
1248 ) {
1249 let f: &F = &*(f as *const F);
1250 f(
1251 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
1252 &from_glib_borrow(ctx),
1253 )
1254 }
1255 unsafe {
1256 let f: Box_<F> = Box_::new(f);
1257 connect_raw(
1258 self.as_ptr() as *mut _,
1259 c"set-parameter-request".as_ptr() as *const _,
1260 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1261 set_parameter_request_trampoline::<Self, F> as *const (),
1262 )),
1263 Box_::into_raw(f),
1264 )
1265 }
1266 }
1267
1268 #[doc(alias = "setup-request")]
1271 fn connect_setup_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
1272 &self,
1273 f: F,
1274 ) -> SignalHandlerId {
1275 unsafe extern "C" fn setup_request_trampoline<
1276 P: IsA<RTSPClient>,
1277 F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
1278 >(
1279 this: *mut ffi::GstRTSPClient,
1280 ctx: *mut ffi::GstRTSPContext,
1281 f: glib::ffi::gpointer,
1282 ) {
1283 let f: &F = &*(f as *const F);
1284 f(
1285 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
1286 &from_glib_borrow(ctx),
1287 )
1288 }
1289 unsafe {
1290 let f: Box_<F> = Box_::new(f);
1291 connect_raw(
1292 self.as_ptr() as *mut _,
1293 c"setup-request".as_ptr() as *const _,
1294 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1295 setup_request_trampoline::<Self, F> as *const (),
1296 )),
1297 Box_::into_raw(f),
1298 )
1299 }
1300 }
1301
1302 #[doc(alias = "teardown-request")]
1305 fn connect_teardown_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
1306 &self,
1307 f: F,
1308 ) -> SignalHandlerId {
1309 unsafe extern "C" fn teardown_request_trampoline<
1310 P: IsA<RTSPClient>,
1311 F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
1312 >(
1313 this: *mut ffi::GstRTSPClient,
1314 ctx: *mut ffi::GstRTSPContext,
1315 f: glib::ffi::gpointer,
1316 ) {
1317 let f: &F = &*(f as *const F);
1318 f(
1319 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
1320 &from_glib_borrow(ctx),
1321 )
1322 }
1323 unsafe {
1324 let f: Box_<F> = Box_::new(f);
1325 connect_raw(
1326 self.as_ptr() as *mut _,
1327 c"teardown-request".as_ptr() as *const _,
1328 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1329 teardown_request_trampoline::<Self, F> as *const (),
1330 )),
1331 Box_::into_raw(f),
1332 )
1333 }
1334 }
1335
1336 #[doc(alias = "drop-backlog")]
1337 fn connect_drop_backlog_notify<F: Fn(&Self) + Send + Sync + 'static>(
1338 &self,
1339 f: F,
1340 ) -> SignalHandlerId {
1341 unsafe extern "C" fn notify_drop_backlog_trampoline<
1342 P: IsA<RTSPClient>,
1343 F: Fn(&P) + Send + Sync + 'static,
1344 >(
1345 this: *mut ffi::GstRTSPClient,
1346 _param_spec: glib::ffi::gpointer,
1347 f: glib::ffi::gpointer,
1348 ) {
1349 let f: &F = &*(f as *const F);
1350 f(RTSPClient::from_glib_borrow(this).unsafe_cast_ref())
1351 }
1352 unsafe {
1353 let f: Box_<F> = Box_::new(f);
1354 connect_raw(
1355 self.as_ptr() as *mut _,
1356 c"notify::drop-backlog".as_ptr() as *const _,
1357 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1358 notify_drop_backlog_trampoline::<Self, F> as *const (),
1359 )),
1360 Box_::into_raw(f),
1361 )
1362 }
1363 }
1364
1365 #[doc(alias = "mount-points")]
1366 fn connect_mount_points_notify<F: Fn(&Self) + Send + Sync + 'static>(
1367 &self,
1368 f: F,
1369 ) -> SignalHandlerId {
1370 unsafe extern "C" fn notify_mount_points_trampoline<
1371 P: IsA<RTSPClient>,
1372 F: Fn(&P) + Send + Sync + 'static,
1373 >(
1374 this: *mut ffi::GstRTSPClient,
1375 _param_spec: glib::ffi::gpointer,
1376 f: glib::ffi::gpointer,
1377 ) {
1378 let f: &F = &*(f as *const F);
1379 f(RTSPClient::from_glib_borrow(this).unsafe_cast_ref())
1380 }
1381 unsafe {
1382 let f: Box_<F> = Box_::new(f);
1383 connect_raw(
1384 self.as_ptr() as *mut _,
1385 c"notify::mount-points".as_ptr() as *const _,
1386 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1387 notify_mount_points_trampoline::<Self, F> as *const (),
1388 )),
1389 Box_::into_raw(f),
1390 )
1391 }
1392 }
1393
1394 #[doc(alias = "post-session-timeout")]
1395 fn connect_post_session_timeout_notify<F: Fn(&Self) + Send + Sync + 'static>(
1396 &self,
1397 f: F,
1398 ) -> SignalHandlerId {
1399 unsafe extern "C" fn notify_post_session_timeout_trampoline<
1400 P: IsA<RTSPClient>,
1401 F: Fn(&P) + Send + Sync + 'static,
1402 >(
1403 this: *mut ffi::GstRTSPClient,
1404 _param_spec: glib::ffi::gpointer,
1405 f: glib::ffi::gpointer,
1406 ) {
1407 let f: &F = &*(f as *const F);
1408 f(RTSPClient::from_glib_borrow(this).unsafe_cast_ref())
1409 }
1410 unsafe {
1411 let f: Box_<F> = Box_::new(f);
1412 connect_raw(
1413 self.as_ptr() as *mut _,
1414 c"notify::post-session-timeout".as_ptr() as *const _,
1415 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1416 notify_post_session_timeout_trampoline::<Self, F> as *const (),
1417 )),
1418 Box_::into_raw(f),
1419 )
1420 }
1421 }
1422
1423 #[doc(alias = "session-pool")]
1424 fn connect_session_pool_notify<F: Fn(&Self) + Send + Sync + 'static>(
1425 &self,
1426 f: F,
1427 ) -> SignalHandlerId {
1428 unsafe extern "C" fn notify_session_pool_trampoline<
1429 P: IsA<RTSPClient>,
1430 F: Fn(&P) + Send + Sync + 'static,
1431 >(
1432 this: *mut ffi::GstRTSPClient,
1433 _param_spec: glib::ffi::gpointer,
1434 f: glib::ffi::gpointer,
1435 ) {
1436 let f: &F = &*(f as *const F);
1437 f(RTSPClient::from_glib_borrow(this).unsafe_cast_ref())
1438 }
1439 unsafe {
1440 let f: Box_<F> = Box_::new(f);
1441 connect_raw(
1442 self.as_ptr() as *mut _,
1443 c"notify::session-pool".as_ptr() as *const _,
1444 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1445 notify_session_pool_trampoline::<Self, F> as *const (),
1446 )),
1447 Box_::into_raw(f),
1448 )
1449 }
1450 }
1451}
1452
1453impl<O: IsA<RTSPClient>> RTSPClientExt for O {}