1use crate::{
7 ffi, RTSPAddressPool, RTSPMediaStatus, RTSPPublishClockMode, RTSPStream, RTSPStreamTransport,
8 RTSPSuspendMode, RTSPThread, RTSPTransportMode,
9};
10use glib::{
11 object::ObjectType as _,
12 prelude::*,
13 signal::{connect_raw, SignalHandlerId},
14 translate::*,
15};
16use std::boxed::Box as Box_;
17
18glib::wrapper! {
19 #[doc(alias = "GstRTSPMedia")]
146 pub struct RTSPMedia(Object<ffi::GstRTSPMedia, ffi::GstRTSPMediaClass>);
147
148 match fn {
149 type_ => || ffi::gst_rtsp_media_get_type(),
150 }
151}
152
153impl RTSPMedia {
154 pub const NONE: Option<&'static RTSPMedia> = None;
155
156 #[doc(alias = "gst_rtsp_media_new")]
169 pub fn new(element: impl IsA<gst::Element>) -> RTSPMedia {
170 assert_initialized_main_thread!();
171 unsafe { from_glib_full(ffi::gst_rtsp_media_new(element.upcast().into_glib_ptr())) }
172 }
173}
174
175unsafe impl Send for RTSPMedia {}
176unsafe impl Sync for RTSPMedia {}
177
178pub trait RTSPMediaExt: IsA<RTSPMedia> + 'static {
184 #[cfg(feature = "v1_24")]
195 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
196 #[doc(alias = "gst_rtsp_media_can_be_shared")]
197 fn can_be_shared(&self) -> bool {
198 unsafe {
199 from_glib(ffi::gst_rtsp_media_can_be_shared(
200 self.as_ref().to_glib_none().0,
201 ))
202 }
203 }
204
205 #[doc(alias = "gst_rtsp_media_collect_streams")]
214 fn collect_streams(&self) {
215 unsafe {
216 ffi::gst_rtsp_media_collect_streams(self.as_ref().to_glib_none().0);
217 }
218 }
219
220 #[doc(alias = "gst_rtsp_media_create_stream")]
237 fn create_stream(
238 &self,
239 payloader: &impl IsA<gst::Element>,
240 pad: &impl IsA<gst::Pad>,
241 ) -> RTSPStream {
242 unsafe {
243 from_glib_none(ffi::gst_rtsp_media_create_stream(
244 self.as_ref().to_glib_none().0,
245 payloader.as_ref().to_glib_none().0,
246 pad.as_ref().to_glib_none().0,
247 ))
248 }
249 }
250
251 #[doc(alias = "gst_rtsp_media_find_stream")]
261 fn find_stream(&self, control: &str) -> Option<RTSPStream> {
262 unsafe {
263 from_glib_none(ffi::gst_rtsp_media_find_stream(
264 self.as_ref().to_glib_none().0,
265 control.to_glib_none().0,
266 ))
267 }
268 }
269
270 #[doc(alias = "gst_rtsp_media_get_address_pool")]
277 #[doc(alias = "get_address_pool")]
278 fn address_pool(&self) -> Option<RTSPAddressPool> {
279 unsafe {
280 from_glib_full(ffi::gst_rtsp_media_get_address_pool(
281 self.as_ref().to_glib_none().0,
282 ))
283 }
284 }
285
286 #[doc(alias = "gst_rtsp_media_get_base_time")]
294 #[doc(alias = "get_base_time")]
295 fn base_time(&self) -> Option<gst::ClockTime> {
296 unsafe {
297 from_glib(ffi::gst_rtsp_media_get_base_time(
298 self.as_ref().to_glib_none().0,
299 ))
300 }
301 }
302
303 #[doc(alias = "gst_rtsp_media_get_buffer_size")]
309 #[doc(alias = "get_buffer_size")]
310 #[doc(alias = "buffer-size")]
311 fn buffer_size(&self) -> u32 {
312 unsafe { ffi::gst_rtsp_media_get_buffer_size(self.as_ref().to_glib_none().0) }
313 }
314
315 #[doc(alias = "gst_rtsp_media_get_clock")]
323 #[doc(alias = "get_clock")]
324 fn clock(&self) -> Option<gst::Clock> {
325 unsafe {
326 from_glib_full(ffi::gst_rtsp_media_get_clock(
327 self.as_ref().to_glib_none().0,
328 ))
329 }
330 }
331
332 #[cfg(feature = "v1_16")]
337 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
338 #[doc(alias = "gst_rtsp_media_get_do_retransmission")]
339 #[doc(alias = "get_do_retransmission")]
340 fn does_retransmission(&self) -> bool {
341 unsafe {
342 from_glib(ffi::gst_rtsp_media_get_do_retransmission(
343 self.as_ref().to_glib_none().0,
344 ))
345 }
346 }
347
348 #[cfg(feature = "v1_18")]
354 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
355 #[doc(alias = "gst_rtsp_media_get_dscp_qos")]
356 #[doc(alias = "get_dscp_qos")]
357 #[doc(alias = "dscp-qos")]
358 fn dscp_qos(&self) -> i32 {
359 unsafe { ffi::gst_rtsp_media_get_dscp_qos(self.as_ref().to_glib_none().0) }
360 }
361
362 #[doc(alias = "gst_rtsp_media_get_element")]
368 #[doc(alias = "get_element")]
369 fn element(&self) -> gst::Element {
370 unsafe {
371 from_glib_full(ffi::gst_rtsp_media_get_element(
372 self.as_ref().to_glib_none().0,
373 ))
374 }
375 }
376
377 #[cfg(feature = "v1_24")]
383 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
384 #[doc(alias = "gst_rtsp_media_get_ensure_keyunit_on_start")]
385 #[doc(alias = "get_ensure_keyunit_on_start")]
386 #[doc(alias = "ensure-keyunit-on-start")]
387 fn is_ensure_keyunit_on_start(&self) -> bool {
388 unsafe {
389 from_glib(ffi::gst_rtsp_media_get_ensure_keyunit_on_start(
390 self.as_ref().to_glib_none().0,
391 ))
392 }
393 }
394
395 #[cfg(feature = "v1_24")]
401 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
402 #[doc(alias = "gst_rtsp_media_get_ensure_keyunit_on_start_timeout")]
403 #[doc(alias = "get_ensure_keyunit_on_start_timeout")]
404 #[doc(alias = "ensure-keyunit-on-start-timeout")]
405 fn ensure_keyunit_on_start_timeout(&self) -> u32 {
406 unsafe {
407 ffi::gst_rtsp_media_get_ensure_keyunit_on_start_timeout(self.as_ref().to_glib_none().0)
408 }
409 }
410
411 #[doc(alias = "gst_rtsp_media_get_latency")]
417 #[doc(alias = "get_latency")]
418 fn latency(&self) -> u32 {
419 unsafe { ffi::gst_rtsp_media_get_latency(self.as_ref().to_glib_none().0) }
420 }
421
422 #[cfg(feature = "v1_16")]
428 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
429 #[doc(alias = "gst_rtsp_media_get_max_mcast_ttl")]
430 #[doc(alias = "get_max_mcast_ttl")]
431 #[doc(alias = "max-mcast-ttl")]
432 fn max_mcast_ttl(&self) -> u32 {
433 unsafe { ffi::gst_rtsp_media_get_max_mcast_ttl(self.as_ref().to_glib_none().0) }
434 }
435
436 #[doc(alias = "gst_rtsp_media_get_multicast_iface")]
443 #[doc(alias = "get_multicast_iface")]
444 fn multicast_iface(&self) -> Option<glib::GString> {
445 unsafe {
446 from_glib_full(ffi::gst_rtsp_media_get_multicast_iface(
447 self.as_ref().to_glib_none().0,
448 ))
449 }
450 }
451
452 #[doc(alias = "gst_rtsp_media_get_profiles")]
464 #[doc(alias = "get_profiles")]
465 fn profiles(&self) -> gst_rtsp::RTSPProfile {
466 unsafe {
467 from_glib(ffi::gst_rtsp_media_get_profiles(
468 self.as_ref().to_glib_none().0,
469 ))
470 }
471 }
472
473 #[doc(alias = "gst_rtsp_media_get_protocols")]
479 #[doc(alias = "get_protocols")]
480 fn protocols(&self) -> gst_rtsp::RTSPLowerTrans {
481 unsafe {
482 from_glib(ffi::gst_rtsp_media_get_protocols(
483 self.as_ref().to_glib_none().0,
484 ))
485 }
486 }
487
488 #[doc(alias = "gst_rtsp_media_get_publish_clock_mode")]
494 #[doc(alias = "get_publish_clock_mode")]
495 fn publish_clock_mode(&self) -> RTSPPublishClockMode {
496 unsafe {
497 from_glib(ffi::gst_rtsp_media_get_publish_clock_mode(
498 self.as_ref().to_glib_none().0,
499 ))
500 }
501 }
502
503 #[doc(alias = "gst_rtsp_media_get_range_string")]
514 #[doc(alias = "get_range_string")]
515 fn range_string(&self, play: bool, unit: gst_rtsp::RTSPRangeUnit) -> Option<glib::GString> {
516 unsafe {
517 from_glib_full(ffi::gst_rtsp_media_get_range_string(
518 self.as_ref().to_glib_none().0,
519 play.into_glib(),
520 unit.into_glib(),
521 ))
522 }
523 }
524
525 #[cfg(feature = "v1_18")]
531 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
532 #[doc(alias = "gst_rtsp_media_get_rate_control")]
533 #[doc(alias = "get_rate_control")]
534 fn is_rate_control(&self) -> bool {
535 unsafe {
536 from_glib(ffi::gst_rtsp_media_get_rate_control(
537 self.as_ref().to_glib_none().0,
538 ))
539 }
540 }
541
542 #[cfg(feature = "v1_18")]
556 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
557 #[doc(alias = "gst_rtsp_media_get_rates")]
558 #[doc(alias = "get_rates")]
559 fn rates(&self) -> Option<(f64, f64)> {
560 unsafe {
561 let mut rate = std::mem::MaybeUninit::uninit();
562 let mut applied_rate = std::mem::MaybeUninit::uninit();
563 let ret = from_glib(ffi::gst_rtsp_media_get_rates(
564 self.as_ref().to_glib_none().0,
565 rate.as_mut_ptr(),
566 applied_rate.as_mut_ptr(),
567 ));
568 if ret {
569 Some((rate.assume_init(), applied_rate.assume_init()))
570 } else {
571 None
572 }
573 }
574 }
575
576 #[doc(alias = "gst_rtsp_media_get_retransmission_time")]
582 #[doc(alias = "get_retransmission_time")]
583 fn retransmission_time(&self) -> Option<gst::ClockTime> {
584 unsafe {
585 from_glib(ffi::gst_rtsp_media_get_retransmission_time(
586 self.as_ref().to_glib_none().0,
587 ))
588 }
589 }
590
591 #[doc(alias = "gst_rtsp_media_get_status")]
598 #[doc(alias = "get_status")]
599 fn status(&self) -> RTSPMediaStatus {
600 unsafe {
601 from_glib(ffi::gst_rtsp_media_get_status(
602 self.as_ref().to_glib_none().0,
603 ))
604 }
605 }
606
607 #[doc(alias = "gst_rtsp_media_get_stream")]
616 #[doc(alias = "get_stream")]
617 fn stream(&self, idx: u32) -> Option<RTSPStream> {
618 unsafe {
619 from_glib_none(ffi::gst_rtsp_media_get_stream(
620 self.as_ref().to_glib_none().0,
621 idx,
622 ))
623 }
624 }
625
626 #[doc(alias = "gst_rtsp_media_get_suspend_mode")]
632 #[doc(alias = "get_suspend_mode")]
633 #[doc(alias = "suspend-mode")]
634 fn suspend_mode(&self) -> RTSPSuspendMode {
635 unsafe {
636 from_glib(ffi::gst_rtsp_media_get_suspend_mode(
637 self.as_ref().to_glib_none().0,
638 ))
639 }
640 }
641
642 #[doc(alias = "gst_rtsp_media_get_time_provider")]
653 #[doc(alias = "get_time_provider")]
654 #[doc(alias = "time-provider")]
655 fn time_provider(&self, address: Option<&str>, port: u16) -> Option<gst_net::NetTimeProvider> {
656 unsafe {
657 from_glib_full(ffi::gst_rtsp_media_get_time_provider(
658 self.as_ref().to_glib_none().0,
659 address.to_glib_none().0,
660 port,
661 ))
662 }
663 }
664
665 #[doc(alias = "gst_rtsp_media_get_transport_mode")]
671 #[doc(alias = "get_transport_mode")]
672 #[doc(alias = "transport-mode")]
673 fn transport_mode(&self) -> RTSPTransportMode {
674 unsafe {
675 from_glib(ffi::gst_rtsp_media_get_transport_mode(
676 self.as_ref().to_glib_none().0,
677 ))
678 }
679 }
680
681 #[cfg(feature = "v1_18")]
692 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
693 #[doc(alias = "gst_rtsp_media_has_completed_sender")]
694 fn has_completed_sender(&self) -> bool {
695 unsafe {
696 from_glib(ffi::gst_rtsp_media_has_completed_sender(
697 self.as_ref().to_glib_none().0,
698 ))
699 }
700 }
701
702 #[cfg(feature = "v1_16")]
708 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
709 #[doc(alias = "gst_rtsp_media_is_bind_mcast_address")]
710 #[doc(alias = "bind-mcast-address")]
711 fn is_bind_mcast_address(&self) -> bool {
712 unsafe {
713 from_glib(ffi::gst_rtsp_media_is_bind_mcast_address(
714 self.as_ref().to_glib_none().0,
715 ))
716 }
717 }
718
719 #[doc(alias = "gst_rtsp_media_is_eos_shutdown")]
726 #[doc(alias = "eos-shutdown")]
727 fn is_eos_shutdown(&self) -> bool {
728 unsafe {
729 from_glib(ffi::gst_rtsp_media_is_eos_shutdown(
730 self.as_ref().to_glib_none().0,
731 ))
732 }
733 }
734
735 #[cfg(feature = "v1_18")]
740 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
741 #[doc(alias = "gst_rtsp_media_is_receive_only")]
742 fn is_receive_only(&self) -> bool {
743 unsafe {
744 from_glib(ffi::gst_rtsp_media_is_receive_only(
745 self.as_ref().to_glib_none().0,
746 ))
747 }
748 }
749
750 #[doc(alias = "gst_rtsp_media_is_reusable")]
756 #[doc(alias = "reusable")]
757 fn is_reusable(&self) -> bool {
758 unsafe {
759 from_glib(ffi::gst_rtsp_media_is_reusable(
760 self.as_ref().to_glib_none().0,
761 ))
762 }
763 }
764
765 #[doc(alias = "gst_rtsp_media_is_shared")]
776 #[doc(alias = "shared")]
777 fn is_shared(&self) -> bool {
778 unsafe {
779 from_glib(ffi::gst_rtsp_media_is_shared(
780 self.as_ref().to_glib_none().0,
781 ))
782 }
783 }
784
785 #[doc(alias = "gst_rtsp_media_is_stop_on_disconnect")]
793 #[doc(alias = "stop-on-disconnect")]
794 fn is_stop_on_disconnect(&self) -> bool {
795 unsafe {
796 from_glib(ffi::gst_rtsp_media_is_stop_on_disconnect(
797 self.as_ref().to_glib_none().0,
798 ))
799 }
800 }
801
802 #[doc(alias = "gst_rtsp_media_is_time_provider")]
810 #[doc(alias = "time-provider")]
811 fn is_time_provider(&self) -> bool {
812 unsafe {
813 from_glib(ffi::gst_rtsp_media_is_time_provider(
814 self.as_ref().to_glib_none().0,
815 ))
816 }
817 }
818
819 #[cfg(feature = "v1_18")]
829 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
830 #[doc(alias = "gst_rtsp_media_lock")]
831 fn lock(&self) {
832 unsafe {
833 ffi::gst_rtsp_media_lock(self.as_ref().to_glib_none().0);
834 }
835 }
836
837 #[doc(alias = "gst_rtsp_media_n_streams")]
843 fn n_streams(&self) -> u32 {
844 unsafe { ffi::gst_rtsp_media_n_streams(self.as_ref().to_glib_none().0) }
845 }
846
847 #[doc(alias = "gst_rtsp_media_prepare")]
861 fn prepare(&self, thread: Option<RTSPThread>) -> Result<(), glib::error::BoolError> {
862 unsafe {
863 glib::result_from_gboolean!(
864 ffi::gst_rtsp_media_prepare(self.as_ref().to_glib_none().0, thread.into_glib_ptr()),
865 "Failed to prepare media"
866 )
867 }
868 }
869
870 #[doc(alias = "gst_rtsp_media_set_address_pool")]
898 fn set_address_pool(&self, pool: Option<&impl IsA<RTSPAddressPool>>) {
899 unsafe {
900 ffi::gst_rtsp_media_set_address_pool(
901 self.as_ref().to_glib_none().0,
902 pool.map(|p| p.as_ref()).to_glib_none().0,
903 );
904 }
905 }
906
907 #[cfg(feature = "v1_16")]
912 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
913 #[doc(alias = "gst_rtsp_media_set_bind_mcast_address")]
914 #[doc(alias = "bind-mcast-address")]
915 fn set_bind_mcast_address(&self, bind_mcast_addr: bool) {
916 unsafe {
917 ffi::gst_rtsp_media_set_bind_mcast_address(
918 self.as_ref().to_glib_none().0,
919 bind_mcast_addr.into_glib(),
920 );
921 }
922 }
923
924 #[doc(alias = "gst_rtsp_media_set_buffer_size")]
928 #[doc(alias = "buffer-size")]
929 fn set_buffer_size(&self, size: u32) {
930 unsafe {
931 ffi::gst_rtsp_media_set_buffer_size(self.as_ref().to_glib_none().0, size);
932 }
933 }
934
935 #[doc(alias = "gst_rtsp_media_set_clock")]
939 #[doc(alias = "clock")]
940 fn set_clock(&self, clock: Option<&impl IsA<gst::Clock>>) {
941 unsafe {
942 ffi::gst_rtsp_media_set_clock(
943 self.as_ref().to_glib_none().0,
944 clock.map(|p| p.as_ref()).to_glib_none().0,
945 );
946 }
947 }
948
949 #[cfg(feature = "v1_16")]
951 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
952 #[doc(alias = "gst_rtsp_media_set_do_retransmission")]
953 fn set_do_retransmission(&self, do_retransmission: bool) {
954 unsafe {
955 ffi::gst_rtsp_media_set_do_retransmission(
956 self.as_ref().to_glib_none().0,
957 do_retransmission.into_glib(),
958 );
959 }
960 }
961
962 #[cfg(feature = "v1_18")]
966 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
967 #[doc(alias = "gst_rtsp_media_set_dscp_qos")]
968 #[doc(alias = "dscp-qos")]
969 fn set_dscp_qos(&self, dscp_qos: i32) {
970 unsafe {
971 ffi::gst_rtsp_media_set_dscp_qos(self.as_ref().to_glib_none().0, dscp_qos);
972 }
973 }
974
975 #[cfg(feature = "v1_24")]
983 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
984 #[doc(alias = "gst_rtsp_media_set_ensure_keyunit_on_start")]
985 #[doc(alias = "ensure-keyunit-on-start")]
986 fn set_ensure_keyunit_on_start(&self, ensure_keyunit_on_start: bool) {
987 unsafe {
988 ffi::gst_rtsp_media_set_ensure_keyunit_on_start(
989 self.as_ref().to_glib_none().0,
990 ensure_keyunit_on_start.into_glib(),
991 );
992 }
993 }
994
995 #[cfg(feature = "v1_24")]
1003 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1004 #[doc(alias = "gst_rtsp_media_set_ensure_keyunit_on_start_timeout")]
1005 #[doc(alias = "ensure-keyunit-on-start-timeout")]
1006 fn set_ensure_keyunit_on_start_timeout(&self, timeout: u32) {
1007 unsafe {
1008 ffi::gst_rtsp_media_set_ensure_keyunit_on_start_timeout(
1009 self.as_ref().to_glib_none().0,
1010 timeout,
1011 );
1012 }
1013 }
1014
1015 #[doc(alias = "gst_rtsp_media_set_eos_shutdown")]
1020 #[doc(alias = "eos-shutdown")]
1021 fn set_eos_shutdown(&self, eos_shutdown: bool) {
1022 unsafe {
1023 ffi::gst_rtsp_media_set_eos_shutdown(
1024 self.as_ref().to_glib_none().0,
1025 eos_shutdown.into_glib(),
1026 );
1027 }
1028 }
1029
1030 #[doc(alias = "gst_rtsp_media_set_latency")]
1034 #[doc(alias = "latency")]
1035 fn set_latency(&self, latency: u32) {
1036 unsafe {
1037 ffi::gst_rtsp_media_set_latency(self.as_ref().to_glib_none().0, latency);
1038 }
1039 }
1040
1041 #[cfg(feature = "v1_16")]
1049 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
1050 #[doc(alias = "gst_rtsp_media_set_max_mcast_ttl")]
1051 #[doc(alias = "max-mcast-ttl")]
1052 fn set_max_mcast_ttl(&self, ttl: u32) -> bool {
1053 unsafe {
1054 from_glib(ffi::gst_rtsp_media_set_max_mcast_ttl(
1055 self.as_ref().to_glib_none().0,
1056 ttl,
1057 ))
1058 }
1059 }
1060
1061 #[doc(alias = "gst_rtsp_media_set_multicast_iface")]
1065 fn set_multicast_iface(&self, multicast_iface: Option<&str>) {
1066 unsafe {
1067 ffi::gst_rtsp_media_set_multicast_iface(
1068 self.as_ref().to_glib_none().0,
1069 multicast_iface.to_glib_none().0,
1070 );
1071 }
1072 }
1073
1074 #[doc(alias = "gst_rtsp_media_set_pipeline_state")]
1083 fn set_pipeline_state(&self, state: gst::State) {
1084 unsafe {
1085 ffi::gst_rtsp_media_set_pipeline_state(
1086 self.as_ref().to_glib_none().0,
1087 state.into_glib(),
1088 );
1089 }
1090 }
1091
1092 #[doc(alias = "gst_rtsp_media_set_profiles")]
1096 #[doc(alias = "profiles")]
1097 fn set_profiles(&self, profiles: gst_rtsp::RTSPProfile) {
1098 unsafe {
1099 ffi::gst_rtsp_media_set_profiles(self.as_ref().to_glib_none().0, profiles.into_glib());
1100 }
1101 }
1102
1103 #[doc(alias = "gst_rtsp_media_set_protocols")]
1107 #[doc(alias = "protocols")]
1108 fn set_protocols(&self, protocols: gst_rtsp::RTSPLowerTrans) {
1109 unsafe {
1110 ffi::gst_rtsp_media_set_protocols(
1111 self.as_ref().to_glib_none().0,
1112 protocols.into_glib(),
1113 );
1114 }
1115 }
1116
1117 #[doc(alias = "gst_rtsp_media_set_publish_clock_mode")]
1121 fn set_publish_clock_mode(&self, mode: RTSPPublishClockMode) {
1122 unsafe {
1123 ffi::gst_rtsp_media_set_publish_clock_mode(
1124 self.as_ref().to_glib_none().0,
1125 mode.into_glib(),
1126 );
1127 }
1128 }
1129
1130 #[cfg(feature = "v1_18")]
1133 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1134 #[doc(alias = "gst_rtsp_media_set_rate_control")]
1135 fn set_rate_control(&self, enabled: bool) {
1136 unsafe {
1137 ffi::gst_rtsp_media_set_rate_control(
1138 self.as_ref().to_glib_none().0,
1139 enabled.into_glib(),
1140 );
1141 }
1142 }
1143
1144 #[doc(alias = "gst_rtsp_media_set_retransmission_time")]
1148 fn set_retransmission_time(&self, time: impl Into<Option<gst::ClockTime>>) {
1149 unsafe {
1150 ffi::gst_rtsp_media_set_retransmission_time(
1151 self.as_ref().to_glib_none().0,
1152 time.into().into_glib(),
1153 );
1154 }
1155 }
1156
1157 #[doc(alias = "gst_rtsp_media_set_reusable")]
1162 #[doc(alias = "reusable")]
1163 fn set_reusable(&self, reusable: bool) {
1164 unsafe {
1165 ffi::gst_rtsp_media_set_reusable(self.as_ref().to_glib_none().0, reusable.into_glib());
1166 }
1167 }
1168
1169 #[doc(alias = "gst_rtsp_media_set_shared")]
1175 #[doc(alias = "shared")]
1176 fn set_shared(&self, shared: bool) {
1177 unsafe {
1178 ffi::gst_rtsp_media_set_shared(self.as_ref().to_glib_none().0, shared.into_glib());
1179 }
1180 }
1181
1182 #[doc(alias = "gst_rtsp_media_set_state")]
1195 fn set_state(&self, state: gst::State, transports: &[RTSPStreamTransport]) -> bool {
1196 unsafe {
1197 from_glib(ffi::gst_rtsp_media_set_state(
1198 self.as_ref().to_glib_none().0,
1199 state.into_glib(),
1200 transports.to_glib_none().0,
1201 ))
1202 }
1203 }
1204
1205 #[doc(alias = "gst_rtsp_media_set_stop_on_disconnect")]
1210 #[doc(alias = "stop-on-disconnect")]
1211 fn set_stop_on_disconnect(&self, stop_on_disconnect: bool) {
1212 unsafe {
1213 ffi::gst_rtsp_media_set_stop_on_disconnect(
1214 self.as_ref().to_glib_none().0,
1215 stop_on_disconnect.into_glib(),
1216 );
1217 }
1218 }
1219
1220 #[doc(alias = "gst_rtsp_media_set_suspend_mode")]
1227 #[doc(alias = "suspend-mode")]
1228 fn set_suspend_mode(&self, mode: RTSPSuspendMode) {
1229 unsafe {
1230 ffi::gst_rtsp_media_set_suspend_mode(self.as_ref().to_glib_none().0, mode.into_glib());
1231 }
1232 }
1233
1234 #[doc(alias = "gst_rtsp_media_set_transport_mode")]
1238 #[doc(alias = "transport-mode")]
1239 fn set_transport_mode(&self, mode: RTSPTransportMode) {
1240 unsafe {
1241 ffi::gst_rtsp_media_set_transport_mode(
1242 self.as_ref().to_glib_none().0,
1243 mode.into_glib(),
1244 );
1245 }
1246 }
1247
1248 #[doc(alias = "gst_rtsp_media_suspend")]
1263 fn suspend(&self) -> Result<(), glib::error::BoolError> {
1264 unsafe {
1265 glib::result_from_gboolean!(
1266 ffi::gst_rtsp_media_suspend(self.as_ref().to_glib_none().0),
1267 "Failed to suspend media"
1268 )
1269 }
1270 }
1271
1272 #[cfg(feature = "v1_18")]
1274 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1275 #[doc(alias = "gst_rtsp_media_unlock")]
1276 fn unlock(&self) {
1277 unsafe {
1278 ffi::gst_rtsp_media_unlock(self.as_ref().to_glib_none().0);
1279 }
1280 }
1281
1282 #[doc(alias = "gst_rtsp_media_unprepare")]
1290 fn unprepare(&self) -> Result<(), glib::error::BoolError> {
1291 unsafe {
1292 glib::result_from_gboolean!(
1293 ffi::gst_rtsp_media_unprepare(self.as_ref().to_glib_none().0),
1294 "Failed to unprepare media"
1295 )
1296 }
1297 }
1298
1299 #[doc(alias = "gst_rtsp_media_unsuspend")]
1306 fn unsuspend(&self) -> Result<(), glib::error::BoolError> {
1307 unsafe {
1308 glib::result_from_gboolean!(
1309 ffi::gst_rtsp_media_unsuspend(self.as_ref().to_glib_none().0),
1310 "Failed to unsuspend media"
1311 )
1312 }
1313 }
1314
1315 #[doc(alias = "gst_rtsp_media_use_time_provider")]
1319 fn use_time_provider(&self, time_provider: bool) {
1320 unsafe {
1321 ffi::gst_rtsp_media_use_time_provider(
1322 self.as_ref().to_glib_none().0,
1323 time_provider.into_glib(),
1324 );
1325 }
1326 }
1327
1328 #[cfg(not(feature = "v1_16"))]
1329 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
1330 #[doc(alias = "bind-mcast-address")]
1331 fn is_bind_mcast_address(&self) -> bool {
1332 ObjectExt::property(self.as_ref(), "bind-mcast-address")
1333 }
1334
1335 #[cfg(not(feature = "v1_16"))]
1336 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
1337 #[doc(alias = "bind-mcast-address")]
1338 fn set_bind_mcast_address(&self, bind_mcast_address: bool) {
1339 ObjectExt::set_property(self.as_ref(), "bind-mcast-address", bind_mcast_address)
1340 }
1341
1342 #[cfg(not(feature = "v1_18"))]
1343 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_18"))))]
1344 #[doc(alias = "dscp-qos")]
1345 fn dscp_qos(&self) -> i32 {
1346 ObjectExt::property(self.as_ref(), "dscp-qos")
1347 }
1348
1349 #[cfg(not(feature = "v1_18"))]
1350 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_18"))))]
1351 #[doc(alias = "dscp-qos")]
1352 fn set_dscp_qos(&self, dscp_qos: i32) {
1353 ObjectExt::set_property(self.as_ref(), "dscp-qos", dscp_qos)
1354 }
1355
1356 #[cfg(not(feature = "v1_16"))]
1357 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
1358 #[doc(alias = "max-mcast-ttl")]
1359 fn max_mcast_ttl(&self) -> u32 {
1360 ObjectExt::property(self.as_ref(), "max-mcast-ttl")
1361 }
1362
1363 #[cfg(not(feature = "v1_16"))]
1364 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
1365 #[doc(alias = "max-mcast-ttl")]
1366 fn set_max_mcast_ttl(&self, max_mcast_ttl: u32) {
1367 ObjectExt::set_property(self.as_ref(), "max-mcast-ttl", max_mcast_ttl)
1368 }
1369
1370 #[doc(alias = "time-provider")]
1371 fn set_time_provider(&self, time_provider: bool) {
1372 ObjectExt::set_property(self.as_ref(), "time-provider", time_provider)
1373 }
1374
1375 #[cfg(feature = "v1_22")]
1383 #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
1384 #[doc(alias = "handle-message")]
1385 fn connect_handle_message<F: Fn(&Self, &gst::Message) -> bool + Send + Sync + 'static>(
1386 &self,
1387 detail: Option<&str>,
1388 f: F,
1389 ) -> SignalHandlerId {
1390 unsafe extern "C" fn handle_message_trampoline<
1391 P: IsA<RTSPMedia>,
1392 F: Fn(&P, &gst::Message) -> bool + Send + Sync + 'static,
1393 >(
1394 this: *mut ffi::GstRTSPMedia,
1395 message: *mut gst::ffi::GstMessage,
1396 f: glib::ffi::gpointer,
1397 ) -> glib::ffi::gboolean {
1398 let f: &F = &*(f as *const F);
1399 f(
1400 RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(),
1401 &from_glib_borrow(message),
1402 )
1403 .into_glib()
1404 }
1405 unsafe {
1406 let f: Box_<F> = Box_::new(f);
1407 let detailed_signal_name = detail.map(|name| format!("handle-message::{name}\0"));
1408 let signal_name: &[u8] = detailed_signal_name
1409 .as_ref()
1410 .map_or(c"handle-message".to_bytes(), |n| n.as_bytes());
1411 connect_raw(
1412 self.as_ptr() as *mut _,
1413 signal_name.as_ptr() as *const _,
1414 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1415 handle_message_trampoline::<Self, F> as *const (),
1416 )),
1417 Box_::into_raw(f),
1418 )
1419 }
1420 }
1421
1422 #[doc(alias = "new-state")]
1423 fn connect_new_state<F: Fn(&Self, i32) + Send + Sync + 'static>(
1424 &self,
1425 f: F,
1426 ) -> SignalHandlerId {
1427 unsafe extern "C" fn new_state_trampoline<
1428 P: IsA<RTSPMedia>,
1429 F: Fn(&P, i32) + Send + Sync + 'static,
1430 >(
1431 this: *mut ffi::GstRTSPMedia,
1432 object: std::ffi::c_int,
1433 f: glib::ffi::gpointer,
1434 ) {
1435 let f: &F = &*(f as *const F);
1436 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(), object)
1437 }
1438 unsafe {
1439 let f: Box_<F> = Box_::new(f);
1440 connect_raw(
1441 self.as_ptr() as *mut _,
1442 c"new-state".as_ptr() as *const _,
1443 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1444 new_state_trampoline::<Self, F> as *const (),
1445 )),
1446 Box_::into_raw(f),
1447 )
1448 }
1449 }
1450
1451 #[doc(alias = "new-stream")]
1452 fn connect_new_stream<F: Fn(&Self, &RTSPStream) + Send + Sync + 'static>(
1453 &self,
1454 f: F,
1455 ) -> SignalHandlerId {
1456 unsafe extern "C" fn new_stream_trampoline<
1457 P: IsA<RTSPMedia>,
1458 F: Fn(&P, &RTSPStream) + Send + Sync + 'static,
1459 >(
1460 this: *mut ffi::GstRTSPMedia,
1461 object: *mut ffi::GstRTSPStream,
1462 f: glib::ffi::gpointer,
1463 ) {
1464 let f: &F = &*(f as *const F);
1465 f(
1466 RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(),
1467 &from_glib_borrow(object),
1468 )
1469 }
1470 unsafe {
1471 let f: Box_<F> = Box_::new(f);
1472 connect_raw(
1473 self.as_ptr() as *mut _,
1474 c"new-stream".as_ptr() as *const _,
1475 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1476 new_stream_trampoline::<Self, F> as *const (),
1477 )),
1478 Box_::into_raw(f),
1479 )
1480 }
1481 }
1482
1483 #[doc(alias = "prepared")]
1484 fn connect_prepared<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1485 unsafe extern "C" fn prepared_trampoline<
1486 P: IsA<RTSPMedia>,
1487 F: Fn(&P) + Send + Sync + 'static,
1488 >(
1489 this: *mut ffi::GstRTSPMedia,
1490 f: glib::ffi::gpointer,
1491 ) {
1492 let f: &F = &*(f as *const F);
1493 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1494 }
1495 unsafe {
1496 let f: Box_<F> = Box_::new(f);
1497 connect_raw(
1498 self.as_ptr() as *mut _,
1499 c"prepared".as_ptr() as *const _,
1500 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1501 prepared_trampoline::<Self, F> as *const (),
1502 )),
1503 Box_::into_raw(f),
1504 )
1505 }
1506 }
1507
1508 #[doc(alias = "removed-stream")]
1509 fn connect_removed_stream<F: Fn(&Self, &RTSPStream) + Send + Sync + 'static>(
1510 &self,
1511 f: F,
1512 ) -> SignalHandlerId {
1513 unsafe extern "C" fn removed_stream_trampoline<
1514 P: IsA<RTSPMedia>,
1515 F: Fn(&P, &RTSPStream) + Send + Sync + 'static,
1516 >(
1517 this: *mut ffi::GstRTSPMedia,
1518 object: *mut ffi::GstRTSPStream,
1519 f: glib::ffi::gpointer,
1520 ) {
1521 let f: &F = &*(f as *const F);
1522 f(
1523 RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(),
1524 &from_glib_borrow(object),
1525 )
1526 }
1527 unsafe {
1528 let f: Box_<F> = Box_::new(f);
1529 connect_raw(
1530 self.as_ptr() as *mut _,
1531 c"removed-stream".as_ptr() as *const _,
1532 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1533 removed_stream_trampoline::<Self, F> as *const (),
1534 )),
1535 Box_::into_raw(f),
1536 )
1537 }
1538 }
1539
1540 #[doc(alias = "target-state")]
1541 fn connect_target_state<F: Fn(&Self, i32) + Send + Sync + 'static>(
1542 &self,
1543 f: F,
1544 ) -> SignalHandlerId {
1545 unsafe extern "C" fn target_state_trampoline<
1546 P: IsA<RTSPMedia>,
1547 F: Fn(&P, i32) + Send + Sync + 'static,
1548 >(
1549 this: *mut ffi::GstRTSPMedia,
1550 object: std::ffi::c_int,
1551 f: glib::ffi::gpointer,
1552 ) {
1553 let f: &F = &*(f as *const F);
1554 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(), object)
1555 }
1556 unsafe {
1557 let f: Box_<F> = Box_::new(f);
1558 connect_raw(
1559 self.as_ptr() as *mut _,
1560 c"target-state".as_ptr() as *const _,
1561 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1562 target_state_trampoline::<Self, F> as *const (),
1563 )),
1564 Box_::into_raw(f),
1565 )
1566 }
1567 }
1568
1569 #[doc(alias = "unprepared")]
1570 fn connect_unprepared<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1571 unsafe extern "C" fn unprepared_trampoline<
1572 P: IsA<RTSPMedia>,
1573 F: Fn(&P) + Send + Sync + 'static,
1574 >(
1575 this: *mut ffi::GstRTSPMedia,
1576 f: glib::ffi::gpointer,
1577 ) {
1578 let f: &F = &*(f as *const F);
1579 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1580 }
1581 unsafe {
1582 let f: Box_<F> = Box_::new(f);
1583 connect_raw(
1584 self.as_ptr() as *mut _,
1585 c"unprepared".as_ptr() as *const _,
1586 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1587 unprepared_trampoline::<Self, F> as *const (),
1588 )),
1589 Box_::into_raw(f),
1590 )
1591 }
1592 }
1593
1594 #[doc(alias = "bind-mcast-address")]
1595 fn connect_bind_mcast_address_notify<F: Fn(&Self) + Send + Sync + 'static>(
1596 &self,
1597 f: F,
1598 ) -> SignalHandlerId {
1599 unsafe extern "C" fn notify_bind_mcast_address_trampoline<
1600 P: IsA<RTSPMedia>,
1601 F: Fn(&P) + Send + Sync + 'static,
1602 >(
1603 this: *mut ffi::GstRTSPMedia,
1604 _param_spec: glib::ffi::gpointer,
1605 f: glib::ffi::gpointer,
1606 ) {
1607 let f: &F = &*(f as *const F);
1608 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1609 }
1610 unsafe {
1611 let f: Box_<F> = Box_::new(f);
1612 connect_raw(
1613 self.as_ptr() as *mut _,
1614 c"notify::bind-mcast-address".as_ptr() as *const _,
1615 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1616 notify_bind_mcast_address_trampoline::<Self, F> as *const (),
1617 )),
1618 Box_::into_raw(f),
1619 )
1620 }
1621 }
1622
1623 #[doc(alias = "buffer-size")]
1624 fn connect_buffer_size_notify<F: Fn(&Self) + Send + Sync + 'static>(
1625 &self,
1626 f: F,
1627 ) -> SignalHandlerId {
1628 unsafe extern "C" fn notify_buffer_size_trampoline<
1629 P: IsA<RTSPMedia>,
1630 F: Fn(&P) + Send + Sync + 'static,
1631 >(
1632 this: *mut ffi::GstRTSPMedia,
1633 _param_spec: glib::ffi::gpointer,
1634 f: glib::ffi::gpointer,
1635 ) {
1636 let f: &F = &*(f as *const F);
1637 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1638 }
1639 unsafe {
1640 let f: Box_<F> = Box_::new(f);
1641 connect_raw(
1642 self.as_ptr() as *mut _,
1643 c"notify::buffer-size".as_ptr() as *const _,
1644 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1645 notify_buffer_size_trampoline::<Self, F> as *const (),
1646 )),
1647 Box_::into_raw(f),
1648 )
1649 }
1650 }
1651
1652 #[doc(alias = "clock")]
1653 fn connect_clock_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1654 unsafe extern "C" fn notify_clock_trampoline<
1655 P: IsA<RTSPMedia>,
1656 F: Fn(&P) + Send + Sync + 'static,
1657 >(
1658 this: *mut ffi::GstRTSPMedia,
1659 _param_spec: glib::ffi::gpointer,
1660 f: glib::ffi::gpointer,
1661 ) {
1662 let f: &F = &*(f as *const F);
1663 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1664 }
1665 unsafe {
1666 let f: Box_<F> = Box_::new(f);
1667 connect_raw(
1668 self.as_ptr() as *mut _,
1669 c"notify::clock".as_ptr() as *const _,
1670 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1671 notify_clock_trampoline::<Self, F> as *const (),
1672 )),
1673 Box_::into_raw(f),
1674 )
1675 }
1676 }
1677
1678 #[doc(alias = "dscp-qos")]
1679 fn connect_dscp_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(
1680 &self,
1681 f: F,
1682 ) -> SignalHandlerId {
1683 unsafe extern "C" fn notify_dscp_qos_trampoline<
1684 P: IsA<RTSPMedia>,
1685 F: Fn(&P) + Send + Sync + 'static,
1686 >(
1687 this: *mut ffi::GstRTSPMedia,
1688 _param_spec: glib::ffi::gpointer,
1689 f: glib::ffi::gpointer,
1690 ) {
1691 let f: &F = &*(f as *const F);
1692 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1693 }
1694 unsafe {
1695 let f: Box_<F> = Box_::new(f);
1696 connect_raw(
1697 self.as_ptr() as *mut _,
1698 c"notify::dscp-qos".as_ptr() as *const _,
1699 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1700 notify_dscp_qos_trampoline::<Self, F> as *const (),
1701 )),
1702 Box_::into_raw(f),
1703 )
1704 }
1705 }
1706
1707 #[cfg(feature = "v1_24")]
1708 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1709 #[doc(alias = "ensure-keyunit-on-start")]
1710 fn connect_ensure_keyunit_on_start_notify<F: Fn(&Self) + Send + Sync + 'static>(
1711 &self,
1712 f: F,
1713 ) -> SignalHandlerId {
1714 unsafe extern "C" fn notify_ensure_keyunit_on_start_trampoline<
1715 P: IsA<RTSPMedia>,
1716 F: Fn(&P) + Send + Sync + 'static,
1717 >(
1718 this: *mut ffi::GstRTSPMedia,
1719 _param_spec: glib::ffi::gpointer,
1720 f: glib::ffi::gpointer,
1721 ) {
1722 let f: &F = &*(f as *const F);
1723 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1724 }
1725 unsafe {
1726 let f: Box_<F> = Box_::new(f);
1727 connect_raw(
1728 self.as_ptr() as *mut _,
1729 c"notify::ensure-keyunit-on-start".as_ptr() as *const _,
1730 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1731 notify_ensure_keyunit_on_start_trampoline::<Self, F> as *const (),
1732 )),
1733 Box_::into_raw(f),
1734 )
1735 }
1736 }
1737
1738 #[cfg(feature = "v1_24")]
1739 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1740 #[doc(alias = "ensure-keyunit-on-start-timeout")]
1741 fn connect_ensure_keyunit_on_start_timeout_notify<F: Fn(&Self) + Send + Sync + 'static>(
1742 &self,
1743 f: F,
1744 ) -> SignalHandlerId {
1745 unsafe extern "C" fn notify_ensure_keyunit_on_start_timeout_trampoline<
1746 P: IsA<RTSPMedia>,
1747 F: Fn(&P) + Send + Sync + 'static,
1748 >(
1749 this: *mut ffi::GstRTSPMedia,
1750 _param_spec: glib::ffi::gpointer,
1751 f: glib::ffi::gpointer,
1752 ) {
1753 let f: &F = &*(f as *const F);
1754 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1755 }
1756 unsafe {
1757 let f: Box_<F> = Box_::new(f);
1758 connect_raw(
1759 self.as_ptr() as *mut _,
1760 c"notify::ensure-keyunit-on-start-timeout".as_ptr() as *const _,
1761 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1762 notify_ensure_keyunit_on_start_timeout_trampoline::<Self, F> as *const (),
1763 )),
1764 Box_::into_raw(f),
1765 )
1766 }
1767 }
1768
1769 #[doc(alias = "eos-shutdown")]
1770 fn connect_eos_shutdown_notify<F: Fn(&Self) + Send + Sync + 'static>(
1771 &self,
1772 f: F,
1773 ) -> SignalHandlerId {
1774 unsafe extern "C" fn notify_eos_shutdown_trampoline<
1775 P: IsA<RTSPMedia>,
1776 F: Fn(&P) + Send + Sync + 'static,
1777 >(
1778 this: *mut ffi::GstRTSPMedia,
1779 _param_spec: glib::ffi::gpointer,
1780 f: glib::ffi::gpointer,
1781 ) {
1782 let f: &F = &*(f as *const F);
1783 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1784 }
1785 unsafe {
1786 let f: Box_<F> = Box_::new(f);
1787 connect_raw(
1788 self.as_ptr() as *mut _,
1789 c"notify::eos-shutdown".as_ptr() as *const _,
1790 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1791 notify_eos_shutdown_trampoline::<Self, F> as *const (),
1792 )),
1793 Box_::into_raw(f),
1794 )
1795 }
1796 }
1797
1798 #[doc(alias = "latency")]
1799 fn connect_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(
1800 &self,
1801 f: F,
1802 ) -> SignalHandlerId {
1803 unsafe extern "C" fn notify_latency_trampoline<
1804 P: IsA<RTSPMedia>,
1805 F: Fn(&P) + Send + Sync + 'static,
1806 >(
1807 this: *mut ffi::GstRTSPMedia,
1808 _param_spec: glib::ffi::gpointer,
1809 f: glib::ffi::gpointer,
1810 ) {
1811 let f: &F = &*(f as *const F);
1812 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1813 }
1814 unsafe {
1815 let f: Box_<F> = Box_::new(f);
1816 connect_raw(
1817 self.as_ptr() as *mut _,
1818 c"notify::latency".as_ptr() as *const _,
1819 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1820 notify_latency_trampoline::<Self, F> as *const (),
1821 )),
1822 Box_::into_raw(f),
1823 )
1824 }
1825 }
1826
1827 #[doc(alias = "max-mcast-ttl")]
1828 fn connect_max_mcast_ttl_notify<F: Fn(&Self) + Send + Sync + 'static>(
1829 &self,
1830 f: F,
1831 ) -> SignalHandlerId {
1832 unsafe extern "C" fn notify_max_mcast_ttl_trampoline<
1833 P: IsA<RTSPMedia>,
1834 F: Fn(&P) + Send + Sync + 'static,
1835 >(
1836 this: *mut ffi::GstRTSPMedia,
1837 _param_spec: glib::ffi::gpointer,
1838 f: glib::ffi::gpointer,
1839 ) {
1840 let f: &F = &*(f as *const F);
1841 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1842 }
1843 unsafe {
1844 let f: Box_<F> = Box_::new(f);
1845 connect_raw(
1846 self.as_ptr() as *mut _,
1847 c"notify::max-mcast-ttl".as_ptr() as *const _,
1848 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1849 notify_max_mcast_ttl_trampoline::<Self, F> as *const (),
1850 )),
1851 Box_::into_raw(f),
1852 )
1853 }
1854 }
1855
1856 #[doc(alias = "profiles")]
1857 fn connect_profiles_notify<F: Fn(&Self) + Send + Sync + 'static>(
1858 &self,
1859 f: F,
1860 ) -> SignalHandlerId {
1861 unsafe extern "C" fn notify_profiles_trampoline<
1862 P: IsA<RTSPMedia>,
1863 F: Fn(&P) + Send + Sync + 'static,
1864 >(
1865 this: *mut ffi::GstRTSPMedia,
1866 _param_spec: glib::ffi::gpointer,
1867 f: glib::ffi::gpointer,
1868 ) {
1869 let f: &F = &*(f as *const F);
1870 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1871 }
1872 unsafe {
1873 let f: Box_<F> = Box_::new(f);
1874 connect_raw(
1875 self.as_ptr() as *mut _,
1876 c"notify::profiles".as_ptr() as *const _,
1877 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1878 notify_profiles_trampoline::<Self, F> as *const (),
1879 )),
1880 Box_::into_raw(f),
1881 )
1882 }
1883 }
1884
1885 #[doc(alias = "protocols")]
1886 fn connect_protocols_notify<F: Fn(&Self) + Send + Sync + 'static>(
1887 &self,
1888 f: F,
1889 ) -> SignalHandlerId {
1890 unsafe extern "C" fn notify_protocols_trampoline<
1891 P: IsA<RTSPMedia>,
1892 F: Fn(&P) + Send + Sync + 'static,
1893 >(
1894 this: *mut ffi::GstRTSPMedia,
1895 _param_spec: glib::ffi::gpointer,
1896 f: glib::ffi::gpointer,
1897 ) {
1898 let f: &F = &*(f as *const F);
1899 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1900 }
1901 unsafe {
1902 let f: Box_<F> = Box_::new(f);
1903 connect_raw(
1904 self.as_ptr() as *mut _,
1905 c"notify::protocols".as_ptr() as *const _,
1906 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1907 notify_protocols_trampoline::<Self, F> as *const (),
1908 )),
1909 Box_::into_raw(f),
1910 )
1911 }
1912 }
1913
1914 #[doc(alias = "reusable")]
1915 fn connect_reusable_notify<F: Fn(&Self) + Send + Sync + 'static>(
1916 &self,
1917 f: F,
1918 ) -> SignalHandlerId {
1919 unsafe extern "C" fn notify_reusable_trampoline<
1920 P: IsA<RTSPMedia>,
1921 F: Fn(&P) + Send + Sync + 'static,
1922 >(
1923 this: *mut ffi::GstRTSPMedia,
1924 _param_spec: glib::ffi::gpointer,
1925 f: glib::ffi::gpointer,
1926 ) {
1927 let f: &F = &*(f as *const F);
1928 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1929 }
1930 unsafe {
1931 let f: Box_<F> = Box_::new(f);
1932 connect_raw(
1933 self.as_ptr() as *mut _,
1934 c"notify::reusable".as_ptr() as *const _,
1935 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1936 notify_reusable_trampoline::<Self, F> as *const (),
1937 )),
1938 Box_::into_raw(f),
1939 )
1940 }
1941 }
1942
1943 #[doc(alias = "shared")]
1944 fn connect_shared_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1945 unsafe extern "C" fn notify_shared_trampoline<
1946 P: IsA<RTSPMedia>,
1947 F: Fn(&P) + Send + Sync + 'static,
1948 >(
1949 this: *mut ffi::GstRTSPMedia,
1950 _param_spec: glib::ffi::gpointer,
1951 f: glib::ffi::gpointer,
1952 ) {
1953 let f: &F = &*(f as *const F);
1954 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1955 }
1956 unsafe {
1957 let f: Box_<F> = Box_::new(f);
1958 connect_raw(
1959 self.as_ptr() as *mut _,
1960 c"notify::shared".as_ptr() as *const _,
1961 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1962 notify_shared_trampoline::<Self, F> as *const (),
1963 )),
1964 Box_::into_raw(f),
1965 )
1966 }
1967 }
1968
1969 #[doc(alias = "stop-on-disconnect")]
1970 fn connect_stop_on_disconnect_notify<F: Fn(&Self) + Send + Sync + 'static>(
1971 &self,
1972 f: F,
1973 ) -> SignalHandlerId {
1974 unsafe extern "C" fn notify_stop_on_disconnect_trampoline<
1975 P: IsA<RTSPMedia>,
1976 F: Fn(&P) + Send + Sync + 'static,
1977 >(
1978 this: *mut ffi::GstRTSPMedia,
1979 _param_spec: glib::ffi::gpointer,
1980 f: glib::ffi::gpointer,
1981 ) {
1982 let f: &F = &*(f as *const F);
1983 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1984 }
1985 unsafe {
1986 let f: Box_<F> = Box_::new(f);
1987 connect_raw(
1988 self.as_ptr() as *mut _,
1989 c"notify::stop-on-disconnect".as_ptr() as *const _,
1990 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1991 notify_stop_on_disconnect_trampoline::<Self, F> as *const (),
1992 )),
1993 Box_::into_raw(f),
1994 )
1995 }
1996 }
1997
1998 #[doc(alias = "suspend-mode")]
1999 fn connect_suspend_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
2000 &self,
2001 f: F,
2002 ) -> SignalHandlerId {
2003 unsafe extern "C" fn notify_suspend_mode_trampoline<
2004 P: IsA<RTSPMedia>,
2005 F: Fn(&P) + Send + Sync + 'static,
2006 >(
2007 this: *mut ffi::GstRTSPMedia,
2008 _param_spec: glib::ffi::gpointer,
2009 f: glib::ffi::gpointer,
2010 ) {
2011 let f: &F = &*(f as *const F);
2012 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
2013 }
2014 unsafe {
2015 let f: Box_<F> = Box_::new(f);
2016 connect_raw(
2017 self.as_ptr() as *mut _,
2018 c"notify::suspend-mode".as_ptr() as *const _,
2019 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2020 notify_suspend_mode_trampoline::<Self, F> as *const (),
2021 )),
2022 Box_::into_raw(f),
2023 )
2024 }
2025 }
2026
2027 #[doc(alias = "time-provider")]
2028 fn connect_time_provider_notify<F: Fn(&Self) + Send + Sync + 'static>(
2029 &self,
2030 f: F,
2031 ) -> SignalHandlerId {
2032 unsafe extern "C" fn notify_time_provider_trampoline<
2033 P: IsA<RTSPMedia>,
2034 F: Fn(&P) + Send + Sync + 'static,
2035 >(
2036 this: *mut ffi::GstRTSPMedia,
2037 _param_spec: glib::ffi::gpointer,
2038 f: glib::ffi::gpointer,
2039 ) {
2040 let f: &F = &*(f as *const F);
2041 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
2042 }
2043 unsafe {
2044 let f: Box_<F> = Box_::new(f);
2045 connect_raw(
2046 self.as_ptr() as *mut _,
2047 c"notify::time-provider".as_ptr() as *const _,
2048 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2049 notify_time_provider_trampoline::<Self, F> as *const (),
2050 )),
2051 Box_::into_raw(f),
2052 )
2053 }
2054 }
2055
2056 #[doc(alias = "transport-mode")]
2057 fn connect_transport_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
2058 &self,
2059 f: F,
2060 ) -> SignalHandlerId {
2061 unsafe extern "C" fn notify_transport_mode_trampoline<
2062 P: IsA<RTSPMedia>,
2063 F: Fn(&P) + Send + Sync + 'static,
2064 >(
2065 this: *mut ffi::GstRTSPMedia,
2066 _param_spec: glib::ffi::gpointer,
2067 f: glib::ffi::gpointer,
2068 ) {
2069 let f: &F = &*(f as *const F);
2070 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
2071 }
2072 unsafe {
2073 let f: Box_<F> = Box_::new(f);
2074 connect_raw(
2075 self.as_ptr() as *mut _,
2076 c"notify::transport-mode".as_ptr() as *const _,
2077 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2078 notify_transport_mode_trampoline::<Self, F> as *const (),
2079 )),
2080 Box_::into_raw(f),
2081 )
2082 }
2083 }
2084}
2085
2086impl<O: IsA<RTSPMedia>> RTSPMediaExt for O {}