1use crate::{
7 ffi, RTSPAddressPool, RTSPMedia, RTSPPublishClockMode, RTSPSuspendMode, RTSPTransportMode,
8};
9use glib::{
10 object::ObjectType as _,
11 prelude::*,
12 signal::{connect_raw, SignalHandlerId},
13 translate::*,
14};
15use std::boxed::Box as Box_;
16
17glib::wrapper! {
18 #[doc(alias = "GstRTSPMediaFactory")]
122 pub struct RTSPMediaFactory(Object<ffi::GstRTSPMediaFactory, ffi::GstRTSPMediaFactoryClass>);
123
124 match fn {
125 type_ => || ffi::gst_rtsp_media_factory_get_type(),
126 }
127}
128
129impl RTSPMediaFactory {
130 pub const NONE: Option<&'static RTSPMediaFactory> = None;
131
132 #[doc(alias = "gst_rtsp_media_factory_new")]
138 pub fn new() -> RTSPMediaFactory {
139 assert_initialized_main_thread!();
140 unsafe { from_glib_full(ffi::gst_rtsp_media_factory_new()) }
141 }
142}
143
144impl Default for RTSPMediaFactory {
145 fn default() -> Self {
146 Self::new()
147 }
148}
149
150unsafe impl Send for RTSPMediaFactory {}
151unsafe impl Sync for RTSPMediaFactory {}
152
153pub trait RTSPMediaFactoryExt: IsA<RTSPMediaFactory> + 'static {
159 #[doc(alias = "gst_rtsp_media_factory_construct")]
182 fn construct(&self, url: &gst_rtsp::RTSPUrl) -> Result<RTSPMedia, glib::BoolError> {
183 unsafe {
184 Option::<_>::from_glib_full(ffi::gst_rtsp_media_factory_construct(
185 self.as_ref().to_glib_none().0,
186 url.to_glib_none().0,
187 ))
188 .ok_or_else(|| glib::bool_error!("Failed to construct media"))
189 }
190 }
191
192 #[doc(alias = "gst_rtsp_media_factory_create_element")]
205 fn create_element(&self, url: &gst_rtsp::RTSPUrl) -> Result<gst::Element, glib::BoolError> {
206 unsafe {
207 Option::<_>::from_glib_none(ffi::gst_rtsp_media_factory_create_element(
208 self.as_ref().to_glib_none().0,
209 url.to_glib_none().0,
210 ))
211 .ok_or_else(|| glib::bool_error!("Failed to create media element"))
212 }
213 }
214
215 #[doc(alias = "gst_rtsp_media_factory_get_address_pool")]
222 #[doc(alias = "get_address_pool")]
223 fn address_pool(&self) -> Option<RTSPAddressPool> {
224 unsafe {
225 from_glib_full(ffi::gst_rtsp_media_factory_get_address_pool(
226 self.as_ref().to_glib_none().0,
227 ))
228 }
229 }
230
231 #[doc(alias = "gst_rtsp_media_factory_get_buffer_size")]
237 #[doc(alias = "get_buffer_size")]
238 #[doc(alias = "buffer-size")]
239 fn buffer_size(&self) -> u32 {
240 unsafe { ffi::gst_rtsp_media_factory_get_buffer_size(self.as_ref().to_glib_none().0) }
241 }
242
243 #[doc(alias = "gst_rtsp_media_factory_get_clock")]
250 #[doc(alias = "get_clock")]
251 fn clock(&self) -> Option<gst::Clock> {
252 unsafe {
253 from_glib_full(ffi::gst_rtsp_media_factory_get_clock(
254 self.as_ref().to_glib_none().0,
255 ))
256 }
257 }
258
259 #[cfg(feature = "v1_16")]
264 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
265 #[doc(alias = "gst_rtsp_media_factory_get_do_retransmission")]
266 #[doc(alias = "get_do_retransmission")]
267 fn does_retransmission(&self) -> bool {
268 unsafe {
269 from_glib(ffi::gst_rtsp_media_factory_get_do_retransmission(
270 self.as_ref().to_glib_none().0,
271 ))
272 }
273 }
274
275 #[cfg(feature = "v1_18")]
281 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
282 #[doc(alias = "gst_rtsp_media_factory_get_dscp_qos")]
283 #[doc(alias = "get_dscp_qos")]
284 #[doc(alias = "dscp-qos")]
285 fn dscp_qos(&self) -> i32 {
286 unsafe { ffi::gst_rtsp_media_factory_get_dscp_qos(self.as_ref().to_glib_none().0) }
287 }
288
289 #[cfg(feature = "v1_24")]
295 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
296 #[doc(alias = "gst_rtsp_media_factory_get_ensure_keyunit_on_start")]
297 #[doc(alias = "get_ensure_keyunit_on_start")]
298 #[doc(alias = "ensure-keyunit-on-start")]
299 fn is_ensure_keyunit_on_start(&self) -> bool {
300 unsafe {
301 from_glib(ffi::gst_rtsp_media_factory_get_ensure_keyunit_on_start(
302 self.as_ref().to_glib_none().0,
303 ))
304 }
305 }
306
307 #[cfg(feature = "v1_24")]
313 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
314 #[doc(alias = "gst_rtsp_media_factory_get_ensure_keyunit_on_start_timeout")]
315 #[doc(alias = "get_ensure_keyunit_on_start_timeout")]
316 #[doc(alias = "ensure-keyunit-on-start-timeout")]
317 fn ensure_keyunit_on_start_timeout(&self) -> u32 {
318 unsafe {
319 ffi::gst_rtsp_media_factory_get_ensure_keyunit_on_start_timeout(
320 self.as_ref().to_glib_none().0,
321 )
322 }
323 }
324
325 #[doc(alias = "gst_rtsp_media_factory_get_latency")]
331 #[doc(alias = "get_latency")]
332 fn latency(&self) -> u32 {
333 unsafe { ffi::gst_rtsp_media_factory_get_latency(self.as_ref().to_glib_none().0) }
334 }
335
336 #[doc(alias = "gst_rtsp_media_factory_get_launch")]
344 #[doc(alias = "get_launch")]
345 fn launch(&self) -> Option<glib::GString> {
346 unsafe {
347 from_glib_full(ffi::gst_rtsp_media_factory_get_launch(
348 self.as_ref().to_glib_none().0,
349 ))
350 }
351 }
352
353 #[cfg(feature = "v1_16")]
359 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
360 #[doc(alias = "gst_rtsp_media_factory_get_max_mcast_ttl")]
361 #[doc(alias = "get_max_mcast_ttl")]
362 #[doc(alias = "max-mcast-ttl")]
363 fn max_mcast_ttl(&self) -> u32 {
364 unsafe { ffi::gst_rtsp_media_factory_get_max_mcast_ttl(self.as_ref().to_glib_none().0) }
365 }
366
367 #[doc(alias = "gst_rtsp_media_factory_get_media_gtype")]
370 #[doc(alias = "get_media_gtype")]
371 fn media_gtype(&self) -> glib::types::Type {
372 unsafe {
373 from_glib(ffi::gst_rtsp_media_factory_get_media_gtype(
374 self.as_ref().to_glib_none().0,
375 ))
376 }
377 }
378
379 #[doc(alias = "gst_rtsp_media_factory_get_multicast_iface")]
386 #[doc(alias = "get_multicast_iface")]
387 fn multicast_iface(&self) -> Option<glib::GString> {
388 unsafe {
389 from_glib_full(ffi::gst_rtsp_media_factory_get_multicast_iface(
390 self.as_ref().to_glib_none().0,
391 ))
392 }
393 }
394
395 #[doc(alias = "gst_rtsp_media_factory_get_profiles")]
407 #[doc(alias = "get_profiles")]
408 fn profiles(&self) -> gst_rtsp::RTSPProfile {
409 unsafe {
410 from_glib(ffi::gst_rtsp_media_factory_get_profiles(
411 self.as_ref().to_glib_none().0,
412 ))
413 }
414 }
415
416 #[doc(alias = "gst_rtsp_media_factory_get_protocols")]
422 #[doc(alias = "get_protocols")]
423 fn protocols(&self) -> gst_rtsp::RTSPLowerTrans {
424 unsafe {
425 from_glib(ffi::gst_rtsp_media_factory_get_protocols(
426 self.as_ref().to_glib_none().0,
427 ))
428 }
429 }
430
431 #[doc(alias = "gst_rtsp_media_factory_get_publish_clock_mode")]
437 #[doc(alias = "get_publish_clock_mode")]
438 fn publish_clock_mode(&self) -> RTSPPublishClockMode {
439 unsafe {
440 from_glib(ffi::gst_rtsp_media_factory_get_publish_clock_mode(
441 self.as_ref().to_glib_none().0,
442 ))
443 }
444 }
445
446 #[doc(alias = "gst_rtsp_media_factory_get_retransmission_time")]
452 #[doc(alias = "get_retransmission_time")]
453 fn retransmission_time(&self) -> Option<gst::ClockTime> {
454 unsafe {
455 from_glib(ffi::gst_rtsp_media_factory_get_retransmission_time(
456 self.as_ref().to_glib_none().0,
457 ))
458 }
459 }
460
461 #[doc(alias = "gst_rtsp_media_factory_get_suspend_mode")]
467 #[doc(alias = "get_suspend_mode")]
468 #[doc(alias = "suspend-mode")]
469 fn suspend_mode(&self) -> RTSPSuspendMode {
470 unsafe {
471 from_glib(ffi::gst_rtsp_media_factory_get_suspend_mode(
472 self.as_ref().to_glib_none().0,
473 ))
474 }
475 }
476
477 #[doc(alias = "gst_rtsp_media_factory_get_transport_mode")]
484 #[doc(alias = "get_transport_mode")]
485 #[doc(alias = "transport-mode")]
486 fn transport_mode(&self) -> RTSPTransportMode {
487 unsafe {
488 from_glib(ffi::gst_rtsp_media_factory_get_transport_mode(
489 self.as_ref().to_glib_none().0,
490 ))
491 }
492 }
493
494 #[cfg(feature = "v1_16")]
500 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
501 #[doc(alias = "gst_rtsp_media_factory_is_bind_mcast_address")]
502 #[doc(alias = "bind-mcast-address")]
503 fn is_bind_mcast_address(&self) -> bool {
504 unsafe {
505 from_glib(ffi::gst_rtsp_media_factory_is_bind_mcast_address(
506 self.as_ref().to_glib_none().0,
507 ))
508 }
509 }
510
511 #[cfg(feature = "v1_20")]
517 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
518 #[doc(alias = "gst_rtsp_media_factory_is_enable_rtcp")]
519 #[doc(alias = "enable-rtcp")]
520 fn is_enable_rtcp(&self) -> bool {
521 unsafe {
522 from_glib(ffi::gst_rtsp_media_factory_is_enable_rtcp(
523 self.as_ref().to_glib_none().0,
524 ))
525 }
526 }
527
528 #[doc(alias = "gst_rtsp_media_factory_is_eos_shutdown")]
535 #[doc(alias = "eos-shutdown")]
536 fn is_eos_shutdown(&self) -> bool {
537 unsafe {
538 from_glib(ffi::gst_rtsp_media_factory_is_eos_shutdown(
539 self.as_ref().to_glib_none().0,
540 ))
541 }
542 }
543
544 #[doc(alias = "gst_rtsp_media_factory_is_shared")]
550 #[doc(alias = "shared")]
551 fn is_shared(&self) -> bool {
552 unsafe {
553 from_glib(ffi::gst_rtsp_media_factory_is_shared(
554 self.as_ref().to_glib_none().0,
555 ))
556 }
557 }
558
559 #[doc(alias = "gst_rtsp_media_factory_is_stop_on_disonnect")]
560 fn is_stop_on_disonnect(&self) -> bool {
561 unsafe {
562 from_glib(ffi::gst_rtsp_media_factory_is_stop_on_disonnect(
563 self.as_ref().to_glib_none().0,
564 ))
565 }
566 }
567
568 #[doc(alias = "gst_rtsp_media_factory_set_address_pool")]
572 fn set_address_pool(&self, pool: Option<&impl IsA<RTSPAddressPool>>) {
573 unsafe {
574 ffi::gst_rtsp_media_factory_set_address_pool(
575 self.as_ref().to_glib_none().0,
576 pool.map(|p| p.as_ref()).to_glib_none().0,
577 );
578 }
579 }
580
581 #[cfg(feature = "v1_16")]
586 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
587 #[doc(alias = "gst_rtsp_media_factory_set_bind_mcast_address")]
588 #[doc(alias = "bind-mcast-address")]
589 fn set_bind_mcast_address(&self, bind_mcast_addr: bool) {
590 unsafe {
591 ffi::gst_rtsp_media_factory_set_bind_mcast_address(
592 self.as_ref().to_glib_none().0,
593 bind_mcast_addr.into_glib(),
594 );
595 }
596 }
597
598 #[doc(alias = "gst_rtsp_media_factory_set_buffer_size")]
602 #[doc(alias = "buffer-size")]
603 fn set_buffer_size(&self, size: u32) {
604 unsafe {
605 ffi::gst_rtsp_media_factory_set_buffer_size(self.as_ref().to_glib_none().0, size);
606 }
607 }
608
609 #[doc(alias = "gst_rtsp_media_factory_set_clock")]
614 #[doc(alias = "clock")]
615 fn set_clock(&self, clock: Option<&impl IsA<gst::Clock>>) {
616 unsafe {
617 ffi::gst_rtsp_media_factory_set_clock(
618 self.as_ref().to_glib_none().0,
619 clock.map(|p| p.as_ref()).to_glib_none().0,
620 );
621 }
622 }
623
624 #[cfg(feature = "v1_16")]
627 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
628 #[doc(alias = "gst_rtsp_media_factory_set_do_retransmission")]
629 fn set_do_retransmission(&self, do_retransmission: bool) {
630 unsafe {
631 ffi::gst_rtsp_media_factory_set_do_retransmission(
632 self.as_ref().to_glib_none().0,
633 do_retransmission.into_glib(),
634 );
635 }
636 }
637
638 #[cfg(feature = "v1_18")]
642 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
643 #[doc(alias = "gst_rtsp_media_factory_set_dscp_qos")]
644 #[doc(alias = "dscp-qos")]
645 fn set_dscp_qos(&self, dscp_qos: i32) {
646 unsafe {
647 ffi::gst_rtsp_media_factory_set_dscp_qos(self.as_ref().to_glib_none().0, dscp_qos);
648 }
649 }
650
651 #[cfg(feature = "v1_20")]
655 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
656 #[doc(alias = "gst_rtsp_media_factory_set_enable_rtcp")]
657 #[doc(alias = "enable-rtcp")]
658 fn set_enable_rtcp(&self, enable: bool) {
659 unsafe {
660 ffi::gst_rtsp_media_factory_set_enable_rtcp(
661 self.as_ref().to_glib_none().0,
662 enable.into_glib(),
663 );
664 }
665 }
666
667 #[cfg(feature = "v1_24")]
671 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
672 #[doc(alias = "gst_rtsp_media_factory_set_ensure_keyunit_on_start")]
673 #[doc(alias = "ensure-keyunit-on-start")]
674 fn set_ensure_keyunit_on_start(&self, ensure_keyunit_on_start: bool) {
675 unsafe {
676 ffi::gst_rtsp_media_factory_set_ensure_keyunit_on_start(
677 self.as_ref().to_glib_none().0,
678 ensure_keyunit_on_start.into_glib(),
679 );
680 }
681 }
682
683 #[cfg(feature = "v1_24")]
688 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
689 #[doc(alias = "gst_rtsp_media_factory_set_ensure_keyunit_on_start_timeout")]
690 #[doc(alias = "ensure-keyunit-on-start-timeout")]
691 fn set_ensure_keyunit_on_start_timeout(&self, timeout: u32) {
692 unsafe {
693 ffi::gst_rtsp_media_factory_set_ensure_keyunit_on_start_timeout(
694 self.as_ref().to_glib_none().0,
695 timeout,
696 );
697 }
698 }
699
700 #[doc(alias = "gst_rtsp_media_factory_set_eos_shutdown")]
705 #[doc(alias = "eos-shutdown")]
706 fn set_eos_shutdown(&self, eos_shutdown: bool) {
707 unsafe {
708 ffi::gst_rtsp_media_factory_set_eos_shutdown(
709 self.as_ref().to_glib_none().0,
710 eos_shutdown.into_glib(),
711 );
712 }
713 }
714
715 #[doc(alias = "gst_rtsp_media_factory_set_latency")]
719 #[doc(alias = "latency")]
720 fn set_latency(&self, latency: u32) {
721 unsafe {
722 ffi::gst_rtsp_media_factory_set_latency(self.as_ref().to_glib_none().0, latency);
723 }
724 }
725
726 #[doc(alias = "gst_rtsp_media_factory_set_launch")]
738 #[doc(alias = "launch")]
739 fn set_launch(&self, launch: &str) {
740 unsafe {
741 ffi::gst_rtsp_media_factory_set_launch(
742 self.as_ref().to_glib_none().0,
743 launch.to_glib_none().0,
744 );
745 }
746 }
747
748 #[cfg(feature = "v1_16")]
756 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
757 #[doc(alias = "gst_rtsp_media_factory_set_max_mcast_ttl")]
758 #[doc(alias = "max-mcast-ttl")]
759 fn set_max_mcast_ttl(&self, ttl: u32) -> bool {
760 unsafe {
761 from_glib(ffi::gst_rtsp_media_factory_set_max_mcast_ttl(
762 self.as_ref().to_glib_none().0,
763 ttl,
764 ))
765 }
766 }
767
768 #[doc(alias = "gst_rtsp_media_factory_set_media_gtype")]
774 fn set_media_gtype(&self, media_gtype: glib::types::Type) {
775 unsafe {
776 ffi::gst_rtsp_media_factory_set_media_gtype(
777 self.as_ref().to_glib_none().0,
778 media_gtype.into_glib(),
779 );
780 }
781 }
782
783 #[doc(alias = "gst_rtsp_media_factory_set_multicast_iface")]
787 fn set_multicast_iface(&self, multicast_iface: Option<&str>) {
788 unsafe {
789 ffi::gst_rtsp_media_factory_set_multicast_iface(
790 self.as_ref().to_glib_none().0,
791 multicast_iface.to_glib_none().0,
792 );
793 }
794 }
795
796 #[doc(alias = "gst_rtsp_media_factory_set_profiles")]
805 #[doc(alias = "profiles")]
806 fn set_profiles(&self, profiles: gst_rtsp::RTSPProfile) {
807 unsafe {
808 ffi::gst_rtsp_media_factory_set_profiles(
809 self.as_ref().to_glib_none().0,
810 profiles.into_glib(),
811 );
812 }
813 }
814
815 #[doc(alias = "gst_rtsp_media_factory_set_protocols")]
819 #[doc(alias = "protocols")]
820 fn set_protocols(&self, protocols: gst_rtsp::RTSPLowerTrans) {
821 unsafe {
822 ffi::gst_rtsp_media_factory_set_protocols(
823 self.as_ref().to_glib_none().0,
824 protocols.into_glib(),
825 );
826 }
827 }
828
829 #[doc(alias = "gst_rtsp_media_factory_set_publish_clock_mode")]
833 fn set_publish_clock_mode(&self, mode: RTSPPublishClockMode) {
834 unsafe {
835 ffi::gst_rtsp_media_factory_set_publish_clock_mode(
836 self.as_ref().to_glib_none().0,
837 mode.into_glib(),
838 );
839 }
840 }
841
842 #[doc(alias = "gst_rtsp_media_factory_set_retransmission_time")]
846 fn set_retransmission_time(&self, time: impl Into<Option<gst::ClockTime>>) {
847 unsafe {
848 ffi::gst_rtsp_media_factory_set_retransmission_time(
849 self.as_ref().to_glib_none().0,
850 time.into().into_glib(),
851 );
852 }
853 }
854
855 #[doc(alias = "gst_rtsp_media_factory_set_shared")]
859 #[doc(alias = "shared")]
860 fn set_shared(&self, shared: bool) {
861 unsafe {
862 ffi::gst_rtsp_media_factory_set_shared(
863 self.as_ref().to_glib_none().0,
864 shared.into_glib(),
865 );
866 }
867 }
868
869 #[doc(alias = "gst_rtsp_media_factory_set_stop_on_disconnect")]
874 #[doc(alias = "stop-on-disconnect")]
875 fn set_stop_on_disconnect(&self, stop_on_disconnect: bool) {
876 unsafe {
877 ffi::gst_rtsp_media_factory_set_stop_on_disconnect(
878 self.as_ref().to_glib_none().0,
879 stop_on_disconnect.into_glib(),
880 );
881 }
882 }
883
884 #[doc(alias = "gst_rtsp_media_factory_set_suspend_mode")]
888 #[doc(alias = "suspend-mode")]
889 fn set_suspend_mode(&self, mode: RTSPSuspendMode) {
890 unsafe {
891 ffi::gst_rtsp_media_factory_set_suspend_mode(
892 self.as_ref().to_glib_none().0,
893 mode.into_glib(),
894 );
895 }
896 }
897
898 #[doc(alias = "gst_rtsp_media_factory_set_transport_mode")]
902 #[doc(alias = "transport-mode")]
903 fn set_transport_mode(&self, mode: RTSPTransportMode) {
904 unsafe {
905 ffi::gst_rtsp_media_factory_set_transport_mode(
906 self.as_ref().to_glib_none().0,
907 mode.into_glib(),
908 );
909 }
910 }
911
912 #[cfg(not(feature = "v1_16"))]
913 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
914 #[doc(alias = "bind-mcast-address")]
915 fn is_bind_mcast_address(&self) -> bool {
916 ObjectExt::property(self.as_ref(), "bind-mcast-address")
917 }
918
919 #[cfg(not(feature = "v1_16"))]
920 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
921 #[doc(alias = "bind-mcast-address")]
922 fn set_bind_mcast_address(&self, bind_mcast_address: bool) {
923 ObjectExt::set_property(self.as_ref(), "bind-mcast-address", bind_mcast_address)
924 }
925
926 #[cfg(not(feature = "v1_18"))]
927 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_18"))))]
928 #[doc(alias = "dscp-qos")]
929 fn dscp_qos(&self) -> i32 {
930 ObjectExt::property(self.as_ref(), "dscp-qos")
931 }
932
933 #[cfg(not(feature = "v1_18"))]
934 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_18"))))]
935 #[doc(alias = "dscp-qos")]
936 fn set_dscp_qos(&self, dscp_qos: i32) {
937 ObjectExt::set_property(self.as_ref(), "dscp-qos", dscp_qos)
938 }
939
940 #[cfg(not(feature = "v1_16"))]
941 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
942 #[doc(alias = "max-mcast-ttl")]
943 fn max_mcast_ttl(&self) -> u32 {
944 ObjectExt::property(self.as_ref(), "max-mcast-ttl")
945 }
946
947 #[cfg(not(feature = "v1_16"))]
948 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
949 #[doc(alias = "max-mcast-ttl")]
950 fn set_max_mcast_ttl(&self, max_mcast_ttl: u32) {
951 ObjectExt::set_property(self.as_ref(), "max-mcast-ttl", max_mcast_ttl)
952 }
953
954 #[doc(alias = "stop-on-disconnect")]
955 fn is_stop_on_disconnect(&self) -> bool {
956 ObjectExt::property(self.as_ref(), "stop-on-disconnect")
957 }
958
959 #[doc(alias = "media-configure")]
960 fn connect_media_configure<F: Fn(&Self, &RTSPMedia) + Send + Sync + 'static>(
961 &self,
962 f: F,
963 ) -> SignalHandlerId {
964 unsafe extern "C" fn media_configure_trampoline<
965 P: IsA<RTSPMediaFactory>,
966 F: Fn(&P, &RTSPMedia) + Send + Sync + 'static,
967 >(
968 this: *mut ffi::GstRTSPMediaFactory,
969 object: *mut ffi::GstRTSPMedia,
970 f: glib::ffi::gpointer,
971 ) {
972 let f: &F = &*(f as *const F);
973 f(
974 RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref(),
975 &from_glib_borrow(object),
976 )
977 }
978 unsafe {
979 let f: Box_<F> = Box_::new(f);
980 connect_raw(
981 self.as_ptr() as *mut _,
982 c"media-configure".as_ptr() as *const _,
983 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
984 media_configure_trampoline::<Self, F> as *const (),
985 )),
986 Box_::into_raw(f),
987 )
988 }
989 }
990
991 #[doc(alias = "media-constructed")]
992 fn connect_media_constructed<F: Fn(&Self, &RTSPMedia) + Send + Sync + 'static>(
993 &self,
994 f: F,
995 ) -> SignalHandlerId {
996 unsafe extern "C" fn media_constructed_trampoline<
997 P: IsA<RTSPMediaFactory>,
998 F: Fn(&P, &RTSPMedia) + Send + Sync + 'static,
999 >(
1000 this: *mut ffi::GstRTSPMediaFactory,
1001 object: *mut ffi::GstRTSPMedia,
1002 f: glib::ffi::gpointer,
1003 ) {
1004 let f: &F = &*(f as *const F);
1005 f(
1006 RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref(),
1007 &from_glib_borrow(object),
1008 )
1009 }
1010 unsafe {
1011 let f: Box_<F> = Box_::new(f);
1012 connect_raw(
1013 self.as_ptr() as *mut _,
1014 c"media-constructed".as_ptr() as *const _,
1015 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1016 media_constructed_trampoline::<Self, F> as *const (),
1017 )),
1018 Box_::into_raw(f),
1019 )
1020 }
1021 }
1022
1023 #[doc(alias = "bind-mcast-address")]
1024 fn connect_bind_mcast_address_notify<F: Fn(&Self) + Send + Sync + 'static>(
1025 &self,
1026 f: F,
1027 ) -> SignalHandlerId {
1028 unsafe extern "C" fn notify_bind_mcast_address_trampoline<
1029 P: IsA<RTSPMediaFactory>,
1030 F: Fn(&P) + Send + Sync + 'static,
1031 >(
1032 this: *mut ffi::GstRTSPMediaFactory,
1033 _param_spec: glib::ffi::gpointer,
1034 f: glib::ffi::gpointer,
1035 ) {
1036 let f: &F = &*(f as *const F);
1037 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1038 }
1039 unsafe {
1040 let f: Box_<F> = Box_::new(f);
1041 connect_raw(
1042 self.as_ptr() as *mut _,
1043 c"notify::bind-mcast-address".as_ptr() as *const _,
1044 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1045 notify_bind_mcast_address_trampoline::<Self, F> as *const (),
1046 )),
1047 Box_::into_raw(f),
1048 )
1049 }
1050 }
1051
1052 #[doc(alias = "buffer-size")]
1053 fn connect_buffer_size_notify<F: Fn(&Self) + Send + Sync + 'static>(
1054 &self,
1055 f: F,
1056 ) -> SignalHandlerId {
1057 unsafe extern "C" fn notify_buffer_size_trampoline<
1058 P: IsA<RTSPMediaFactory>,
1059 F: Fn(&P) + Send + Sync + 'static,
1060 >(
1061 this: *mut ffi::GstRTSPMediaFactory,
1062 _param_spec: glib::ffi::gpointer,
1063 f: glib::ffi::gpointer,
1064 ) {
1065 let f: &F = &*(f as *const F);
1066 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1067 }
1068 unsafe {
1069 let f: Box_<F> = Box_::new(f);
1070 connect_raw(
1071 self.as_ptr() as *mut _,
1072 c"notify::buffer-size".as_ptr() as *const _,
1073 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1074 notify_buffer_size_trampoline::<Self, F> as *const (),
1075 )),
1076 Box_::into_raw(f),
1077 )
1078 }
1079 }
1080
1081 #[doc(alias = "clock")]
1082 fn connect_clock_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1083 unsafe extern "C" fn notify_clock_trampoline<
1084 P: IsA<RTSPMediaFactory>,
1085 F: Fn(&P) + Send + Sync + 'static,
1086 >(
1087 this: *mut ffi::GstRTSPMediaFactory,
1088 _param_spec: glib::ffi::gpointer,
1089 f: glib::ffi::gpointer,
1090 ) {
1091 let f: &F = &*(f as *const F);
1092 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1093 }
1094 unsafe {
1095 let f: Box_<F> = Box_::new(f);
1096 connect_raw(
1097 self.as_ptr() as *mut _,
1098 c"notify::clock".as_ptr() as *const _,
1099 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1100 notify_clock_trampoline::<Self, F> as *const (),
1101 )),
1102 Box_::into_raw(f),
1103 )
1104 }
1105 }
1106
1107 #[doc(alias = "dscp-qos")]
1108 fn connect_dscp_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(
1109 &self,
1110 f: F,
1111 ) -> SignalHandlerId {
1112 unsafe extern "C" fn notify_dscp_qos_trampoline<
1113 P: IsA<RTSPMediaFactory>,
1114 F: Fn(&P) + Send + Sync + 'static,
1115 >(
1116 this: *mut ffi::GstRTSPMediaFactory,
1117 _param_spec: glib::ffi::gpointer,
1118 f: glib::ffi::gpointer,
1119 ) {
1120 let f: &F = &*(f as *const F);
1121 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1122 }
1123 unsafe {
1124 let f: Box_<F> = Box_::new(f);
1125 connect_raw(
1126 self.as_ptr() as *mut _,
1127 c"notify::dscp-qos".as_ptr() as *const _,
1128 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1129 notify_dscp_qos_trampoline::<Self, F> as *const (),
1130 )),
1131 Box_::into_raw(f),
1132 )
1133 }
1134 }
1135
1136 #[cfg(feature = "v1_20")]
1137 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
1138 #[doc(alias = "enable-rtcp")]
1139 fn connect_enable_rtcp_notify<F: Fn(&Self) + Send + Sync + 'static>(
1140 &self,
1141 f: F,
1142 ) -> SignalHandlerId {
1143 unsafe extern "C" fn notify_enable_rtcp_trampoline<
1144 P: IsA<RTSPMediaFactory>,
1145 F: Fn(&P) + Send + Sync + 'static,
1146 >(
1147 this: *mut ffi::GstRTSPMediaFactory,
1148 _param_spec: glib::ffi::gpointer,
1149 f: glib::ffi::gpointer,
1150 ) {
1151 let f: &F = &*(f as *const F);
1152 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1153 }
1154 unsafe {
1155 let f: Box_<F> = Box_::new(f);
1156 connect_raw(
1157 self.as_ptr() as *mut _,
1158 c"notify::enable-rtcp".as_ptr() as *const _,
1159 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1160 notify_enable_rtcp_trampoline::<Self, F> as *const (),
1161 )),
1162 Box_::into_raw(f),
1163 )
1164 }
1165 }
1166
1167 #[cfg(feature = "v1_24")]
1168 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1169 #[doc(alias = "ensure-keyunit-on-start")]
1170 fn connect_ensure_keyunit_on_start_notify<F: Fn(&Self) + Send + Sync + 'static>(
1171 &self,
1172 f: F,
1173 ) -> SignalHandlerId {
1174 unsafe extern "C" fn notify_ensure_keyunit_on_start_trampoline<
1175 P: IsA<RTSPMediaFactory>,
1176 F: Fn(&P) + Send + Sync + 'static,
1177 >(
1178 this: *mut ffi::GstRTSPMediaFactory,
1179 _param_spec: glib::ffi::gpointer,
1180 f: glib::ffi::gpointer,
1181 ) {
1182 let f: &F = &*(f as *const F);
1183 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1184 }
1185 unsafe {
1186 let f: Box_<F> = Box_::new(f);
1187 connect_raw(
1188 self.as_ptr() as *mut _,
1189 c"notify::ensure-keyunit-on-start".as_ptr() as *const _,
1190 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1191 notify_ensure_keyunit_on_start_trampoline::<Self, F> as *const (),
1192 )),
1193 Box_::into_raw(f),
1194 )
1195 }
1196 }
1197
1198 #[cfg(feature = "v1_24")]
1199 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1200 #[doc(alias = "ensure-keyunit-on-start-timeout")]
1201 fn connect_ensure_keyunit_on_start_timeout_notify<F: Fn(&Self) + Send + Sync + 'static>(
1202 &self,
1203 f: F,
1204 ) -> SignalHandlerId {
1205 unsafe extern "C" fn notify_ensure_keyunit_on_start_timeout_trampoline<
1206 P: IsA<RTSPMediaFactory>,
1207 F: Fn(&P) + Send + Sync + 'static,
1208 >(
1209 this: *mut ffi::GstRTSPMediaFactory,
1210 _param_spec: glib::ffi::gpointer,
1211 f: glib::ffi::gpointer,
1212 ) {
1213 let f: &F = &*(f as *const F);
1214 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1215 }
1216 unsafe {
1217 let f: Box_<F> = Box_::new(f);
1218 connect_raw(
1219 self.as_ptr() as *mut _,
1220 c"notify::ensure-keyunit-on-start-timeout".as_ptr() as *const _,
1221 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1222 notify_ensure_keyunit_on_start_timeout_trampoline::<Self, F> as *const (),
1223 )),
1224 Box_::into_raw(f),
1225 )
1226 }
1227 }
1228
1229 #[doc(alias = "eos-shutdown")]
1230 fn connect_eos_shutdown_notify<F: Fn(&Self) + Send + Sync + 'static>(
1231 &self,
1232 f: F,
1233 ) -> SignalHandlerId {
1234 unsafe extern "C" fn notify_eos_shutdown_trampoline<
1235 P: IsA<RTSPMediaFactory>,
1236 F: Fn(&P) + Send + Sync + 'static,
1237 >(
1238 this: *mut ffi::GstRTSPMediaFactory,
1239 _param_spec: glib::ffi::gpointer,
1240 f: glib::ffi::gpointer,
1241 ) {
1242 let f: &F = &*(f as *const F);
1243 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1244 }
1245 unsafe {
1246 let f: Box_<F> = Box_::new(f);
1247 connect_raw(
1248 self.as_ptr() as *mut _,
1249 c"notify::eos-shutdown".as_ptr() as *const _,
1250 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1251 notify_eos_shutdown_trampoline::<Self, F> as *const (),
1252 )),
1253 Box_::into_raw(f),
1254 )
1255 }
1256 }
1257
1258 #[doc(alias = "latency")]
1259 fn connect_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(
1260 &self,
1261 f: F,
1262 ) -> SignalHandlerId {
1263 unsafe extern "C" fn notify_latency_trampoline<
1264 P: IsA<RTSPMediaFactory>,
1265 F: Fn(&P) + Send + Sync + 'static,
1266 >(
1267 this: *mut ffi::GstRTSPMediaFactory,
1268 _param_spec: glib::ffi::gpointer,
1269 f: glib::ffi::gpointer,
1270 ) {
1271 let f: &F = &*(f as *const F);
1272 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1273 }
1274 unsafe {
1275 let f: Box_<F> = Box_::new(f);
1276 connect_raw(
1277 self.as_ptr() as *mut _,
1278 c"notify::latency".as_ptr() as *const _,
1279 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1280 notify_latency_trampoline::<Self, F> as *const (),
1281 )),
1282 Box_::into_raw(f),
1283 )
1284 }
1285 }
1286
1287 #[doc(alias = "launch")]
1288 fn connect_launch_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1289 unsafe extern "C" fn notify_launch_trampoline<
1290 P: IsA<RTSPMediaFactory>,
1291 F: Fn(&P) + Send + Sync + 'static,
1292 >(
1293 this: *mut ffi::GstRTSPMediaFactory,
1294 _param_spec: glib::ffi::gpointer,
1295 f: glib::ffi::gpointer,
1296 ) {
1297 let f: &F = &*(f as *const F);
1298 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1299 }
1300 unsafe {
1301 let f: Box_<F> = Box_::new(f);
1302 connect_raw(
1303 self.as_ptr() as *mut _,
1304 c"notify::launch".as_ptr() as *const _,
1305 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1306 notify_launch_trampoline::<Self, F> as *const (),
1307 )),
1308 Box_::into_raw(f),
1309 )
1310 }
1311 }
1312
1313 #[doc(alias = "max-mcast-ttl")]
1314 fn connect_max_mcast_ttl_notify<F: Fn(&Self) + Send + Sync + 'static>(
1315 &self,
1316 f: F,
1317 ) -> SignalHandlerId {
1318 unsafe extern "C" fn notify_max_mcast_ttl_trampoline<
1319 P: IsA<RTSPMediaFactory>,
1320 F: Fn(&P) + Send + Sync + 'static,
1321 >(
1322 this: *mut ffi::GstRTSPMediaFactory,
1323 _param_spec: glib::ffi::gpointer,
1324 f: glib::ffi::gpointer,
1325 ) {
1326 let f: &F = &*(f as *const F);
1327 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1328 }
1329 unsafe {
1330 let f: Box_<F> = Box_::new(f);
1331 connect_raw(
1332 self.as_ptr() as *mut _,
1333 c"notify::max-mcast-ttl".as_ptr() as *const _,
1334 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1335 notify_max_mcast_ttl_trampoline::<Self, F> as *const (),
1336 )),
1337 Box_::into_raw(f),
1338 )
1339 }
1340 }
1341
1342 #[doc(alias = "profiles")]
1343 fn connect_profiles_notify<F: Fn(&Self) + Send + Sync + 'static>(
1344 &self,
1345 f: F,
1346 ) -> SignalHandlerId {
1347 unsafe extern "C" fn notify_profiles_trampoline<
1348 P: IsA<RTSPMediaFactory>,
1349 F: Fn(&P) + Send + Sync + 'static,
1350 >(
1351 this: *mut ffi::GstRTSPMediaFactory,
1352 _param_spec: glib::ffi::gpointer,
1353 f: glib::ffi::gpointer,
1354 ) {
1355 let f: &F = &*(f as *const F);
1356 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1357 }
1358 unsafe {
1359 let f: Box_<F> = Box_::new(f);
1360 connect_raw(
1361 self.as_ptr() as *mut _,
1362 c"notify::profiles".as_ptr() as *const _,
1363 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1364 notify_profiles_trampoline::<Self, F> as *const (),
1365 )),
1366 Box_::into_raw(f),
1367 )
1368 }
1369 }
1370
1371 #[doc(alias = "protocols")]
1372 fn connect_protocols_notify<F: Fn(&Self) + Send + Sync + 'static>(
1373 &self,
1374 f: F,
1375 ) -> SignalHandlerId {
1376 unsafe extern "C" fn notify_protocols_trampoline<
1377 P: IsA<RTSPMediaFactory>,
1378 F: Fn(&P) + Send + Sync + 'static,
1379 >(
1380 this: *mut ffi::GstRTSPMediaFactory,
1381 _param_spec: glib::ffi::gpointer,
1382 f: glib::ffi::gpointer,
1383 ) {
1384 let f: &F = &*(f as *const F);
1385 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1386 }
1387 unsafe {
1388 let f: Box_<F> = Box_::new(f);
1389 connect_raw(
1390 self.as_ptr() as *mut _,
1391 c"notify::protocols".as_ptr() as *const _,
1392 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1393 notify_protocols_trampoline::<Self, F> as *const (),
1394 )),
1395 Box_::into_raw(f),
1396 )
1397 }
1398 }
1399
1400 #[doc(alias = "shared")]
1401 fn connect_shared_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1402 unsafe extern "C" fn notify_shared_trampoline<
1403 P: IsA<RTSPMediaFactory>,
1404 F: Fn(&P) + Send + Sync + 'static,
1405 >(
1406 this: *mut ffi::GstRTSPMediaFactory,
1407 _param_spec: glib::ffi::gpointer,
1408 f: glib::ffi::gpointer,
1409 ) {
1410 let f: &F = &*(f as *const F);
1411 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1412 }
1413 unsafe {
1414 let f: Box_<F> = Box_::new(f);
1415 connect_raw(
1416 self.as_ptr() as *mut _,
1417 c"notify::shared".as_ptr() as *const _,
1418 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1419 notify_shared_trampoline::<Self, F> as *const (),
1420 )),
1421 Box_::into_raw(f),
1422 )
1423 }
1424 }
1425
1426 #[doc(alias = "stop-on-disconnect")]
1427 fn connect_stop_on_disconnect_notify<F: Fn(&Self) + Send + Sync + 'static>(
1428 &self,
1429 f: F,
1430 ) -> SignalHandlerId {
1431 unsafe extern "C" fn notify_stop_on_disconnect_trampoline<
1432 P: IsA<RTSPMediaFactory>,
1433 F: Fn(&P) + Send + Sync + 'static,
1434 >(
1435 this: *mut ffi::GstRTSPMediaFactory,
1436 _param_spec: glib::ffi::gpointer,
1437 f: glib::ffi::gpointer,
1438 ) {
1439 let f: &F = &*(f as *const F);
1440 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1441 }
1442 unsafe {
1443 let f: Box_<F> = Box_::new(f);
1444 connect_raw(
1445 self.as_ptr() as *mut _,
1446 c"notify::stop-on-disconnect".as_ptr() as *const _,
1447 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1448 notify_stop_on_disconnect_trampoline::<Self, F> as *const (),
1449 )),
1450 Box_::into_raw(f),
1451 )
1452 }
1453 }
1454
1455 #[doc(alias = "suspend-mode")]
1456 fn connect_suspend_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
1457 &self,
1458 f: F,
1459 ) -> SignalHandlerId {
1460 unsafe extern "C" fn notify_suspend_mode_trampoline<
1461 P: IsA<RTSPMediaFactory>,
1462 F: Fn(&P) + Send + Sync + 'static,
1463 >(
1464 this: *mut ffi::GstRTSPMediaFactory,
1465 _param_spec: glib::ffi::gpointer,
1466 f: glib::ffi::gpointer,
1467 ) {
1468 let f: &F = &*(f as *const F);
1469 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1470 }
1471 unsafe {
1472 let f: Box_<F> = Box_::new(f);
1473 connect_raw(
1474 self.as_ptr() as *mut _,
1475 c"notify::suspend-mode".as_ptr() as *const _,
1476 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1477 notify_suspend_mode_trampoline::<Self, F> as *const (),
1478 )),
1479 Box_::into_raw(f),
1480 )
1481 }
1482 }
1483
1484 #[doc(alias = "transport-mode")]
1485 fn connect_transport_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
1486 &self,
1487 f: F,
1488 ) -> SignalHandlerId {
1489 unsafe extern "C" fn notify_transport_mode_trampoline<
1490 P: IsA<RTSPMediaFactory>,
1491 F: Fn(&P) + Send + Sync + 'static,
1492 >(
1493 this: *mut ffi::GstRTSPMediaFactory,
1494 _param_spec: glib::ffi::gpointer,
1495 f: glib::ffi::gpointer,
1496 ) {
1497 let f: &F = &*(f as *const F);
1498 f(RTSPMediaFactory::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 c"notify::transport-mode".as_ptr() as *const _,
1505 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1506 notify_transport_mode_trampoline::<Self, F> as *const (),
1507 )),
1508 Box_::into_raw(f),
1509 )
1510 }
1511 }
1512}
1513
1514impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {}