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
178mod sealed {
179 pub trait Sealed {}
180 impl<T: super::IsA<super::RTSPMedia>> Sealed for T {}
181}
182
183pub trait RTSPMediaExt: IsA<RTSPMedia> + sealed::Sealed + 'static {
189 #[cfg(feature = "v1_24")]
200 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
201 #[doc(alias = "gst_rtsp_media_can_be_shared")]
202 fn can_be_shared(&self) -> bool {
203 unsafe {
204 from_glib(ffi::gst_rtsp_media_can_be_shared(
205 self.as_ref().to_glib_none().0,
206 ))
207 }
208 }
209
210 #[doc(alias = "gst_rtsp_media_collect_streams")]
219 fn collect_streams(&self) {
220 unsafe {
221 ffi::gst_rtsp_media_collect_streams(self.as_ref().to_glib_none().0);
222 }
223 }
224
225 #[doc(alias = "gst_rtsp_media_create_stream")]
242 fn create_stream(
243 &self,
244 payloader: &impl IsA<gst::Element>,
245 pad: &impl IsA<gst::Pad>,
246 ) -> RTSPStream {
247 unsafe {
248 from_glib_none(ffi::gst_rtsp_media_create_stream(
249 self.as_ref().to_glib_none().0,
250 payloader.as_ref().to_glib_none().0,
251 pad.as_ref().to_glib_none().0,
252 ))
253 }
254 }
255
256 #[doc(alias = "gst_rtsp_media_find_stream")]
266 fn find_stream(&self, control: &str) -> Option<RTSPStream> {
267 unsafe {
268 from_glib_none(ffi::gst_rtsp_media_find_stream(
269 self.as_ref().to_glib_none().0,
270 control.to_glib_none().0,
271 ))
272 }
273 }
274
275 #[doc(alias = "gst_rtsp_media_get_address_pool")]
282 #[doc(alias = "get_address_pool")]
283 fn address_pool(&self) -> Option<RTSPAddressPool> {
284 unsafe {
285 from_glib_full(ffi::gst_rtsp_media_get_address_pool(
286 self.as_ref().to_glib_none().0,
287 ))
288 }
289 }
290
291 #[doc(alias = "gst_rtsp_media_get_base_time")]
299 #[doc(alias = "get_base_time")]
300 fn base_time(&self) -> Option<gst::ClockTime> {
301 unsafe {
302 from_glib(ffi::gst_rtsp_media_get_base_time(
303 self.as_ref().to_glib_none().0,
304 ))
305 }
306 }
307
308 #[doc(alias = "gst_rtsp_media_get_buffer_size")]
314 #[doc(alias = "get_buffer_size")]
315 #[doc(alias = "buffer-size")]
316 fn buffer_size(&self) -> u32 {
317 unsafe { ffi::gst_rtsp_media_get_buffer_size(self.as_ref().to_glib_none().0) }
318 }
319
320 #[doc(alias = "gst_rtsp_media_get_clock")]
328 #[doc(alias = "get_clock")]
329 fn clock(&self) -> Option<gst::Clock> {
330 unsafe {
331 from_glib_full(ffi::gst_rtsp_media_get_clock(
332 self.as_ref().to_glib_none().0,
333 ))
334 }
335 }
336
337 #[cfg(feature = "v1_16")]
342 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
343 #[doc(alias = "gst_rtsp_media_get_do_retransmission")]
344 #[doc(alias = "get_do_retransmission")]
345 fn does_retransmission(&self) -> bool {
346 unsafe {
347 from_glib(ffi::gst_rtsp_media_get_do_retransmission(
348 self.as_ref().to_glib_none().0,
349 ))
350 }
351 }
352
353 #[cfg(feature = "v1_18")]
359 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
360 #[doc(alias = "gst_rtsp_media_get_dscp_qos")]
361 #[doc(alias = "get_dscp_qos")]
362 #[doc(alias = "dscp-qos")]
363 fn dscp_qos(&self) -> i32 {
364 unsafe { ffi::gst_rtsp_media_get_dscp_qos(self.as_ref().to_glib_none().0) }
365 }
366
367 #[doc(alias = "gst_rtsp_media_get_element")]
373 #[doc(alias = "get_element")]
374 fn element(&self) -> gst::Element {
375 unsafe {
376 from_glib_full(ffi::gst_rtsp_media_get_element(
377 self.as_ref().to_glib_none().0,
378 ))
379 }
380 }
381
382 #[cfg(feature = "v1_24")]
388 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
389 #[doc(alias = "gst_rtsp_media_get_ensure_keyunit_on_start")]
390 #[doc(alias = "get_ensure_keyunit_on_start")]
391 #[doc(alias = "ensure-keyunit-on-start")]
392 fn is_ensure_keyunit_on_start(&self) -> bool {
393 unsafe {
394 from_glib(ffi::gst_rtsp_media_get_ensure_keyunit_on_start(
395 self.as_ref().to_glib_none().0,
396 ))
397 }
398 }
399
400 #[cfg(feature = "v1_24")]
406 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
407 #[doc(alias = "gst_rtsp_media_get_ensure_keyunit_on_start_timeout")]
408 #[doc(alias = "get_ensure_keyunit_on_start_timeout")]
409 #[doc(alias = "ensure-keyunit-on-start-timeout")]
410 fn ensure_keyunit_on_start_timeout(&self) -> u32 {
411 unsafe {
412 ffi::gst_rtsp_media_get_ensure_keyunit_on_start_timeout(self.as_ref().to_glib_none().0)
413 }
414 }
415
416 #[doc(alias = "gst_rtsp_media_get_latency")]
422 #[doc(alias = "get_latency")]
423 fn latency(&self) -> u32 {
424 unsafe { ffi::gst_rtsp_media_get_latency(self.as_ref().to_glib_none().0) }
425 }
426
427 #[cfg(feature = "v1_16")]
433 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
434 #[doc(alias = "gst_rtsp_media_get_max_mcast_ttl")]
435 #[doc(alias = "get_max_mcast_ttl")]
436 #[doc(alias = "max-mcast-ttl")]
437 fn max_mcast_ttl(&self) -> u32 {
438 unsafe { ffi::gst_rtsp_media_get_max_mcast_ttl(self.as_ref().to_glib_none().0) }
439 }
440
441 #[doc(alias = "gst_rtsp_media_get_multicast_iface")]
448 #[doc(alias = "get_multicast_iface")]
449 fn multicast_iface(&self) -> Option<glib::GString> {
450 unsafe {
451 from_glib_full(ffi::gst_rtsp_media_get_multicast_iface(
452 self.as_ref().to_glib_none().0,
453 ))
454 }
455 }
456
457 #[doc(alias = "gst_rtsp_media_get_profiles")]
469 #[doc(alias = "get_profiles")]
470 fn profiles(&self) -> gst_rtsp::RTSPProfile {
471 unsafe {
472 from_glib(ffi::gst_rtsp_media_get_profiles(
473 self.as_ref().to_glib_none().0,
474 ))
475 }
476 }
477
478 #[doc(alias = "gst_rtsp_media_get_protocols")]
484 #[doc(alias = "get_protocols")]
485 fn protocols(&self) -> gst_rtsp::RTSPLowerTrans {
486 unsafe {
487 from_glib(ffi::gst_rtsp_media_get_protocols(
488 self.as_ref().to_glib_none().0,
489 ))
490 }
491 }
492
493 #[doc(alias = "gst_rtsp_media_get_publish_clock_mode")]
499 #[doc(alias = "get_publish_clock_mode")]
500 fn publish_clock_mode(&self) -> RTSPPublishClockMode {
501 unsafe {
502 from_glib(ffi::gst_rtsp_media_get_publish_clock_mode(
503 self.as_ref().to_glib_none().0,
504 ))
505 }
506 }
507
508 #[doc(alias = "gst_rtsp_media_get_range_string")]
519 #[doc(alias = "get_range_string")]
520 fn range_string(&self, play: bool, unit: gst_rtsp::RTSPRangeUnit) -> Option<glib::GString> {
521 unsafe {
522 from_glib_full(ffi::gst_rtsp_media_get_range_string(
523 self.as_ref().to_glib_none().0,
524 play.into_glib(),
525 unit.into_glib(),
526 ))
527 }
528 }
529
530 #[cfg(feature = "v1_18")]
536 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
537 #[doc(alias = "gst_rtsp_media_get_rate_control")]
538 #[doc(alias = "get_rate_control")]
539 fn is_rate_control(&self) -> bool {
540 unsafe {
541 from_glib(ffi::gst_rtsp_media_get_rate_control(
542 self.as_ref().to_glib_none().0,
543 ))
544 }
545 }
546
547 #[cfg(feature = "v1_18")]
561 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
562 #[doc(alias = "gst_rtsp_media_get_rates")]
563 #[doc(alias = "get_rates")]
564 fn rates(&self) -> Option<(f64, f64)> {
565 unsafe {
566 let mut rate = std::mem::MaybeUninit::uninit();
567 let mut applied_rate = std::mem::MaybeUninit::uninit();
568 let ret = from_glib(ffi::gst_rtsp_media_get_rates(
569 self.as_ref().to_glib_none().0,
570 rate.as_mut_ptr(),
571 applied_rate.as_mut_ptr(),
572 ));
573 if ret {
574 Some((rate.assume_init(), applied_rate.assume_init()))
575 } else {
576 None
577 }
578 }
579 }
580
581 #[doc(alias = "gst_rtsp_media_get_retransmission_time")]
587 #[doc(alias = "get_retransmission_time")]
588 fn retransmission_time(&self) -> Option<gst::ClockTime> {
589 unsafe {
590 from_glib(ffi::gst_rtsp_media_get_retransmission_time(
591 self.as_ref().to_glib_none().0,
592 ))
593 }
594 }
595
596 #[doc(alias = "gst_rtsp_media_get_status")]
603 #[doc(alias = "get_status")]
604 fn status(&self) -> RTSPMediaStatus {
605 unsafe {
606 from_glib(ffi::gst_rtsp_media_get_status(
607 self.as_ref().to_glib_none().0,
608 ))
609 }
610 }
611
612 #[doc(alias = "gst_rtsp_media_get_stream")]
621 #[doc(alias = "get_stream")]
622 fn stream(&self, idx: u32) -> Option<RTSPStream> {
623 unsafe {
624 from_glib_none(ffi::gst_rtsp_media_get_stream(
625 self.as_ref().to_glib_none().0,
626 idx,
627 ))
628 }
629 }
630
631 #[doc(alias = "gst_rtsp_media_get_suspend_mode")]
637 #[doc(alias = "get_suspend_mode")]
638 #[doc(alias = "suspend-mode")]
639 fn suspend_mode(&self) -> RTSPSuspendMode {
640 unsafe {
641 from_glib(ffi::gst_rtsp_media_get_suspend_mode(
642 self.as_ref().to_glib_none().0,
643 ))
644 }
645 }
646
647 #[doc(alias = "gst_rtsp_media_get_time_provider")]
658 #[doc(alias = "get_time_provider")]
659 #[doc(alias = "time-provider")]
660 fn time_provider(&self, address: Option<&str>, port: u16) -> Option<gst_net::NetTimeProvider> {
661 unsafe {
662 from_glib_full(ffi::gst_rtsp_media_get_time_provider(
663 self.as_ref().to_glib_none().0,
664 address.to_glib_none().0,
665 port,
666 ))
667 }
668 }
669
670 #[doc(alias = "gst_rtsp_media_get_transport_mode")]
676 #[doc(alias = "get_transport_mode")]
677 #[doc(alias = "transport-mode")]
678 fn transport_mode(&self) -> RTSPTransportMode {
679 unsafe {
680 from_glib(ffi::gst_rtsp_media_get_transport_mode(
681 self.as_ref().to_glib_none().0,
682 ))
683 }
684 }
685
686 #[cfg(feature = "v1_18")]
697 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
698 #[doc(alias = "gst_rtsp_media_has_completed_sender")]
699 fn has_completed_sender(&self) -> bool {
700 unsafe {
701 from_glib(ffi::gst_rtsp_media_has_completed_sender(
702 self.as_ref().to_glib_none().0,
703 ))
704 }
705 }
706
707 #[cfg(feature = "v1_16")]
713 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
714 #[doc(alias = "gst_rtsp_media_is_bind_mcast_address")]
715 #[doc(alias = "bind-mcast-address")]
716 fn is_bind_mcast_address(&self) -> bool {
717 unsafe {
718 from_glib(ffi::gst_rtsp_media_is_bind_mcast_address(
719 self.as_ref().to_glib_none().0,
720 ))
721 }
722 }
723
724 #[doc(alias = "gst_rtsp_media_is_eos_shutdown")]
731 #[doc(alias = "eos-shutdown")]
732 fn is_eos_shutdown(&self) -> bool {
733 unsafe {
734 from_glib(ffi::gst_rtsp_media_is_eos_shutdown(
735 self.as_ref().to_glib_none().0,
736 ))
737 }
738 }
739
740 #[cfg(feature = "v1_18")]
745 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
746 #[doc(alias = "gst_rtsp_media_is_receive_only")]
747 fn is_receive_only(&self) -> bool {
748 unsafe {
749 from_glib(ffi::gst_rtsp_media_is_receive_only(
750 self.as_ref().to_glib_none().0,
751 ))
752 }
753 }
754
755 #[doc(alias = "gst_rtsp_media_is_reusable")]
761 #[doc(alias = "reusable")]
762 fn is_reusable(&self) -> bool {
763 unsafe {
764 from_glib(ffi::gst_rtsp_media_is_reusable(
765 self.as_ref().to_glib_none().0,
766 ))
767 }
768 }
769
770 #[doc(alias = "gst_rtsp_media_is_shared")]
781 #[doc(alias = "shared")]
782 fn is_shared(&self) -> bool {
783 unsafe {
784 from_glib(ffi::gst_rtsp_media_is_shared(
785 self.as_ref().to_glib_none().0,
786 ))
787 }
788 }
789
790 #[doc(alias = "gst_rtsp_media_is_stop_on_disconnect")]
798 #[doc(alias = "stop-on-disconnect")]
799 fn is_stop_on_disconnect(&self) -> bool {
800 unsafe {
801 from_glib(ffi::gst_rtsp_media_is_stop_on_disconnect(
802 self.as_ref().to_glib_none().0,
803 ))
804 }
805 }
806
807 #[doc(alias = "gst_rtsp_media_is_time_provider")]
815 #[doc(alias = "time-provider")]
816 fn is_time_provider(&self) -> bool {
817 unsafe {
818 from_glib(ffi::gst_rtsp_media_is_time_provider(
819 self.as_ref().to_glib_none().0,
820 ))
821 }
822 }
823
824 #[cfg(feature = "v1_18")]
834 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
835 #[doc(alias = "gst_rtsp_media_lock")]
836 fn lock(&self) {
837 unsafe {
838 ffi::gst_rtsp_media_lock(self.as_ref().to_glib_none().0);
839 }
840 }
841
842 #[doc(alias = "gst_rtsp_media_n_streams")]
848 fn n_streams(&self) -> u32 {
849 unsafe { ffi::gst_rtsp_media_n_streams(self.as_ref().to_glib_none().0) }
850 }
851
852 #[doc(alias = "gst_rtsp_media_prepare")]
866 fn prepare(&self, thread: Option<RTSPThread>) -> Result<(), glib::error::BoolError> {
867 unsafe {
868 glib::result_from_gboolean!(
869 ffi::gst_rtsp_media_prepare(self.as_ref().to_glib_none().0, thread.into_glib_ptr()),
870 "Failed to prepare media"
871 )
872 }
873 }
874
875 #[doc(alias = "gst_rtsp_media_set_address_pool")]
903 fn set_address_pool(&self, pool: Option<&impl IsA<RTSPAddressPool>>) {
904 unsafe {
905 ffi::gst_rtsp_media_set_address_pool(
906 self.as_ref().to_glib_none().0,
907 pool.map(|p| p.as_ref()).to_glib_none().0,
908 );
909 }
910 }
911
912 #[cfg(feature = "v1_16")]
917 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
918 #[doc(alias = "gst_rtsp_media_set_bind_mcast_address")]
919 #[doc(alias = "bind-mcast-address")]
920 fn set_bind_mcast_address(&self, bind_mcast_addr: bool) {
921 unsafe {
922 ffi::gst_rtsp_media_set_bind_mcast_address(
923 self.as_ref().to_glib_none().0,
924 bind_mcast_addr.into_glib(),
925 );
926 }
927 }
928
929 #[doc(alias = "gst_rtsp_media_set_buffer_size")]
933 #[doc(alias = "buffer-size")]
934 fn set_buffer_size(&self, size: u32) {
935 unsafe {
936 ffi::gst_rtsp_media_set_buffer_size(self.as_ref().to_glib_none().0, size);
937 }
938 }
939
940 #[doc(alias = "gst_rtsp_media_set_clock")]
944 #[doc(alias = "clock")]
945 fn set_clock(&self, clock: Option<&impl IsA<gst::Clock>>) {
946 unsafe {
947 ffi::gst_rtsp_media_set_clock(
948 self.as_ref().to_glib_none().0,
949 clock.map(|p| p.as_ref()).to_glib_none().0,
950 );
951 }
952 }
953
954 #[cfg(feature = "v1_16")]
956 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
957 #[doc(alias = "gst_rtsp_media_set_do_retransmission")]
958 fn set_do_retransmission(&self, do_retransmission: bool) {
959 unsafe {
960 ffi::gst_rtsp_media_set_do_retransmission(
961 self.as_ref().to_glib_none().0,
962 do_retransmission.into_glib(),
963 );
964 }
965 }
966
967 #[cfg(feature = "v1_18")]
971 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
972 #[doc(alias = "gst_rtsp_media_set_dscp_qos")]
973 #[doc(alias = "dscp-qos")]
974 fn set_dscp_qos(&self, dscp_qos: i32) {
975 unsafe {
976 ffi::gst_rtsp_media_set_dscp_qos(self.as_ref().to_glib_none().0, dscp_qos);
977 }
978 }
979
980 #[cfg(feature = "v1_24")]
988 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
989 #[doc(alias = "gst_rtsp_media_set_ensure_keyunit_on_start")]
990 #[doc(alias = "ensure-keyunit-on-start")]
991 fn set_ensure_keyunit_on_start(&self, ensure_keyunit_on_start: bool) {
992 unsafe {
993 ffi::gst_rtsp_media_set_ensure_keyunit_on_start(
994 self.as_ref().to_glib_none().0,
995 ensure_keyunit_on_start.into_glib(),
996 );
997 }
998 }
999
1000 #[cfg(feature = "v1_24")]
1008 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1009 #[doc(alias = "gst_rtsp_media_set_ensure_keyunit_on_start_timeout")]
1010 #[doc(alias = "ensure-keyunit-on-start-timeout")]
1011 fn set_ensure_keyunit_on_start_timeout(&self, timeout: u32) {
1012 unsafe {
1013 ffi::gst_rtsp_media_set_ensure_keyunit_on_start_timeout(
1014 self.as_ref().to_glib_none().0,
1015 timeout,
1016 );
1017 }
1018 }
1019
1020 #[doc(alias = "gst_rtsp_media_set_eos_shutdown")]
1025 #[doc(alias = "eos-shutdown")]
1026 fn set_eos_shutdown(&self, eos_shutdown: bool) {
1027 unsafe {
1028 ffi::gst_rtsp_media_set_eos_shutdown(
1029 self.as_ref().to_glib_none().0,
1030 eos_shutdown.into_glib(),
1031 );
1032 }
1033 }
1034
1035 #[doc(alias = "gst_rtsp_media_set_latency")]
1039 #[doc(alias = "latency")]
1040 fn set_latency(&self, latency: u32) {
1041 unsafe {
1042 ffi::gst_rtsp_media_set_latency(self.as_ref().to_glib_none().0, latency);
1043 }
1044 }
1045
1046 #[cfg(feature = "v1_16")]
1054 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
1055 #[doc(alias = "gst_rtsp_media_set_max_mcast_ttl")]
1056 #[doc(alias = "max-mcast-ttl")]
1057 fn set_max_mcast_ttl(&self, ttl: u32) -> bool {
1058 unsafe {
1059 from_glib(ffi::gst_rtsp_media_set_max_mcast_ttl(
1060 self.as_ref().to_glib_none().0,
1061 ttl,
1062 ))
1063 }
1064 }
1065
1066 #[doc(alias = "gst_rtsp_media_set_multicast_iface")]
1070 fn set_multicast_iface(&self, multicast_iface: Option<&str>) {
1071 unsafe {
1072 ffi::gst_rtsp_media_set_multicast_iface(
1073 self.as_ref().to_glib_none().0,
1074 multicast_iface.to_glib_none().0,
1075 );
1076 }
1077 }
1078
1079 #[doc(alias = "gst_rtsp_media_set_pipeline_state")]
1088 fn set_pipeline_state(&self, state: gst::State) {
1089 unsafe {
1090 ffi::gst_rtsp_media_set_pipeline_state(
1091 self.as_ref().to_glib_none().0,
1092 state.into_glib(),
1093 );
1094 }
1095 }
1096
1097 #[doc(alias = "gst_rtsp_media_set_profiles")]
1101 #[doc(alias = "profiles")]
1102 fn set_profiles(&self, profiles: gst_rtsp::RTSPProfile) {
1103 unsafe {
1104 ffi::gst_rtsp_media_set_profiles(self.as_ref().to_glib_none().0, profiles.into_glib());
1105 }
1106 }
1107
1108 #[doc(alias = "gst_rtsp_media_set_protocols")]
1112 #[doc(alias = "protocols")]
1113 fn set_protocols(&self, protocols: gst_rtsp::RTSPLowerTrans) {
1114 unsafe {
1115 ffi::gst_rtsp_media_set_protocols(
1116 self.as_ref().to_glib_none().0,
1117 protocols.into_glib(),
1118 );
1119 }
1120 }
1121
1122 #[doc(alias = "gst_rtsp_media_set_publish_clock_mode")]
1126 fn set_publish_clock_mode(&self, mode: RTSPPublishClockMode) {
1127 unsafe {
1128 ffi::gst_rtsp_media_set_publish_clock_mode(
1129 self.as_ref().to_glib_none().0,
1130 mode.into_glib(),
1131 );
1132 }
1133 }
1134
1135 #[cfg(feature = "v1_18")]
1138 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1139 #[doc(alias = "gst_rtsp_media_set_rate_control")]
1140 fn set_rate_control(&self, enabled: bool) {
1141 unsafe {
1142 ffi::gst_rtsp_media_set_rate_control(
1143 self.as_ref().to_glib_none().0,
1144 enabled.into_glib(),
1145 );
1146 }
1147 }
1148
1149 #[doc(alias = "gst_rtsp_media_set_retransmission_time")]
1153 fn set_retransmission_time(&self, time: impl Into<Option<gst::ClockTime>>) {
1154 unsafe {
1155 ffi::gst_rtsp_media_set_retransmission_time(
1156 self.as_ref().to_glib_none().0,
1157 time.into().into_glib(),
1158 );
1159 }
1160 }
1161
1162 #[doc(alias = "gst_rtsp_media_set_reusable")]
1167 #[doc(alias = "reusable")]
1168 fn set_reusable(&self, reusable: bool) {
1169 unsafe {
1170 ffi::gst_rtsp_media_set_reusable(self.as_ref().to_glib_none().0, reusable.into_glib());
1171 }
1172 }
1173
1174 #[doc(alias = "gst_rtsp_media_set_shared")]
1180 #[doc(alias = "shared")]
1181 fn set_shared(&self, shared: bool) {
1182 unsafe {
1183 ffi::gst_rtsp_media_set_shared(self.as_ref().to_glib_none().0, shared.into_glib());
1184 }
1185 }
1186
1187 #[doc(alias = "gst_rtsp_media_set_state")]
1200 fn set_state(&self, state: gst::State, transports: &[RTSPStreamTransport]) -> bool {
1201 unsafe {
1202 from_glib(ffi::gst_rtsp_media_set_state(
1203 self.as_ref().to_glib_none().0,
1204 state.into_glib(),
1205 transports.to_glib_none().0,
1206 ))
1207 }
1208 }
1209
1210 #[doc(alias = "gst_rtsp_media_set_stop_on_disconnect")]
1215 #[doc(alias = "stop-on-disconnect")]
1216 fn set_stop_on_disconnect(&self, stop_on_disconnect: bool) {
1217 unsafe {
1218 ffi::gst_rtsp_media_set_stop_on_disconnect(
1219 self.as_ref().to_glib_none().0,
1220 stop_on_disconnect.into_glib(),
1221 );
1222 }
1223 }
1224
1225 #[doc(alias = "gst_rtsp_media_set_suspend_mode")]
1232 #[doc(alias = "suspend-mode")]
1233 fn set_suspend_mode(&self, mode: RTSPSuspendMode) {
1234 unsafe {
1235 ffi::gst_rtsp_media_set_suspend_mode(self.as_ref().to_glib_none().0, mode.into_glib());
1236 }
1237 }
1238
1239 #[doc(alias = "gst_rtsp_media_set_transport_mode")]
1243 #[doc(alias = "transport-mode")]
1244 fn set_transport_mode(&self, mode: RTSPTransportMode) {
1245 unsafe {
1246 ffi::gst_rtsp_media_set_transport_mode(
1247 self.as_ref().to_glib_none().0,
1248 mode.into_glib(),
1249 );
1250 }
1251 }
1252
1253 #[doc(alias = "gst_rtsp_media_suspend")]
1268 fn suspend(&self) -> Result<(), glib::error::BoolError> {
1269 unsafe {
1270 glib::result_from_gboolean!(
1271 ffi::gst_rtsp_media_suspend(self.as_ref().to_glib_none().0),
1272 "Failed to suspend media"
1273 )
1274 }
1275 }
1276
1277 #[cfg(feature = "v1_18")]
1279 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1280 #[doc(alias = "gst_rtsp_media_unlock")]
1281 fn unlock(&self) {
1282 unsafe {
1283 ffi::gst_rtsp_media_unlock(self.as_ref().to_glib_none().0);
1284 }
1285 }
1286
1287 #[doc(alias = "gst_rtsp_media_unprepare")]
1295 fn unprepare(&self) -> Result<(), glib::error::BoolError> {
1296 unsafe {
1297 glib::result_from_gboolean!(
1298 ffi::gst_rtsp_media_unprepare(self.as_ref().to_glib_none().0),
1299 "Failed to unprepare media"
1300 )
1301 }
1302 }
1303
1304 #[doc(alias = "gst_rtsp_media_unsuspend")]
1311 fn unsuspend(&self) -> Result<(), glib::error::BoolError> {
1312 unsafe {
1313 glib::result_from_gboolean!(
1314 ffi::gst_rtsp_media_unsuspend(self.as_ref().to_glib_none().0),
1315 "Failed to unsuspend media"
1316 )
1317 }
1318 }
1319
1320 #[doc(alias = "gst_rtsp_media_use_time_provider")]
1324 fn use_time_provider(&self, time_provider: bool) {
1325 unsafe {
1326 ffi::gst_rtsp_media_use_time_provider(
1327 self.as_ref().to_glib_none().0,
1328 time_provider.into_glib(),
1329 );
1330 }
1331 }
1332
1333 #[cfg(not(feature = "v1_16"))]
1334 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
1335 #[doc(alias = "bind-mcast-address")]
1336 fn is_bind_mcast_address(&self) -> bool {
1337 ObjectExt::property(self.as_ref(), "bind-mcast-address")
1338 }
1339
1340 #[cfg(not(feature = "v1_16"))]
1341 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
1342 #[doc(alias = "bind-mcast-address")]
1343 fn set_bind_mcast_address(&self, bind_mcast_address: bool) {
1344 ObjectExt::set_property(self.as_ref(), "bind-mcast-address", bind_mcast_address)
1345 }
1346
1347 #[cfg(not(feature = "v1_18"))]
1348 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_18"))))]
1349 #[doc(alias = "dscp-qos")]
1350 fn dscp_qos(&self) -> i32 {
1351 ObjectExt::property(self.as_ref(), "dscp-qos")
1352 }
1353
1354 #[cfg(not(feature = "v1_18"))]
1355 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_18"))))]
1356 #[doc(alias = "dscp-qos")]
1357 fn set_dscp_qos(&self, dscp_qos: i32) {
1358 ObjectExt::set_property(self.as_ref(), "dscp-qos", dscp_qos)
1359 }
1360
1361 #[cfg(not(feature = "v1_16"))]
1362 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
1363 #[doc(alias = "max-mcast-ttl")]
1364 fn max_mcast_ttl(&self) -> u32 {
1365 ObjectExt::property(self.as_ref(), "max-mcast-ttl")
1366 }
1367
1368 #[cfg(not(feature = "v1_16"))]
1369 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
1370 #[doc(alias = "max-mcast-ttl")]
1371 fn set_max_mcast_ttl(&self, max_mcast_ttl: u32) {
1372 ObjectExt::set_property(self.as_ref(), "max-mcast-ttl", max_mcast_ttl)
1373 }
1374
1375 #[doc(alias = "time-provider")]
1376 fn set_time_provider(&self, time_provider: bool) {
1377 ObjectExt::set_property(self.as_ref(), "time-provider", time_provider)
1378 }
1379
1380 #[cfg(feature = "v1_22")]
1388 #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
1389 #[doc(alias = "handle-message")]
1390 fn connect_handle_message<F: Fn(&Self, &gst::Message) -> bool + Send + Sync + 'static>(
1391 &self,
1392 detail: Option<&str>,
1393 f: F,
1394 ) -> SignalHandlerId {
1395 unsafe extern "C" fn handle_message_trampoline<
1396 P: IsA<RTSPMedia>,
1397 F: Fn(&P, &gst::Message) -> bool + Send + Sync + 'static,
1398 >(
1399 this: *mut ffi::GstRTSPMedia,
1400 message: *mut gst::ffi::GstMessage,
1401 f: glib::ffi::gpointer,
1402 ) -> glib::ffi::gboolean {
1403 let f: &F = &*(f as *const F);
1404 f(
1405 RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(),
1406 &from_glib_borrow(message),
1407 )
1408 .into_glib()
1409 }
1410 unsafe {
1411 let f: Box_<F> = Box_::new(f);
1412 let detailed_signal_name = detail.map(|name| format!("handle-message::{name}\0"));
1413 let signal_name: &[u8] = detailed_signal_name
1414 .as_ref()
1415 .map_or(&b"handle-message\0"[..], |n| n.as_bytes());
1416 connect_raw(
1417 self.as_ptr() as *mut _,
1418 signal_name.as_ptr() as *const _,
1419 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1420 handle_message_trampoline::<Self, F> as *const (),
1421 )),
1422 Box_::into_raw(f),
1423 )
1424 }
1425 }
1426
1427 #[doc(alias = "new-state")]
1428 fn connect_new_state<F: Fn(&Self, i32) + Send + Sync + 'static>(
1429 &self,
1430 f: F,
1431 ) -> SignalHandlerId {
1432 unsafe extern "C" fn new_state_trampoline<
1433 P: IsA<RTSPMedia>,
1434 F: Fn(&P, i32) + Send + Sync + 'static,
1435 >(
1436 this: *mut ffi::GstRTSPMedia,
1437 object: std::ffi::c_int,
1438 f: glib::ffi::gpointer,
1439 ) {
1440 let f: &F = &*(f as *const F);
1441 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(), object)
1442 }
1443 unsafe {
1444 let f: Box_<F> = Box_::new(f);
1445 connect_raw(
1446 self.as_ptr() as *mut _,
1447 b"new-state\0".as_ptr() as *const _,
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 let f: &F = &*(f as *const F);
1470 f(
1471 RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(),
1472 &from_glib_borrow(object),
1473 )
1474 }
1475 unsafe {
1476 let f: Box_<F> = Box_::new(f);
1477 connect_raw(
1478 self.as_ptr() as *mut _,
1479 b"new-stream\0".as_ptr() as *const _,
1480 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1481 new_stream_trampoline::<Self, F> as *const (),
1482 )),
1483 Box_::into_raw(f),
1484 )
1485 }
1486 }
1487
1488 #[doc(alias = "prepared")]
1489 fn connect_prepared<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1490 unsafe extern "C" fn prepared_trampoline<
1491 P: IsA<RTSPMedia>,
1492 F: Fn(&P) + Send + Sync + 'static,
1493 >(
1494 this: *mut ffi::GstRTSPMedia,
1495 f: glib::ffi::gpointer,
1496 ) {
1497 let f: &F = &*(f as *const F);
1498 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1499 }
1500 unsafe {
1501 let f: Box_<F> = Box_::new(f);
1502 connect_raw(
1503 self.as_ptr() as *mut _,
1504 b"prepared\0".as_ptr() as *const _,
1505 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1506 prepared_trampoline::<Self, F> as *const (),
1507 )),
1508 Box_::into_raw(f),
1509 )
1510 }
1511 }
1512
1513 #[doc(alias = "removed-stream")]
1514 fn connect_removed_stream<F: Fn(&Self, &RTSPStream) + Send + Sync + 'static>(
1515 &self,
1516 f: F,
1517 ) -> SignalHandlerId {
1518 unsafe extern "C" fn removed_stream_trampoline<
1519 P: IsA<RTSPMedia>,
1520 F: Fn(&P, &RTSPStream) + Send + Sync + 'static,
1521 >(
1522 this: *mut ffi::GstRTSPMedia,
1523 object: *mut ffi::GstRTSPStream,
1524 f: glib::ffi::gpointer,
1525 ) {
1526 let f: &F = &*(f as *const F);
1527 f(
1528 RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(),
1529 &from_glib_borrow(object),
1530 )
1531 }
1532 unsafe {
1533 let f: Box_<F> = Box_::new(f);
1534 connect_raw(
1535 self.as_ptr() as *mut _,
1536 b"removed-stream\0".as_ptr() as *const _,
1537 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1538 removed_stream_trampoline::<Self, F> as *const (),
1539 )),
1540 Box_::into_raw(f),
1541 )
1542 }
1543 }
1544
1545 #[doc(alias = "target-state")]
1546 fn connect_target_state<F: Fn(&Self, i32) + Send + Sync + 'static>(
1547 &self,
1548 f: F,
1549 ) -> SignalHandlerId {
1550 unsafe extern "C" fn target_state_trampoline<
1551 P: IsA<RTSPMedia>,
1552 F: Fn(&P, i32) + Send + Sync + 'static,
1553 >(
1554 this: *mut ffi::GstRTSPMedia,
1555 object: std::ffi::c_int,
1556 f: glib::ffi::gpointer,
1557 ) {
1558 let f: &F = &*(f as *const F);
1559 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(), object)
1560 }
1561 unsafe {
1562 let f: Box_<F> = Box_::new(f);
1563 connect_raw(
1564 self.as_ptr() as *mut _,
1565 b"target-state\0".as_ptr() as *const _,
1566 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1567 target_state_trampoline::<Self, F> as *const (),
1568 )),
1569 Box_::into_raw(f),
1570 )
1571 }
1572 }
1573
1574 #[doc(alias = "unprepared")]
1575 fn connect_unprepared<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1576 unsafe extern "C" fn unprepared_trampoline<
1577 P: IsA<RTSPMedia>,
1578 F: Fn(&P) + Send + Sync + 'static,
1579 >(
1580 this: *mut ffi::GstRTSPMedia,
1581 f: glib::ffi::gpointer,
1582 ) {
1583 let f: &F = &*(f as *const F);
1584 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1585 }
1586 unsafe {
1587 let f: Box_<F> = Box_::new(f);
1588 connect_raw(
1589 self.as_ptr() as *mut _,
1590 b"unprepared\0".as_ptr() as *const _,
1591 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1592 unprepared_trampoline::<Self, F> as *const (),
1593 )),
1594 Box_::into_raw(f),
1595 )
1596 }
1597 }
1598
1599 #[doc(alias = "bind-mcast-address")]
1600 fn connect_bind_mcast_address_notify<F: Fn(&Self) + Send + Sync + 'static>(
1601 &self,
1602 f: F,
1603 ) -> SignalHandlerId {
1604 unsafe extern "C" fn notify_bind_mcast_address_trampoline<
1605 P: IsA<RTSPMedia>,
1606 F: Fn(&P) + Send + Sync + 'static,
1607 >(
1608 this: *mut ffi::GstRTSPMedia,
1609 _param_spec: glib::ffi::gpointer,
1610 f: glib::ffi::gpointer,
1611 ) {
1612 let f: &F = &*(f as *const F);
1613 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1614 }
1615 unsafe {
1616 let f: Box_<F> = Box_::new(f);
1617 connect_raw(
1618 self.as_ptr() as *mut _,
1619 b"notify::bind-mcast-address\0".as_ptr() as *const _,
1620 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1621 notify_bind_mcast_address_trampoline::<Self, F> as *const (),
1622 )),
1623 Box_::into_raw(f),
1624 )
1625 }
1626 }
1627
1628 #[doc(alias = "buffer-size")]
1629 fn connect_buffer_size_notify<F: Fn(&Self) + Send + Sync + 'static>(
1630 &self,
1631 f: F,
1632 ) -> SignalHandlerId {
1633 unsafe extern "C" fn notify_buffer_size_trampoline<
1634 P: IsA<RTSPMedia>,
1635 F: Fn(&P) + Send + Sync + 'static,
1636 >(
1637 this: *mut ffi::GstRTSPMedia,
1638 _param_spec: glib::ffi::gpointer,
1639 f: glib::ffi::gpointer,
1640 ) {
1641 let f: &F = &*(f as *const F);
1642 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1643 }
1644 unsafe {
1645 let f: Box_<F> = Box_::new(f);
1646 connect_raw(
1647 self.as_ptr() as *mut _,
1648 b"notify::buffer-size\0".as_ptr() as *const _,
1649 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1650 notify_buffer_size_trampoline::<Self, F> as *const (),
1651 )),
1652 Box_::into_raw(f),
1653 )
1654 }
1655 }
1656
1657 #[doc(alias = "clock")]
1658 fn connect_clock_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1659 unsafe extern "C" fn notify_clock_trampoline<
1660 P: IsA<RTSPMedia>,
1661 F: Fn(&P) + Send + Sync + 'static,
1662 >(
1663 this: *mut ffi::GstRTSPMedia,
1664 _param_spec: glib::ffi::gpointer,
1665 f: glib::ffi::gpointer,
1666 ) {
1667 let f: &F = &*(f as *const F);
1668 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1669 }
1670 unsafe {
1671 let f: Box_<F> = Box_::new(f);
1672 connect_raw(
1673 self.as_ptr() as *mut _,
1674 b"notify::clock\0".as_ptr() as *const _,
1675 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1676 notify_clock_trampoline::<Self, F> as *const (),
1677 )),
1678 Box_::into_raw(f),
1679 )
1680 }
1681 }
1682
1683 #[doc(alias = "dscp-qos")]
1684 fn connect_dscp_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(
1685 &self,
1686 f: F,
1687 ) -> SignalHandlerId {
1688 unsafe extern "C" fn notify_dscp_qos_trampoline<
1689 P: IsA<RTSPMedia>,
1690 F: Fn(&P) + Send + Sync + 'static,
1691 >(
1692 this: *mut ffi::GstRTSPMedia,
1693 _param_spec: glib::ffi::gpointer,
1694 f: glib::ffi::gpointer,
1695 ) {
1696 let f: &F = &*(f as *const F);
1697 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1698 }
1699 unsafe {
1700 let f: Box_<F> = Box_::new(f);
1701 connect_raw(
1702 self.as_ptr() as *mut _,
1703 b"notify::dscp-qos\0".as_ptr() as *const _,
1704 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1705 notify_dscp_qos_trampoline::<Self, F> as *const (),
1706 )),
1707 Box_::into_raw(f),
1708 )
1709 }
1710 }
1711
1712 #[cfg(feature = "v1_24")]
1713 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1714 #[doc(alias = "ensure-keyunit-on-start")]
1715 fn connect_ensure_keyunit_on_start_notify<F: Fn(&Self) + Send + Sync + 'static>(
1716 &self,
1717 f: F,
1718 ) -> SignalHandlerId {
1719 unsafe extern "C" fn notify_ensure_keyunit_on_start_trampoline<
1720 P: IsA<RTSPMedia>,
1721 F: Fn(&P) + Send + Sync + 'static,
1722 >(
1723 this: *mut ffi::GstRTSPMedia,
1724 _param_spec: glib::ffi::gpointer,
1725 f: glib::ffi::gpointer,
1726 ) {
1727 let f: &F = &*(f as *const F);
1728 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1729 }
1730 unsafe {
1731 let f: Box_<F> = Box_::new(f);
1732 connect_raw(
1733 self.as_ptr() as *mut _,
1734 b"notify::ensure-keyunit-on-start\0".as_ptr() as *const _,
1735 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1736 notify_ensure_keyunit_on_start_trampoline::<Self, F> as *const (),
1737 )),
1738 Box_::into_raw(f),
1739 )
1740 }
1741 }
1742
1743 #[cfg(feature = "v1_24")]
1744 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1745 #[doc(alias = "ensure-keyunit-on-start-timeout")]
1746 fn connect_ensure_keyunit_on_start_timeout_notify<F: Fn(&Self) + Send + Sync + 'static>(
1747 &self,
1748 f: F,
1749 ) -> SignalHandlerId {
1750 unsafe extern "C" fn notify_ensure_keyunit_on_start_timeout_trampoline<
1751 P: IsA<RTSPMedia>,
1752 F: Fn(&P) + Send + Sync + 'static,
1753 >(
1754 this: *mut ffi::GstRTSPMedia,
1755 _param_spec: glib::ffi::gpointer,
1756 f: glib::ffi::gpointer,
1757 ) {
1758 let f: &F = &*(f as *const F);
1759 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1760 }
1761 unsafe {
1762 let f: Box_<F> = Box_::new(f);
1763 connect_raw(
1764 self.as_ptr() as *mut _,
1765 b"notify::ensure-keyunit-on-start-timeout\0".as_ptr() as *const _,
1766 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1767 notify_ensure_keyunit_on_start_timeout_trampoline::<Self, F> as *const (),
1768 )),
1769 Box_::into_raw(f),
1770 )
1771 }
1772 }
1773
1774 #[doc(alias = "eos-shutdown")]
1775 fn connect_eos_shutdown_notify<F: Fn(&Self) + Send + Sync + 'static>(
1776 &self,
1777 f: F,
1778 ) -> SignalHandlerId {
1779 unsafe extern "C" fn notify_eos_shutdown_trampoline<
1780 P: IsA<RTSPMedia>,
1781 F: Fn(&P) + Send + Sync + 'static,
1782 >(
1783 this: *mut ffi::GstRTSPMedia,
1784 _param_spec: glib::ffi::gpointer,
1785 f: glib::ffi::gpointer,
1786 ) {
1787 let f: &F = &*(f as *const F);
1788 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1789 }
1790 unsafe {
1791 let f: Box_<F> = Box_::new(f);
1792 connect_raw(
1793 self.as_ptr() as *mut _,
1794 b"notify::eos-shutdown\0".as_ptr() as *const _,
1795 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1796 notify_eos_shutdown_trampoline::<Self, F> as *const (),
1797 )),
1798 Box_::into_raw(f),
1799 )
1800 }
1801 }
1802
1803 #[doc(alias = "latency")]
1804 fn connect_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(
1805 &self,
1806 f: F,
1807 ) -> SignalHandlerId {
1808 unsafe extern "C" fn notify_latency_trampoline<
1809 P: IsA<RTSPMedia>,
1810 F: Fn(&P) + Send + Sync + 'static,
1811 >(
1812 this: *mut ffi::GstRTSPMedia,
1813 _param_spec: glib::ffi::gpointer,
1814 f: glib::ffi::gpointer,
1815 ) {
1816 let f: &F = &*(f as *const F);
1817 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1818 }
1819 unsafe {
1820 let f: Box_<F> = Box_::new(f);
1821 connect_raw(
1822 self.as_ptr() as *mut _,
1823 b"notify::latency\0".as_ptr() as *const _,
1824 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1825 notify_latency_trampoline::<Self, F> as *const (),
1826 )),
1827 Box_::into_raw(f),
1828 )
1829 }
1830 }
1831
1832 #[doc(alias = "max-mcast-ttl")]
1833 fn connect_max_mcast_ttl_notify<F: Fn(&Self) + Send + Sync + 'static>(
1834 &self,
1835 f: F,
1836 ) -> SignalHandlerId {
1837 unsafe extern "C" fn notify_max_mcast_ttl_trampoline<
1838 P: IsA<RTSPMedia>,
1839 F: Fn(&P) + Send + Sync + 'static,
1840 >(
1841 this: *mut ffi::GstRTSPMedia,
1842 _param_spec: glib::ffi::gpointer,
1843 f: glib::ffi::gpointer,
1844 ) {
1845 let f: &F = &*(f as *const F);
1846 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1847 }
1848 unsafe {
1849 let f: Box_<F> = Box_::new(f);
1850 connect_raw(
1851 self.as_ptr() as *mut _,
1852 b"notify::max-mcast-ttl\0".as_ptr() as *const _,
1853 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1854 notify_max_mcast_ttl_trampoline::<Self, F> as *const (),
1855 )),
1856 Box_::into_raw(f),
1857 )
1858 }
1859 }
1860
1861 #[doc(alias = "profiles")]
1862 fn connect_profiles_notify<F: Fn(&Self) + Send + Sync + 'static>(
1863 &self,
1864 f: F,
1865 ) -> SignalHandlerId {
1866 unsafe extern "C" fn notify_profiles_trampoline<
1867 P: IsA<RTSPMedia>,
1868 F: Fn(&P) + Send + Sync + 'static,
1869 >(
1870 this: *mut ffi::GstRTSPMedia,
1871 _param_spec: glib::ffi::gpointer,
1872 f: glib::ffi::gpointer,
1873 ) {
1874 let f: &F = &*(f as *const F);
1875 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1876 }
1877 unsafe {
1878 let f: Box_<F> = Box_::new(f);
1879 connect_raw(
1880 self.as_ptr() as *mut _,
1881 b"notify::profiles\0".as_ptr() as *const _,
1882 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1883 notify_profiles_trampoline::<Self, F> as *const (),
1884 )),
1885 Box_::into_raw(f),
1886 )
1887 }
1888 }
1889
1890 #[doc(alias = "protocols")]
1891 fn connect_protocols_notify<F: Fn(&Self) + Send + Sync + 'static>(
1892 &self,
1893 f: F,
1894 ) -> SignalHandlerId {
1895 unsafe extern "C" fn notify_protocols_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 let f: &F = &*(f as *const F);
1904 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1905 }
1906 unsafe {
1907 let f: Box_<F> = Box_::new(f);
1908 connect_raw(
1909 self.as_ptr() as *mut _,
1910 b"notify::protocols\0".as_ptr() as *const _,
1911 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1912 notify_protocols_trampoline::<Self, F> as *const (),
1913 )),
1914 Box_::into_raw(f),
1915 )
1916 }
1917 }
1918
1919 #[doc(alias = "reusable")]
1920 fn connect_reusable_notify<F: Fn(&Self) + Send + Sync + 'static>(
1921 &self,
1922 f: F,
1923 ) -> SignalHandlerId {
1924 unsafe extern "C" fn notify_reusable_trampoline<
1925 P: IsA<RTSPMedia>,
1926 F: Fn(&P) + Send + Sync + 'static,
1927 >(
1928 this: *mut ffi::GstRTSPMedia,
1929 _param_spec: glib::ffi::gpointer,
1930 f: glib::ffi::gpointer,
1931 ) {
1932 let f: &F = &*(f as *const F);
1933 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1934 }
1935 unsafe {
1936 let f: Box_<F> = Box_::new(f);
1937 connect_raw(
1938 self.as_ptr() as *mut _,
1939 b"notify::reusable\0".as_ptr() as *const _,
1940 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1941 notify_reusable_trampoline::<Self, F> as *const (),
1942 )),
1943 Box_::into_raw(f),
1944 )
1945 }
1946 }
1947
1948 #[doc(alias = "shared")]
1949 fn connect_shared_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1950 unsafe extern "C" fn notify_shared_trampoline<
1951 P: IsA<RTSPMedia>,
1952 F: Fn(&P) + Send + Sync + 'static,
1953 >(
1954 this: *mut ffi::GstRTSPMedia,
1955 _param_spec: glib::ffi::gpointer,
1956 f: glib::ffi::gpointer,
1957 ) {
1958 let f: &F = &*(f as *const F);
1959 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1960 }
1961 unsafe {
1962 let f: Box_<F> = Box_::new(f);
1963 connect_raw(
1964 self.as_ptr() as *mut _,
1965 b"notify::shared\0".as_ptr() as *const _,
1966 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1967 notify_shared_trampoline::<Self, F> as *const (),
1968 )),
1969 Box_::into_raw(f),
1970 )
1971 }
1972 }
1973
1974 #[doc(alias = "stop-on-disconnect")]
1975 fn connect_stop_on_disconnect_notify<F: Fn(&Self) + Send + Sync + 'static>(
1976 &self,
1977 f: F,
1978 ) -> SignalHandlerId {
1979 unsafe extern "C" fn notify_stop_on_disconnect_trampoline<
1980 P: IsA<RTSPMedia>,
1981 F: Fn(&P) + Send + Sync + 'static,
1982 >(
1983 this: *mut ffi::GstRTSPMedia,
1984 _param_spec: glib::ffi::gpointer,
1985 f: glib::ffi::gpointer,
1986 ) {
1987 let f: &F = &*(f as *const F);
1988 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1989 }
1990 unsafe {
1991 let f: Box_<F> = Box_::new(f);
1992 connect_raw(
1993 self.as_ptr() as *mut _,
1994 b"notify::stop-on-disconnect\0".as_ptr() as *const _,
1995 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1996 notify_stop_on_disconnect_trampoline::<Self, F> as *const (),
1997 )),
1998 Box_::into_raw(f),
1999 )
2000 }
2001 }
2002
2003 #[doc(alias = "suspend-mode")]
2004 fn connect_suspend_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
2005 &self,
2006 f: F,
2007 ) -> SignalHandlerId {
2008 unsafe extern "C" fn notify_suspend_mode_trampoline<
2009 P: IsA<RTSPMedia>,
2010 F: Fn(&P) + Send + Sync + 'static,
2011 >(
2012 this: *mut ffi::GstRTSPMedia,
2013 _param_spec: glib::ffi::gpointer,
2014 f: glib::ffi::gpointer,
2015 ) {
2016 let f: &F = &*(f as *const F);
2017 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
2018 }
2019 unsafe {
2020 let f: Box_<F> = Box_::new(f);
2021 connect_raw(
2022 self.as_ptr() as *mut _,
2023 b"notify::suspend-mode\0".as_ptr() as *const _,
2024 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2025 notify_suspend_mode_trampoline::<Self, F> as *const (),
2026 )),
2027 Box_::into_raw(f),
2028 )
2029 }
2030 }
2031
2032 #[doc(alias = "time-provider")]
2033 fn connect_time_provider_notify<F: Fn(&Self) + Send + Sync + 'static>(
2034 &self,
2035 f: F,
2036 ) -> SignalHandlerId {
2037 unsafe extern "C" fn notify_time_provider_trampoline<
2038 P: IsA<RTSPMedia>,
2039 F: Fn(&P) + Send + Sync + 'static,
2040 >(
2041 this: *mut ffi::GstRTSPMedia,
2042 _param_spec: glib::ffi::gpointer,
2043 f: glib::ffi::gpointer,
2044 ) {
2045 let f: &F = &*(f as *const F);
2046 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
2047 }
2048 unsafe {
2049 let f: Box_<F> = Box_::new(f);
2050 connect_raw(
2051 self.as_ptr() as *mut _,
2052 b"notify::time-provider\0".as_ptr() as *const _,
2053 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2054 notify_time_provider_trampoline::<Self, F> as *const (),
2055 )),
2056 Box_::into_raw(f),
2057 )
2058 }
2059 }
2060
2061 #[doc(alias = "transport-mode")]
2062 fn connect_transport_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
2063 &self,
2064 f: F,
2065 ) -> SignalHandlerId {
2066 unsafe extern "C" fn notify_transport_mode_trampoline<
2067 P: IsA<RTSPMedia>,
2068 F: Fn(&P) + Send + Sync + 'static,
2069 >(
2070 this: *mut ffi::GstRTSPMedia,
2071 _param_spec: glib::ffi::gpointer,
2072 f: glib::ffi::gpointer,
2073 ) {
2074 let f: &F = &*(f as *const F);
2075 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
2076 }
2077 unsafe {
2078 let f: Box_<F> = Box_::new(f);
2079 connect_raw(
2080 self.as_ptr() as *mut _,
2081 b"notify::transport-mode\0".as_ptr() as *const _,
2082 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2083 notify_transport_mode_trampoline::<Self, F> as *const (),
2084 )),
2085 Box_::into_raw(f),
2086 )
2087 }
2088 }
2089}
2090
2091impl<O: IsA<RTSPMedia>> RTSPMediaExt for O {}