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")]
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 unsafe {
1399 let f: &F = &*(f as *const F);
1400 f(
1401 RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(),
1402 &from_glib_borrow(message),
1403 )
1404 .into_glib()
1405 }
1406 }
1407 unsafe {
1408 let f: Box_<F> = Box_::new(f);
1409 let detailed_signal_name = detail.map(|name| format!("handle-message::{name}\0"));
1410 let signal_name = detailed_signal_name
1411 .as_ref()
1412 .map_or(c"handle-message", |n| {
1413 std::ffi::CStr::from_bytes_with_nul_unchecked(n.as_bytes())
1414 });
1415 connect_raw(
1416 self.as_ptr() as *mut _,
1417 signal_name.as_ptr(),
1418 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1419 handle_message_trampoline::<Self, F> as *const (),
1420 )),
1421 Box_::into_raw(f),
1422 )
1423 }
1424 }
1425
1426 #[doc(alias = "new-state")]
1427 fn connect_new_state<F: Fn(&Self, i32) + Send + Sync + 'static>(
1428 &self,
1429 f: F,
1430 ) -> SignalHandlerId {
1431 unsafe extern "C" fn new_state_trampoline<
1432 P: IsA<RTSPMedia>,
1433 F: Fn(&P, i32) + Send + Sync + 'static,
1434 >(
1435 this: *mut ffi::GstRTSPMedia,
1436 object: std::ffi::c_int,
1437 f: glib::ffi::gpointer,
1438 ) {
1439 unsafe {
1440 let f: &F = &*(f as *const F);
1441 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(), object)
1442 }
1443 }
1444 unsafe {
1445 let f: Box_<F> = Box_::new(f);
1446 connect_raw(
1447 self.as_ptr() as *mut _,
1448 c"new-state".as_ptr(),
1449 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1450 new_state_trampoline::<Self, F> as *const (),
1451 )),
1452 Box_::into_raw(f),
1453 )
1454 }
1455 }
1456
1457 #[doc(alias = "new-stream")]
1458 fn connect_new_stream<F: Fn(&Self, &RTSPStream) + Send + Sync + 'static>(
1459 &self,
1460 f: F,
1461 ) -> SignalHandlerId {
1462 unsafe extern "C" fn new_stream_trampoline<
1463 P: IsA<RTSPMedia>,
1464 F: Fn(&P, &RTSPStream) + Send + Sync + 'static,
1465 >(
1466 this: *mut ffi::GstRTSPMedia,
1467 object: *mut ffi::GstRTSPStream,
1468 f: glib::ffi::gpointer,
1469 ) {
1470 unsafe {
1471 let f: &F = &*(f as *const F);
1472 f(
1473 RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(),
1474 &from_glib_borrow(object),
1475 )
1476 }
1477 }
1478 unsafe {
1479 let f: Box_<F> = Box_::new(f);
1480 connect_raw(
1481 self.as_ptr() as *mut _,
1482 c"new-stream".as_ptr(),
1483 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1484 new_stream_trampoline::<Self, F> as *const (),
1485 )),
1486 Box_::into_raw(f),
1487 )
1488 }
1489 }
1490
1491 #[doc(alias = "prepared")]
1492 fn connect_prepared<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1493 unsafe extern "C" fn prepared_trampoline<
1494 P: IsA<RTSPMedia>,
1495 F: Fn(&P) + Send + Sync + 'static,
1496 >(
1497 this: *mut ffi::GstRTSPMedia,
1498 f: glib::ffi::gpointer,
1499 ) {
1500 unsafe {
1501 let f: &F = &*(f as *const F);
1502 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1503 }
1504 }
1505 unsafe {
1506 let f: Box_<F> = Box_::new(f);
1507 connect_raw(
1508 self.as_ptr() as *mut _,
1509 c"prepared".as_ptr(),
1510 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1511 prepared_trampoline::<Self, F> as *const (),
1512 )),
1513 Box_::into_raw(f),
1514 )
1515 }
1516 }
1517
1518 #[doc(alias = "removed-stream")]
1519 fn connect_removed_stream<F: Fn(&Self, &RTSPStream) + Send + Sync + 'static>(
1520 &self,
1521 f: F,
1522 ) -> SignalHandlerId {
1523 unsafe extern "C" fn removed_stream_trampoline<
1524 P: IsA<RTSPMedia>,
1525 F: Fn(&P, &RTSPStream) + Send + Sync + 'static,
1526 >(
1527 this: *mut ffi::GstRTSPMedia,
1528 object: *mut ffi::GstRTSPStream,
1529 f: glib::ffi::gpointer,
1530 ) {
1531 unsafe {
1532 let f: &F = &*(f as *const F);
1533 f(
1534 RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(),
1535 &from_glib_borrow(object),
1536 )
1537 }
1538 }
1539 unsafe {
1540 let f: Box_<F> = Box_::new(f);
1541 connect_raw(
1542 self.as_ptr() as *mut _,
1543 c"removed-stream".as_ptr(),
1544 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1545 removed_stream_trampoline::<Self, F> as *const (),
1546 )),
1547 Box_::into_raw(f),
1548 )
1549 }
1550 }
1551
1552 #[doc(alias = "target-state")]
1553 fn connect_target_state<F: Fn(&Self, i32) + Send + Sync + 'static>(
1554 &self,
1555 f: F,
1556 ) -> SignalHandlerId {
1557 unsafe extern "C" fn target_state_trampoline<
1558 P: IsA<RTSPMedia>,
1559 F: Fn(&P, i32) + Send + Sync + 'static,
1560 >(
1561 this: *mut ffi::GstRTSPMedia,
1562 object: std::ffi::c_int,
1563 f: glib::ffi::gpointer,
1564 ) {
1565 unsafe {
1566 let f: &F = &*(f as *const F);
1567 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(), object)
1568 }
1569 }
1570 unsafe {
1571 let f: Box_<F> = Box_::new(f);
1572 connect_raw(
1573 self.as_ptr() as *mut _,
1574 c"target-state".as_ptr(),
1575 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1576 target_state_trampoline::<Self, F> as *const (),
1577 )),
1578 Box_::into_raw(f),
1579 )
1580 }
1581 }
1582
1583 #[doc(alias = "unprepared")]
1584 fn connect_unprepared<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1585 unsafe extern "C" fn unprepared_trampoline<
1586 P: IsA<RTSPMedia>,
1587 F: Fn(&P) + Send + Sync + 'static,
1588 >(
1589 this: *mut ffi::GstRTSPMedia,
1590 f: glib::ffi::gpointer,
1591 ) {
1592 unsafe {
1593 let f: &F = &*(f as *const F);
1594 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1595 }
1596 }
1597 unsafe {
1598 let f: Box_<F> = Box_::new(f);
1599 connect_raw(
1600 self.as_ptr() as *mut _,
1601 c"unprepared".as_ptr(),
1602 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1603 unprepared_trampoline::<Self, F> as *const (),
1604 )),
1605 Box_::into_raw(f),
1606 )
1607 }
1608 }
1609
1610 #[doc(alias = "bind-mcast-address")]
1611 fn connect_bind_mcast_address_notify<F: Fn(&Self) + Send + Sync + 'static>(
1612 &self,
1613 f: F,
1614 ) -> SignalHandlerId {
1615 unsafe extern "C" fn notify_bind_mcast_address_trampoline<
1616 P: IsA<RTSPMedia>,
1617 F: Fn(&P) + Send + Sync + 'static,
1618 >(
1619 this: *mut ffi::GstRTSPMedia,
1620 _param_spec: glib::ffi::gpointer,
1621 f: glib::ffi::gpointer,
1622 ) {
1623 unsafe {
1624 let f: &F = &*(f as *const F);
1625 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1626 }
1627 }
1628 unsafe {
1629 let f: Box_<F> = Box_::new(f);
1630 connect_raw(
1631 self.as_ptr() as *mut _,
1632 c"notify::bind-mcast-address".as_ptr(),
1633 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1634 notify_bind_mcast_address_trampoline::<Self, F> as *const (),
1635 )),
1636 Box_::into_raw(f),
1637 )
1638 }
1639 }
1640
1641 #[doc(alias = "buffer-size")]
1642 fn connect_buffer_size_notify<F: Fn(&Self) + Send + Sync + 'static>(
1643 &self,
1644 f: F,
1645 ) -> SignalHandlerId {
1646 unsafe extern "C" fn notify_buffer_size_trampoline<
1647 P: IsA<RTSPMedia>,
1648 F: Fn(&P) + Send + Sync + 'static,
1649 >(
1650 this: *mut ffi::GstRTSPMedia,
1651 _param_spec: glib::ffi::gpointer,
1652 f: glib::ffi::gpointer,
1653 ) {
1654 unsafe {
1655 let f: &F = &*(f as *const F);
1656 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1657 }
1658 }
1659 unsafe {
1660 let f: Box_<F> = Box_::new(f);
1661 connect_raw(
1662 self.as_ptr() as *mut _,
1663 c"notify::buffer-size".as_ptr(),
1664 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1665 notify_buffer_size_trampoline::<Self, F> as *const (),
1666 )),
1667 Box_::into_raw(f),
1668 )
1669 }
1670 }
1671
1672 #[doc(alias = "clock")]
1673 fn connect_clock_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1674 unsafe extern "C" fn notify_clock_trampoline<
1675 P: IsA<RTSPMedia>,
1676 F: Fn(&P) + Send + Sync + 'static,
1677 >(
1678 this: *mut ffi::GstRTSPMedia,
1679 _param_spec: glib::ffi::gpointer,
1680 f: glib::ffi::gpointer,
1681 ) {
1682 unsafe {
1683 let f: &F = &*(f as *const F);
1684 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1685 }
1686 }
1687 unsafe {
1688 let f: Box_<F> = Box_::new(f);
1689 connect_raw(
1690 self.as_ptr() as *mut _,
1691 c"notify::clock".as_ptr(),
1692 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1693 notify_clock_trampoline::<Self, F> as *const (),
1694 )),
1695 Box_::into_raw(f),
1696 )
1697 }
1698 }
1699
1700 #[doc(alias = "dscp-qos")]
1701 fn connect_dscp_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(
1702 &self,
1703 f: F,
1704 ) -> SignalHandlerId {
1705 unsafe extern "C" fn notify_dscp_qos_trampoline<
1706 P: IsA<RTSPMedia>,
1707 F: Fn(&P) + Send + Sync + 'static,
1708 >(
1709 this: *mut ffi::GstRTSPMedia,
1710 _param_spec: glib::ffi::gpointer,
1711 f: glib::ffi::gpointer,
1712 ) {
1713 unsafe {
1714 let f: &F = &*(f as *const F);
1715 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1716 }
1717 }
1718 unsafe {
1719 let f: Box_<F> = Box_::new(f);
1720 connect_raw(
1721 self.as_ptr() as *mut _,
1722 c"notify::dscp-qos".as_ptr(),
1723 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1724 notify_dscp_qos_trampoline::<Self, F> as *const (),
1725 )),
1726 Box_::into_raw(f),
1727 )
1728 }
1729 }
1730
1731 #[cfg(feature = "v1_24")]
1732 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1733 #[doc(alias = "ensure-keyunit-on-start")]
1734 fn connect_ensure_keyunit_on_start_notify<F: Fn(&Self) + Send + Sync + 'static>(
1735 &self,
1736 f: F,
1737 ) -> SignalHandlerId {
1738 unsafe extern "C" fn notify_ensure_keyunit_on_start_trampoline<
1739 P: IsA<RTSPMedia>,
1740 F: Fn(&P) + Send + Sync + 'static,
1741 >(
1742 this: *mut ffi::GstRTSPMedia,
1743 _param_spec: glib::ffi::gpointer,
1744 f: glib::ffi::gpointer,
1745 ) {
1746 unsafe {
1747 let f: &F = &*(f as *const F);
1748 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1749 }
1750 }
1751 unsafe {
1752 let f: Box_<F> = Box_::new(f);
1753 connect_raw(
1754 self.as_ptr() as *mut _,
1755 c"notify::ensure-keyunit-on-start".as_ptr(),
1756 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1757 notify_ensure_keyunit_on_start_trampoline::<Self, F> as *const (),
1758 )),
1759 Box_::into_raw(f),
1760 )
1761 }
1762 }
1763
1764 #[cfg(feature = "v1_24")]
1765 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1766 #[doc(alias = "ensure-keyunit-on-start-timeout")]
1767 fn connect_ensure_keyunit_on_start_timeout_notify<F: Fn(&Self) + Send + Sync + 'static>(
1768 &self,
1769 f: F,
1770 ) -> SignalHandlerId {
1771 unsafe extern "C" fn notify_ensure_keyunit_on_start_timeout_trampoline<
1772 P: IsA<RTSPMedia>,
1773 F: Fn(&P) + Send + Sync + 'static,
1774 >(
1775 this: *mut ffi::GstRTSPMedia,
1776 _param_spec: glib::ffi::gpointer,
1777 f: glib::ffi::gpointer,
1778 ) {
1779 unsafe {
1780 let f: &F = &*(f as *const F);
1781 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1782 }
1783 }
1784 unsafe {
1785 let f: Box_<F> = Box_::new(f);
1786 connect_raw(
1787 self.as_ptr() as *mut _,
1788 c"notify::ensure-keyunit-on-start-timeout".as_ptr(),
1789 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1790 notify_ensure_keyunit_on_start_timeout_trampoline::<Self, F> as *const (),
1791 )),
1792 Box_::into_raw(f),
1793 )
1794 }
1795 }
1796
1797 #[doc(alias = "eos-shutdown")]
1798 fn connect_eos_shutdown_notify<F: Fn(&Self) + Send + Sync + 'static>(
1799 &self,
1800 f: F,
1801 ) -> SignalHandlerId {
1802 unsafe extern "C" fn notify_eos_shutdown_trampoline<
1803 P: IsA<RTSPMedia>,
1804 F: Fn(&P) + Send + Sync + 'static,
1805 >(
1806 this: *mut ffi::GstRTSPMedia,
1807 _param_spec: glib::ffi::gpointer,
1808 f: glib::ffi::gpointer,
1809 ) {
1810 unsafe {
1811 let f: &F = &*(f as *const F);
1812 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1813 }
1814 }
1815 unsafe {
1816 let f: Box_<F> = Box_::new(f);
1817 connect_raw(
1818 self.as_ptr() as *mut _,
1819 c"notify::eos-shutdown".as_ptr(),
1820 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1821 notify_eos_shutdown_trampoline::<Self, F> as *const (),
1822 )),
1823 Box_::into_raw(f),
1824 )
1825 }
1826 }
1827
1828 #[doc(alias = "latency")]
1829 fn connect_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(
1830 &self,
1831 f: F,
1832 ) -> SignalHandlerId {
1833 unsafe extern "C" fn notify_latency_trampoline<
1834 P: IsA<RTSPMedia>,
1835 F: Fn(&P) + Send + Sync + 'static,
1836 >(
1837 this: *mut ffi::GstRTSPMedia,
1838 _param_spec: glib::ffi::gpointer,
1839 f: glib::ffi::gpointer,
1840 ) {
1841 unsafe {
1842 let f: &F = &*(f as *const F);
1843 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1844 }
1845 }
1846 unsafe {
1847 let f: Box_<F> = Box_::new(f);
1848 connect_raw(
1849 self.as_ptr() as *mut _,
1850 c"notify::latency".as_ptr(),
1851 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1852 notify_latency_trampoline::<Self, F> as *const (),
1853 )),
1854 Box_::into_raw(f),
1855 )
1856 }
1857 }
1858
1859 #[doc(alias = "max-mcast-ttl")]
1860 fn connect_max_mcast_ttl_notify<F: Fn(&Self) + Send + Sync + 'static>(
1861 &self,
1862 f: F,
1863 ) -> SignalHandlerId {
1864 unsafe extern "C" fn notify_max_mcast_ttl_trampoline<
1865 P: IsA<RTSPMedia>,
1866 F: Fn(&P) + Send + Sync + 'static,
1867 >(
1868 this: *mut ffi::GstRTSPMedia,
1869 _param_spec: glib::ffi::gpointer,
1870 f: glib::ffi::gpointer,
1871 ) {
1872 unsafe {
1873 let f: &F = &*(f as *const F);
1874 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1875 }
1876 }
1877 unsafe {
1878 let f: Box_<F> = Box_::new(f);
1879 connect_raw(
1880 self.as_ptr() as *mut _,
1881 c"notify::max-mcast-ttl".as_ptr(),
1882 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1883 notify_max_mcast_ttl_trampoline::<Self, F> as *const (),
1884 )),
1885 Box_::into_raw(f),
1886 )
1887 }
1888 }
1889
1890 #[doc(alias = "profiles")]
1891 fn connect_profiles_notify<F: Fn(&Self) + Send + Sync + 'static>(
1892 &self,
1893 f: F,
1894 ) -> SignalHandlerId {
1895 unsafe extern "C" fn notify_profiles_trampoline<
1896 P: IsA<RTSPMedia>,
1897 F: Fn(&P) + Send + Sync + 'static,
1898 >(
1899 this: *mut ffi::GstRTSPMedia,
1900 _param_spec: glib::ffi::gpointer,
1901 f: glib::ffi::gpointer,
1902 ) {
1903 unsafe {
1904 let f: &F = &*(f as *const F);
1905 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1906 }
1907 }
1908 unsafe {
1909 let f: Box_<F> = Box_::new(f);
1910 connect_raw(
1911 self.as_ptr() as *mut _,
1912 c"notify::profiles".as_ptr(),
1913 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1914 notify_profiles_trampoline::<Self, F> as *const (),
1915 )),
1916 Box_::into_raw(f),
1917 )
1918 }
1919 }
1920
1921 #[doc(alias = "protocols")]
1922 fn connect_protocols_notify<F: Fn(&Self) + Send + Sync + 'static>(
1923 &self,
1924 f: F,
1925 ) -> SignalHandlerId {
1926 unsafe extern "C" fn notify_protocols_trampoline<
1927 P: IsA<RTSPMedia>,
1928 F: Fn(&P) + Send + Sync + 'static,
1929 >(
1930 this: *mut ffi::GstRTSPMedia,
1931 _param_spec: glib::ffi::gpointer,
1932 f: glib::ffi::gpointer,
1933 ) {
1934 unsafe {
1935 let f: &F = &*(f as *const F);
1936 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1937 }
1938 }
1939 unsafe {
1940 let f: Box_<F> = Box_::new(f);
1941 connect_raw(
1942 self.as_ptr() as *mut _,
1943 c"notify::protocols".as_ptr(),
1944 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1945 notify_protocols_trampoline::<Self, F> as *const (),
1946 )),
1947 Box_::into_raw(f),
1948 )
1949 }
1950 }
1951
1952 #[doc(alias = "reusable")]
1953 fn connect_reusable_notify<F: Fn(&Self) + Send + Sync + 'static>(
1954 &self,
1955 f: F,
1956 ) -> SignalHandlerId {
1957 unsafe extern "C" fn notify_reusable_trampoline<
1958 P: IsA<RTSPMedia>,
1959 F: Fn(&P) + Send + Sync + 'static,
1960 >(
1961 this: *mut ffi::GstRTSPMedia,
1962 _param_spec: glib::ffi::gpointer,
1963 f: glib::ffi::gpointer,
1964 ) {
1965 unsafe {
1966 let f: &F = &*(f as *const F);
1967 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1968 }
1969 }
1970 unsafe {
1971 let f: Box_<F> = Box_::new(f);
1972 connect_raw(
1973 self.as_ptr() as *mut _,
1974 c"notify::reusable".as_ptr(),
1975 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1976 notify_reusable_trampoline::<Self, F> as *const (),
1977 )),
1978 Box_::into_raw(f),
1979 )
1980 }
1981 }
1982
1983 #[doc(alias = "shared")]
1984 fn connect_shared_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1985 unsafe extern "C" fn notify_shared_trampoline<
1986 P: IsA<RTSPMedia>,
1987 F: Fn(&P) + Send + Sync + 'static,
1988 >(
1989 this: *mut ffi::GstRTSPMedia,
1990 _param_spec: glib::ffi::gpointer,
1991 f: glib::ffi::gpointer,
1992 ) {
1993 unsafe {
1994 let f: &F = &*(f as *const F);
1995 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1996 }
1997 }
1998 unsafe {
1999 let f: Box_<F> = Box_::new(f);
2000 connect_raw(
2001 self.as_ptr() as *mut _,
2002 c"notify::shared".as_ptr(),
2003 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2004 notify_shared_trampoline::<Self, F> as *const (),
2005 )),
2006 Box_::into_raw(f),
2007 )
2008 }
2009 }
2010
2011 #[doc(alias = "stop-on-disconnect")]
2012 fn connect_stop_on_disconnect_notify<F: Fn(&Self) + Send + Sync + 'static>(
2013 &self,
2014 f: F,
2015 ) -> SignalHandlerId {
2016 unsafe extern "C" fn notify_stop_on_disconnect_trampoline<
2017 P: IsA<RTSPMedia>,
2018 F: Fn(&P) + Send + Sync + 'static,
2019 >(
2020 this: *mut ffi::GstRTSPMedia,
2021 _param_spec: glib::ffi::gpointer,
2022 f: glib::ffi::gpointer,
2023 ) {
2024 unsafe {
2025 let f: &F = &*(f as *const F);
2026 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
2027 }
2028 }
2029 unsafe {
2030 let f: Box_<F> = Box_::new(f);
2031 connect_raw(
2032 self.as_ptr() as *mut _,
2033 c"notify::stop-on-disconnect".as_ptr(),
2034 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2035 notify_stop_on_disconnect_trampoline::<Self, F> as *const (),
2036 )),
2037 Box_::into_raw(f),
2038 )
2039 }
2040 }
2041
2042 #[doc(alias = "suspend-mode")]
2043 fn connect_suspend_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
2044 &self,
2045 f: F,
2046 ) -> SignalHandlerId {
2047 unsafe extern "C" fn notify_suspend_mode_trampoline<
2048 P: IsA<RTSPMedia>,
2049 F: Fn(&P) + Send + Sync + 'static,
2050 >(
2051 this: *mut ffi::GstRTSPMedia,
2052 _param_spec: glib::ffi::gpointer,
2053 f: glib::ffi::gpointer,
2054 ) {
2055 unsafe {
2056 let f: &F = &*(f as *const F);
2057 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
2058 }
2059 }
2060 unsafe {
2061 let f: Box_<F> = Box_::new(f);
2062 connect_raw(
2063 self.as_ptr() as *mut _,
2064 c"notify::suspend-mode".as_ptr(),
2065 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2066 notify_suspend_mode_trampoline::<Self, F> as *const (),
2067 )),
2068 Box_::into_raw(f),
2069 )
2070 }
2071 }
2072
2073 #[doc(alias = "time-provider")]
2074 fn connect_time_provider_notify<F: Fn(&Self) + Send + Sync + 'static>(
2075 &self,
2076 f: F,
2077 ) -> SignalHandlerId {
2078 unsafe extern "C" fn notify_time_provider_trampoline<
2079 P: IsA<RTSPMedia>,
2080 F: Fn(&P) + Send + Sync + 'static,
2081 >(
2082 this: *mut ffi::GstRTSPMedia,
2083 _param_spec: glib::ffi::gpointer,
2084 f: glib::ffi::gpointer,
2085 ) {
2086 unsafe {
2087 let f: &F = &*(f as *const F);
2088 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
2089 }
2090 }
2091 unsafe {
2092 let f: Box_<F> = Box_::new(f);
2093 connect_raw(
2094 self.as_ptr() as *mut _,
2095 c"notify::time-provider".as_ptr(),
2096 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2097 notify_time_provider_trampoline::<Self, F> as *const (),
2098 )),
2099 Box_::into_raw(f),
2100 )
2101 }
2102 }
2103
2104 #[doc(alias = "transport-mode")]
2105 fn connect_transport_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
2106 &self,
2107 f: F,
2108 ) -> SignalHandlerId {
2109 unsafe extern "C" fn notify_transport_mode_trampoline<
2110 P: IsA<RTSPMedia>,
2111 F: Fn(&P) + Send + Sync + 'static,
2112 >(
2113 this: *mut ffi::GstRTSPMedia,
2114 _param_spec: glib::ffi::gpointer,
2115 f: glib::ffi::gpointer,
2116 ) {
2117 unsafe {
2118 let f: &F = &*(f as *const F);
2119 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
2120 }
2121 }
2122 unsafe {
2123 let f: Box_<F> = Box_::new(f);
2124 connect_raw(
2125 self.as_ptr() as *mut _,
2126 c"notify::transport-mode".as_ptr(),
2127 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2128 notify_transport_mode_trampoline::<Self, F> as *const (),
2129 )),
2130 Box_::into_raw(f),
2131 )
2132 }
2133 }
2134}
2135
2136impl<O: IsA<RTSPMedia>> RTSPMediaExt for O {}