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