1use crate::{
7 RTSPAddressPool, RTSPMedia, RTSPPublishClockMode, RTSPSuspendMode, RTSPTransportMode, ffi,
8};
9use glib::{
10 object::ObjectType as _,
11 prelude::*,
12 signal::{SignalHandlerId, connect_raw},
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 unsafe {
973 let f: &F = &*(f as *const F);
974 f(
975 RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref(),
976 &from_glib_borrow(object),
977 )
978 }
979 }
980 unsafe {
981 let f: Box_<F> = Box_::new(f);
982 connect_raw(
983 self.as_ptr() as *mut _,
984 c"media-configure".as_ptr(),
985 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
986 media_configure_trampoline::<Self, F> as *const (),
987 )),
988 Box_::into_raw(f),
989 )
990 }
991 }
992
993 #[doc(alias = "media-constructed")]
994 fn connect_media_constructed<F: Fn(&Self, &RTSPMedia) + Send + Sync + 'static>(
995 &self,
996 f: F,
997 ) -> SignalHandlerId {
998 unsafe extern "C" fn media_constructed_trampoline<
999 P: IsA<RTSPMediaFactory>,
1000 F: Fn(&P, &RTSPMedia) + Send + Sync + 'static,
1001 >(
1002 this: *mut ffi::GstRTSPMediaFactory,
1003 object: *mut ffi::GstRTSPMedia,
1004 f: glib::ffi::gpointer,
1005 ) {
1006 unsafe {
1007 let f: &F = &*(f as *const F);
1008 f(
1009 RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref(),
1010 &from_glib_borrow(object),
1011 )
1012 }
1013 }
1014 unsafe {
1015 let f: Box_<F> = Box_::new(f);
1016 connect_raw(
1017 self.as_ptr() as *mut _,
1018 c"media-constructed".as_ptr(),
1019 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1020 media_constructed_trampoline::<Self, F> as *const (),
1021 )),
1022 Box_::into_raw(f),
1023 )
1024 }
1025 }
1026
1027 #[doc(alias = "bind-mcast-address")]
1028 fn connect_bind_mcast_address_notify<F: Fn(&Self) + Send + Sync + 'static>(
1029 &self,
1030 f: F,
1031 ) -> SignalHandlerId {
1032 unsafe extern "C" fn notify_bind_mcast_address_trampoline<
1033 P: IsA<RTSPMediaFactory>,
1034 F: Fn(&P) + Send + Sync + 'static,
1035 >(
1036 this: *mut ffi::GstRTSPMediaFactory,
1037 _param_spec: glib::ffi::gpointer,
1038 f: glib::ffi::gpointer,
1039 ) {
1040 unsafe {
1041 let f: &F = &*(f as *const F);
1042 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1043 }
1044 }
1045 unsafe {
1046 let f: Box_<F> = Box_::new(f);
1047 connect_raw(
1048 self.as_ptr() as *mut _,
1049 c"notify::bind-mcast-address".as_ptr(),
1050 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1051 notify_bind_mcast_address_trampoline::<Self, F> as *const (),
1052 )),
1053 Box_::into_raw(f),
1054 )
1055 }
1056 }
1057
1058 #[doc(alias = "buffer-size")]
1059 fn connect_buffer_size_notify<F: Fn(&Self) + Send + Sync + 'static>(
1060 &self,
1061 f: F,
1062 ) -> SignalHandlerId {
1063 unsafe extern "C" fn notify_buffer_size_trampoline<
1064 P: IsA<RTSPMediaFactory>,
1065 F: Fn(&P) + Send + Sync + 'static,
1066 >(
1067 this: *mut ffi::GstRTSPMediaFactory,
1068 _param_spec: glib::ffi::gpointer,
1069 f: glib::ffi::gpointer,
1070 ) {
1071 unsafe {
1072 let f: &F = &*(f as *const F);
1073 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1074 }
1075 }
1076 unsafe {
1077 let f: Box_<F> = Box_::new(f);
1078 connect_raw(
1079 self.as_ptr() as *mut _,
1080 c"notify::buffer-size".as_ptr(),
1081 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1082 notify_buffer_size_trampoline::<Self, F> as *const (),
1083 )),
1084 Box_::into_raw(f),
1085 )
1086 }
1087 }
1088
1089 #[doc(alias = "clock")]
1090 fn connect_clock_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1091 unsafe extern "C" fn notify_clock_trampoline<
1092 P: IsA<RTSPMediaFactory>,
1093 F: Fn(&P) + Send + Sync + 'static,
1094 >(
1095 this: *mut ffi::GstRTSPMediaFactory,
1096 _param_spec: glib::ffi::gpointer,
1097 f: glib::ffi::gpointer,
1098 ) {
1099 unsafe {
1100 let f: &F = &*(f as *const F);
1101 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1102 }
1103 }
1104 unsafe {
1105 let f: Box_<F> = Box_::new(f);
1106 connect_raw(
1107 self.as_ptr() as *mut _,
1108 c"notify::clock".as_ptr(),
1109 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1110 notify_clock_trampoline::<Self, F> as *const (),
1111 )),
1112 Box_::into_raw(f),
1113 )
1114 }
1115 }
1116
1117 #[doc(alias = "dscp-qos")]
1118 fn connect_dscp_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(
1119 &self,
1120 f: F,
1121 ) -> SignalHandlerId {
1122 unsafe extern "C" fn notify_dscp_qos_trampoline<
1123 P: IsA<RTSPMediaFactory>,
1124 F: Fn(&P) + Send + Sync + 'static,
1125 >(
1126 this: *mut ffi::GstRTSPMediaFactory,
1127 _param_spec: glib::ffi::gpointer,
1128 f: glib::ffi::gpointer,
1129 ) {
1130 unsafe {
1131 let f: &F = &*(f as *const F);
1132 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1133 }
1134 }
1135 unsafe {
1136 let f: Box_<F> = Box_::new(f);
1137 connect_raw(
1138 self.as_ptr() as *mut _,
1139 c"notify::dscp-qos".as_ptr(),
1140 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1141 notify_dscp_qos_trampoline::<Self, F> as *const (),
1142 )),
1143 Box_::into_raw(f),
1144 )
1145 }
1146 }
1147
1148 #[cfg(feature = "v1_20")]
1149 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
1150 #[doc(alias = "enable-rtcp")]
1151 fn connect_enable_rtcp_notify<F: Fn(&Self) + Send + Sync + 'static>(
1152 &self,
1153 f: F,
1154 ) -> SignalHandlerId {
1155 unsafe extern "C" fn notify_enable_rtcp_trampoline<
1156 P: IsA<RTSPMediaFactory>,
1157 F: Fn(&P) + Send + Sync + 'static,
1158 >(
1159 this: *mut ffi::GstRTSPMediaFactory,
1160 _param_spec: glib::ffi::gpointer,
1161 f: glib::ffi::gpointer,
1162 ) {
1163 unsafe {
1164 let f: &F = &*(f as *const F);
1165 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1166 }
1167 }
1168 unsafe {
1169 let f: Box_<F> = Box_::new(f);
1170 connect_raw(
1171 self.as_ptr() as *mut _,
1172 c"notify::enable-rtcp".as_ptr(),
1173 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1174 notify_enable_rtcp_trampoline::<Self, F> as *const (),
1175 )),
1176 Box_::into_raw(f),
1177 )
1178 }
1179 }
1180
1181 #[cfg(feature = "v1_24")]
1182 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1183 #[doc(alias = "ensure-keyunit-on-start")]
1184 fn connect_ensure_keyunit_on_start_notify<F: Fn(&Self) + Send + Sync + 'static>(
1185 &self,
1186 f: F,
1187 ) -> SignalHandlerId {
1188 unsafe extern "C" fn notify_ensure_keyunit_on_start_trampoline<
1189 P: IsA<RTSPMediaFactory>,
1190 F: Fn(&P) + Send + Sync + 'static,
1191 >(
1192 this: *mut ffi::GstRTSPMediaFactory,
1193 _param_spec: glib::ffi::gpointer,
1194 f: glib::ffi::gpointer,
1195 ) {
1196 unsafe {
1197 let f: &F = &*(f as *const F);
1198 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1199 }
1200 }
1201 unsafe {
1202 let f: Box_<F> = Box_::new(f);
1203 connect_raw(
1204 self.as_ptr() as *mut _,
1205 c"notify::ensure-keyunit-on-start".as_ptr(),
1206 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1207 notify_ensure_keyunit_on_start_trampoline::<Self, F> as *const (),
1208 )),
1209 Box_::into_raw(f),
1210 )
1211 }
1212 }
1213
1214 #[cfg(feature = "v1_24")]
1215 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1216 #[doc(alias = "ensure-keyunit-on-start-timeout")]
1217 fn connect_ensure_keyunit_on_start_timeout_notify<F: Fn(&Self) + Send + Sync + 'static>(
1218 &self,
1219 f: F,
1220 ) -> SignalHandlerId {
1221 unsafe extern "C" fn notify_ensure_keyunit_on_start_timeout_trampoline<
1222 P: IsA<RTSPMediaFactory>,
1223 F: Fn(&P) + Send + Sync + 'static,
1224 >(
1225 this: *mut ffi::GstRTSPMediaFactory,
1226 _param_spec: glib::ffi::gpointer,
1227 f: glib::ffi::gpointer,
1228 ) {
1229 unsafe {
1230 let f: &F = &*(f as *const F);
1231 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1232 }
1233 }
1234 unsafe {
1235 let f: Box_<F> = Box_::new(f);
1236 connect_raw(
1237 self.as_ptr() as *mut _,
1238 c"notify::ensure-keyunit-on-start-timeout".as_ptr(),
1239 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1240 notify_ensure_keyunit_on_start_timeout_trampoline::<Self, F> as *const (),
1241 )),
1242 Box_::into_raw(f),
1243 )
1244 }
1245 }
1246
1247 #[doc(alias = "eos-shutdown")]
1248 fn connect_eos_shutdown_notify<F: Fn(&Self) + Send + Sync + 'static>(
1249 &self,
1250 f: F,
1251 ) -> SignalHandlerId {
1252 unsafe extern "C" fn notify_eos_shutdown_trampoline<
1253 P: IsA<RTSPMediaFactory>,
1254 F: Fn(&P) + Send + Sync + 'static,
1255 >(
1256 this: *mut ffi::GstRTSPMediaFactory,
1257 _param_spec: glib::ffi::gpointer,
1258 f: glib::ffi::gpointer,
1259 ) {
1260 unsafe {
1261 let f: &F = &*(f as *const F);
1262 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1263 }
1264 }
1265 unsafe {
1266 let f: Box_<F> = Box_::new(f);
1267 connect_raw(
1268 self.as_ptr() as *mut _,
1269 c"notify::eos-shutdown".as_ptr(),
1270 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1271 notify_eos_shutdown_trampoline::<Self, F> as *const (),
1272 )),
1273 Box_::into_raw(f),
1274 )
1275 }
1276 }
1277
1278 #[doc(alias = "latency")]
1279 fn connect_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(
1280 &self,
1281 f: F,
1282 ) -> SignalHandlerId {
1283 unsafe extern "C" fn notify_latency_trampoline<
1284 P: IsA<RTSPMediaFactory>,
1285 F: Fn(&P) + Send + Sync + 'static,
1286 >(
1287 this: *mut ffi::GstRTSPMediaFactory,
1288 _param_spec: glib::ffi::gpointer,
1289 f: glib::ffi::gpointer,
1290 ) {
1291 unsafe {
1292 let f: &F = &*(f as *const F);
1293 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1294 }
1295 }
1296 unsafe {
1297 let f: Box_<F> = Box_::new(f);
1298 connect_raw(
1299 self.as_ptr() as *mut _,
1300 c"notify::latency".as_ptr(),
1301 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1302 notify_latency_trampoline::<Self, F> as *const (),
1303 )),
1304 Box_::into_raw(f),
1305 )
1306 }
1307 }
1308
1309 #[doc(alias = "launch")]
1310 fn connect_launch_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1311 unsafe extern "C" fn notify_launch_trampoline<
1312 P: IsA<RTSPMediaFactory>,
1313 F: Fn(&P) + Send + Sync + 'static,
1314 >(
1315 this: *mut ffi::GstRTSPMediaFactory,
1316 _param_spec: glib::ffi::gpointer,
1317 f: glib::ffi::gpointer,
1318 ) {
1319 unsafe {
1320 let f: &F = &*(f as *const F);
1321 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1322 }
1323 }
1324 unsafe {
1325 let f: Box_<F> = Box_::new(f);
1326 connect_raw(
1327 self.as_ptr() as *mut _,
1328 c"notify::launch".as_ptr(),
1329 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1330 notify_launch_trampoline::<Self, F> as *const (),
1331 )),
1332 Box_::into_raw(f),
1333 )
1334 }
1335 }
1336
1337 #[doc(alias = "max-mcast-ttl")]
1338 fn connect_max_mcast_ttl_notify<F: Fn(&Self) + Send + Sync + 'static>(
1339 &self,
1340 f: F,
1341 ) -> SignalHandlerId {
1342 unsafe extern "C" fn notify_max_mcast_ttl_trampoline<
1343 P: IsA<RTSPMediaFactory>,
1344 F: Fn(&P) + Send + Sync + 'static,
1345 >(
1346 this: *mut ffi::GstRTSPMediaFactory,
1347 _param_spec: glib::ffi::gpointer,
1348 f: glib::ffi::gpointer,
1349 ) {
1350 unsafe {
1351 let f: &F = &*(f as *const F);
1352 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1353 }
1354 }
1355 unsafe {
1356 let f: Box_<F> = Box_::new(f);
1357 connect_raw(
1358 self.as_ptr() as *mut _,
1359 c"notify::max-mcast-ttl".as_ptr(),
1360 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1361 notify_max_mcast_ttl_trampoline::<Self, F> as *const (),
1362 )),
1363 Box_::into_raw(f),
1364 )
1365 }
1366 }
1367
1368 #[doc(alias = "profiles")]
1369 fn connect_profiles_notify<F: Fn(&Self) + Send + Sync + 'static>(
1370 &self,
1371 f: F,
1372 ) -> SignalHandlerId {
1373 unsafe extern "C" fn notify_profiles_trampoline<
1374 P: IsA<RTSPMediaFactory>,
1375 F: Fn(&P) + Send + Sync + 'static,
1376 >(
1377 this: *mut ffi::GstRTSPMediaFactory,
1378 _param_spec: glib::ffi::gpointer,
1379 f: glib::ffi::gpointer,
1380 ) {
1381 unsafe {
1382 let f: &F = &*(f as *const F);
1383 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1384 }
1385 }
1386 unsafe {
1387 let f: Box_<F> = Box_::new(f);
1388 connect_raw(
1389 self.as_ptr() as *mut _,
1390 c"notify::profiles".as_ptr(),
1391 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1392 notify_profiles_trampoline::<Self, F> as *const (),
1393 )),
1394 Box_::into_raw(f),
1395 )
1396 }
1397 }
1398
1399 #[doc(alias = "protocols")]
1400 fn connect_protocols_notify<F: Fn(&Self) + Send + Sync + 'static>(
1401 &self,
1402 f: F,
1403 ) -> SignalHandlerId {
1404 unsafe extern "C" fn notify_protocols_trampoline<
1405 P: IsA<RTSPMediaFactory>,
1406 F: Fn(&P) + Send + Sync + 'static,
1407 >(
1408 this: *mut ffi::GstRTSPMediaFactory,
1409 _param_spec: glib::ffi::gpointer,
1410 f: glib::ffi::gpointer,
1411 ) {
1412 unsafe {
1413 let f: &F = &*(f as *const F);
1414 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1415 }
1416 }
1417 unsafe {
1418 let f: Box_<F> = Box_::new(f);
1419 connect_raw(
1420 self.as_ptr() as *mut _,
1421 c"notify::protocols".as_ptr(),
1422 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1423 notify_protocols_trampoline::<Self, F> as *const (),
1424 )),
1425 Box_::into_raw(f),
1426 )
1427 }
1428 }
1429
1430 #[doc(alias = "shared")]
1431 fn connect_shared_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1432 unsafe extern "C" fn notify_shared_trampoline<
1433 P: IsA<RTSPMediaFactory>,
1434 F: Fn(&P) + Send + Sync + 'static,
1435 >(
1436 this: *mut ffi::GstRTSPMediaFactory,
1437 _param_spec: glib::ffi::gpointer,
1438 f: glib::ffi::gpointer,
1439 ) {
1440 unsafe {
1441 let f: &F = &*(f as *const F);
1442 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1443 }
1444 }
1445 unsafe {
1446 let f: Box_<F> = Box_::new(f);
1447 connect_raw(
1448 self.as_ptr() as *mut _,
1449 c"notify::shared".as_ptr(),
1450 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1451 notify_shared_trampoline::<Self, F> as *const (),
1452 )),
1453 Box_::into_raw(f),
1454 )
1455 }
1456 }
1457
1458 #[doc(alias = "stop-on-disconnect")]
1459 fn connect_stop_on_disconnect_notify<F: Fn(&Self) + Send + Sync + 'static>(
1460 &self,
1461 f: F,
1462 ) -> SignalHandlerId {
1463 unsafe extern "C" fn notify_stop_on_disconnect_trampoline<
1464 P: IsA<RTSPMediaFactory>,
1465 F: Fn(&P) + Send + Sync + 'static,
1466 >(
1467 this: *mut ffi::GstRTSPMediaFactory,
1468 _param_spec: glib::ffi::gpointer,
1469 f: glib::ffi::gpointer,
1470 ) {
1471 unsafe {
1472 let f: &F = &*(f as *const F);
1473 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1474 }
1475 }
1476 unsafe {
1477 let f: Box_<F> = Box_::new(f);
1478 connect_raw(
1479 self.as_ptr() as *mut _,
1480 c"notify::stop-on-disconnect".as_ptr(),
1481 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1482 notify_stop_on_disconnect_trampoline::<Self, F> as *const (),
1483 )),
1484 Box_::into_raw(f),
1485 )
1486 }
1487 }
1488
1489 #[doc(alias = "suspend-mode")]
1490 fn connect_suspend_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
1491 &self,
1492 f: F,
1493 ) -> SignalHandlerId {
1494 unsafe extern "C" fn notify_suspend_mode_trampoline<
1495 P: IsA<RTSPMediaFactory>,
1496 F: Fn(&P) + Send + Sync + 'static,
1497 >(
1498 this: *mut ffi::GstRTSPMediaFactory,
1499 _param_spec: glib::ffi::gpointer,
1500 f: glib::ffi::gpointer,
1501 ) {
1502 unsafe {
1503 let f: &F = &*(f as *const F);
1504 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1505 }
1506 }
1507 unsafe {
1508 let f: Box_<F> = Box_::new(f);
1509 connect_raw(
1510 self.as_ptr() as *mut _,
1511 c"notify::suspend-mode".as_ptr(),
1512 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1513 notify_suspend_mode_trampoline::<Self, F> as *const (),
1514 )),
1515 Box_::into_raw(f),
1516 )
1517 }
1518 }
1519
1520 #[doc(alias = "transport-mode")]
1521 fn connect_transport_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
1522 &self,
1523 f: F,
1524 ) -> SignalHandlerId {
1525 unsafe extern "C" fn notify_transport_mode_trampoline<
1526 P: IsA<RTSPMediaFactory>,
1527 F: Fn(&P) + Send + Sync + 'static,
1528 >(
1529 this: *mut ffi::GstRTSPMediaFactory,
1530 _param_spec: glib::ffi::gpointer,
1531 f: glib::ffi::gpointer,
1532 ) {
1533 unsafe {
1534 let f: &F = &*(f as *const F);
1535 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1536 }
1537 }
1538 unsafe {
1539 let f: Box_<F> = Box_::new(f);
1540 connect_raw(
1541 self.as_ptr() as *mut _,
1542 c"notify::transport-mode".as_ptr(),
1543 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1544 notify_transport_mode_trampoline::<Self, F> as *const (),
1545 )),
1546 Box_::into_raw(f),
1547 )
1548 }
1549 }
1550}
1551
1552impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {}