1#![allow(deprecated)]
6
7use crate::{
8 ffi, PlayAudioInfo, PlayColorBalanceType, PlayMediaInfo, PlaySubtitleInfo, PlayVideoInfo,
9 PlayVideoRenderer, PlayVisualization,
10};
11use glib::{
12 prelude::*,
13 signal::{connect_raw, SignalHandlerId},
14 translate::*,
15};
16use std::boxed::Box as Box_;
17
18glib::wrapper! {
19 #[doc(alias = "GstPlay")]
145 pub struct Play(Object<ffi::GstPlay, ffi::GstPlayClass>) @extends gst::Object;
146
147 match fn {
148 type_ => || ffi::gst_play_get_type(),
149 }
150}
151
152impl Play {
153 #[doc(alias = "gst_play_new")]
168 pub fn new(video_renderer: Option<impl IsA<PlayVideoRenderer>>) -> Play {
169 assert_initialized_main_thread!();
170 unsafe {
171 from_glib_full(ffi::gst_play_new(
172 video_renderer.map(|p| p.upcast()).into_glib_ptr(),
173 ))
174 }
175 }
176
177 #[doc(alias = "gst_play_get_audio_video_offset")]
183 #[doc(alias = "get_audio_video_offset")]
184 #[doc(alias = "audio-video-offset")]
185 pub fn audio_video_offset(&self) -> i64 {
186 unsafe { ffi::gst_play_get_audio_video_offset(self.to_glib_none().0) }
187 }
188
189 #[doc(alias = "gst_play_get_color_balance")]
198 #[doc(alias = "get_color_balance")]
199 pub fn color_balance(&self, type_: PlayColorBalanceType) -> f64 {
200 unsafe { ffi::gst_play_get_color_balance(self.to_glib_none().0, type_.into_glib()) }
201 }
202
203 #[doc(alias = "gst_play_get_current_audio_track")]
211 #[doc(alias = "get_current_audio_track")]
212 #[doc(alias = "current-audio-track")]
213 pub fn current_audio_track(&self) -> Option<PlayAudioInfo> {
214 unsafe { from_glib_full(ffi::gst_play_get_current_audio_track(self.to_glib_none().0)) }
215 }
216
217 #[doc(alias = "gst_play_get_current_subtitle_track")]
225 #[doc(alias = "get_current_subtitle_track")]
226 #[doc(alias = "current-subtitle-track")]
227 pub fn current_subtitle_track(&self) -> Option<PlaySubtitleInfo> {
228 unsafe {
229 from_glib_full(ffi::gst_play_get_current_subtitle_track(
230 self.to_glib_none().0,
231 ))
232 }
233 }
234
235 #[doc(alias = "gst_play_get_current_video_track")]
243 #[doc(alias = "get_current_video_track")]
244 #[doc(alias = "current-video-track")]
245 pub fn current_video_track(&self) -> Option<PlayVideoInfo> {
246 unsafe { from_glib_full(ffi::gst_play_get_current_video_track(self.to_glib_none().0)) }
247 }
248
249 #[doc(alias = "gst_play_get_current_visualization")]
256 #[doc(alias = "get_current_visualization")]
257 pub fn current_visualization(&self) -> Option<glib::GString> {
258 unsafe {
259 from_glib_full(ffi::gst_play_get_current_visualization(
260 self.to_glib_none().0,
261 ))
262 }
263 }
264
265 #[doc(alias = "gst_play_get_duration")]
272 #[doc(alias = "get_duration")]
273 pub fn duration(&self) -> Option<gst::ClockTime> {
274 unsafe { from_glib(ffi::gst_play_get_duration(self.to_glib_none().0)) }
275 }
276
277 #[doc(alias = "gst_play_get_media_info")]
285 #[doc(alias = "get_media_info")]
286 #[doc(alias = "media-info")]
287 pub fn media_info(&self) -> Option<PlayMediaInfo> {
288 unsafe { from_glib_full(ffi::gst_play_get_media_info(self.to_glib_none().0)) }
289 }
290
291 #[doc(alias = "gst_play_get_message_bus")]
308 #[doc(alias = "get_message_bus")]
309 pub fn message_bus(&self) -> gst::Bus {
310 unsafe { from_glib_full(ffi::gst_play_get_message_bus(self.to_glib_none().0)) }
311 }
312
313 #[doc(alias = "gst_play_get_multiview_flags")]
319 #[doc(alias = "get_multiview_flags")]
320 pub fn multiview_flags(&self) -> gst_video::VideoMultiviewFlags {
321 unsafe { from_glib(ffi::gst_play_get_multiview_flags(self.to_glib_none().0)) }
322 }
323
324 #[doc(alias = "gst_play_get_multiview_mode")]
330 #[doc(alias = "get_multiview_mode")]
331 pub fn multiview_mode(&self) -> gst_video::VideoMultiviewFramePacking {
332 unsafe { from_glib(ffi::gst_play_get_multiview_mode(self.to_glib_none().0)) }
333 }
334
335 #[doc(alias = "gst_play_get_mute")]
340 #[doc(alias = "get_mute")]
341 #[doc(alias = "mute")]
342 pub fn is_muted(&self) -> bool {
343 unsafe { from_glib(ffi::gst_play_get_mute(self.to_glib_none().0)) }
344 }
345
346 #[doc(alias = "gst_play_get_pipeline")]
353 #[doc(alias = "get_pipeline")]
354 pub fn pipeline(&self) -> gst::Element {
355 unsafe { from_glib_full(ffi::gst_play_get_pipeline(self.to_glib_none().0)) }
356 }
357
358 #[doc(alias = "gst_play_get_position")]
364 #[doc(alias = "get_position")]
365 pub fn position(&self) -> Option<gst::ClockTime> {
366 unsafe { from_glib(ffi::gst_play_get_position(self.to_glib_none().0)) }
367 }
368
369 #[doc(alias = "gst_play_get_rate")]
374 #[doc(alias = "get_rate")]
375 pub fn rate(&self) -> f64 {
376 unsafe { ffi::gst_play_get_rate(self.to_glib_none().0) }
377 }
378
379 #[doc(alias = "gst_play_get_subtitle_uri")]
386 #[doc(alias = "get_subtitle_uri")]
387 pub fn subtitle_uri(&self) -> Option<glib::GString> {
388 unsafe { from_glib_full(ffi::gst_play_get_subtitle_uri(self.to_glib_none().0)) }
389 }
390
391 #[doc(alias = "gst_play_get_subtitle_video_offset")]
397 #[doc(alias = "get_subtitle_video_offset")]
398 #[doc(alias = "subtitle-video-offset")]
399 pub fn subtitle_video_offset(&self) -> i64 {
400 unsafe { ffi::gst_play_get_subtitle_video_offset(self.to_glib_none().0) }
401 }
402
403 #[doc(alias = "gst_play_get_uri")]
410 #[doc(alias = "get_uri")]
411 pub fn uri(&self) -> Option<glib::GString> {
412 unsafe { from_glib_full(ffi::gst_play_get_uri(self.to_glib_none().0)) }
413 }
414
415 #[doc(alias = "gst_play_get_volume")]
421 #[doc(alias = "get_volume")]
422 pub fn volume(&self) -> f64 {
423 unsafe { ffi::gst_play_get_volume(self.to_glib_none().0) }
424 }
425
426 #[doc(alias = "gst_play_has_color_balance")]
433 pub fn has_color_balance(&self) -> bool {
434 unsafe { from_glib(ffi::gst_play_has_color_balance(self.to_glib_none().0)) }
435 }
436
437 #[doc(alias = "gst_play_pause")]
439 pub fn pause(&self) {
440 unsafe {
441 ffi::gst_play_pause(self.to_glib_none().0);
442 }
443 }
444
445 #[doc(alias = "gst_play_play")]
447 pub fn play(&self) {
448 unsafe {
449 ffi::gst_play_play(self.to_glib_none().0);
450 }
451 }
452
453 #[doc(alias = "gst_play_seek")]
458 pub fn seek(&self, position: gst::ClockTime) {
459 unsafe {
460 ffi::gst_play_seek(self.to_glib_none().0, position.into_glib());
461 }
462 }
463
464 #[cfg_attr(feature = "v1_26", deprecated = "Since 1.26")]
477 #[allow(deprecated)]
478 #[doc(alias = "gst_play_set_audio_track")]
479 pub fn set_audio_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> {
480 unsafe {
481 glib::result_from_gboolean!(
482 ffi::gst_play_set_audio_track(self.to_glib_none().0, stream_index),
483 "Failed to set audio track"
484 )
485 }
486 }
487
488 #[doc(alias = "gst_play_set_audio_track_enabled")]
492 pub fn set_audio_track_enabled(&self, enabled: bool) {
493 unsafe {
494 ffi::gst_play_set_audio_track_enabled(self.to_glib_none().0, enabled.into_glib());
495 }
496 }
497
498 #[cfg(feature = "v1_26")]
507 #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
508 #[doc(alias = "gst_play_set_audio_track_id")]
509 pub fn set_audio_track_id(
510 &self,
511 stream_id: Option<&str>,
512 ) -> Result<(), glib::error::BoolError> {
513 unsafe {
514 glib::result_from_gboolean!(
515 ffi::gst_play_set_audio_track_id(self.to_glib_none().0, stream_id.to_glib_none().0),
516 "Failed to set audio track"
517 )
518 }
519 }
520
521 #[doc(alias = "gst_play_set_audio_video_offset")]
525 #[doc(alias = "audio-video-offset")]
526 pub fn set_audio_video_offset(&self, offset: i64) {
527 unsafe {
528 ffi::gst_play_set_audio_video_offset(self.to_glib_none().0, offset);
529 }
530 }
531
532 #[doc(alias = "gst_play_set_color_balance")]
539 pub fn set_color_balance(&self, type_: PlayColorBalanceType, value: f64) {
540 unsafe {
541 ffi::gst_play_set_color_balance(self.to_glib_none().0, type_.into_glib(), value);
542 }
543 }
544
545 #[doc(alias = "gst_play_set_multiview_flags")]
550 pub fn set_multiview_flags(&self, flags: gst_video::VideoMultiviewFlags) {
551 unsafe {
552 ffi::gst_play_set_multiview_flags(self.to_glib_none().0, flags.into_glib());
553 }
554 }
555
556 #[doc(alias = "gst_play_set_multiview_mode")]
561 pub fn set_multiview_mode(&self, mode: gst_video::VideoMultiviewFramePacking) {
562 unsafe {
563 ffi::gst_play_set_multiview_mode(self.to_glib_none().0, mode.into_glib());
564 }
565 }
566
567 #[doc(alias = "gst_play_set_mute")]
571 #[doc(alias = "mute")]
572 pub fn set_mute(&self, val: bool) {
573 unsafe {
574 ffi::gst_play_set_mute(self.to_glib_none().0, val.into_glib());
575 }
576 }
577
578 #[doc(alias = "gst_play_set_rate")]
582 #[doc(alias = "rate")]
583 pub fn set_rate(&self, rate: f64) {
584 unsafe {
585 ffi::gst_play_set_rate(self.to_glib_none().0, rate);
586 }
587 }
588
589 #[cfg_attr(feature = "v1_26", deprecated = "Since 1.26")]
602 #[allow(deprecated)]
603 #[doc(alias = "gst_play_set_subtitle_track")]
604 pub fn set_subtitle_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> {
605 unsafe {
606 glib::result_from_gboolean!(
607 ffi::gst_play_set_subtitle_track(self.to_glib_none().0, stream_index),
608 "Failed to set subtitle track"
609 )
610 }
611 }
612
613 #[doc(alias = "gst_play_set_subtitle_track_enabled")]
617 pub fn set_subtitle_track_enabled(&self, enabled: bool) {
618 unsafe {
619 ffi::gst_play_set_subtitle_track_enabled(self.to_glib_none().0, enabled.into_glib());
620 }
621 }
622
623 #[cfg(feature = "v1_26")]
632 #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
633 #[doc(alias = "gst_play_set_subtitle_track_id")]
634 pub fn set_subtitle_track_id(
635 &self,
636 stream_id: Option<&str>,
637 ) -> Result<(), glib::error::BoolError> {
638 unsafe {
639 glib::result_from_gboolean!(
640 ffi::gst_play_set_subtitle_track_id(
641 self.to_glib_none().0,
642 stream_id.to_glib_none().0
643 ),
644 "Failed to set subtitle track"
645 )
646 }
647 }
648
649 #[doc(alias = "gst_play_set_subtitle_uri")]
655 pub fn set_subtitle_uri(&self, uri: Option<&str>) {
656 unsafe {
657 ffi::gst_play_set_subtitle_uri(self.to_glib_none().0, uri.to_glib_none().0);
658 }
659 }
660
661 #[doc(alias = "gst_play_set_subtitle_video_offset")]
665 #[doc(alias = "subtitle-video-offset")]
666 pub fn set_subtitle_video_offset(&self, offset: i64) {
667 unsafe {
668 ffi::gst_play_set_subtitle_video_offset(self.to_glib_none().0, offset);
669 }
670 }
671
672 #[cfg(feature = "v1_26")]
686 #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
687 #[doc(alias = "gst_play_set_track_ids")]
688 pub fn set_track_ids(
689 &self,
690 audio_stream_id: Option<&str>,
691 video_stream_id: Option<&str>,
692 subtitle_stream_id: Option<&str>,
693 ) -> Result<(), glib::error::BoolError> {
694 unsafe {
695 glib::result_from_gboolean!(
696 ffi::gst_play_set_track_ids(
697 self.to_glib_none().0,
698 audio_stream_id.to_glib_none().0,
699 video_stream_id.to_glib_none().0,
700 subtitle_stream_id.to_glib_none().0
701 ),
702 "Failed to set tracks"
703 )
704 }
705 }
706
707 #[doc(alias = "gst_play_set_uri")]
711 #[doc(alias = "uri")]
712 pub fn set_uri(&self, uri: Option<&str>) {
713 unsafe {
714 ffi::gst_play_set_uri(self.to_glib_none().0, uri.to_glib_none().0);
715 }
716 }
717
718 #[cfg_attr(feature = "v1_26", deprecated = "Since 1.26")]
731 #[allow(deprecated)]
732 #[doc(alias = "gst_play_set_video_track")]
733 pub fn set_video_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> {
734 unsafe {
735 glib::result_from_gboolean!(
736 ffi::gst_play_set_video_track(self.to_glib_none().0, stream_index),
737 "Failed to set video track"
738 )
739 }
740 }
741
742 #[doc(alias = "gst_play_set_video_track_enabled")]
746 pub fn set_video_track_enabled(&self, enabled: bool) {
747 unsafe {
748 ffi::gst_play_set_video_track_enabled(self.to_glib_none().0, enabled.into_glib());
749 }
750 }
751
752 #[cfg(feature = "v1_26")]
761 #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
762 #[doc(alias = "gst_play_set_video_track_id")]
763 pub fn set_video_track_id(
764 &self,
765 stream_id: Option<&str>,
766 ) -> Result<(), glib::error::BoolError> {
767 unsafe {
768 glib::result_from_gboolean!(
769 ffi::gst_play_set_video_track_id(self.to_glib_none().0, stream_id.to_glib_none().0),
770 "Failed to set video track"
771 )
772 }
773 }
774
775 #[doc(alias = "gst_play_set_visualization")]
784 pub fn set_visualization(&self, name: Option<&str>) -> Result<(), glib::error::BoolError> {
785 unsafe {
786 glib::result_from_gboolean!(
787 ffi::gst_play_set_visualization(self.to_glib_none().0, name.to_glib_none().0),
788 "Failed to set visualization"
789 )
790 }
791 }
792
793 #[doc(alias = "gst_play_set_visualization_enabled")]
797 pub fn set_visualization_enabled(&self, enabled: bool) {
798 unsafe {
799 ffi::gst_play_set_visualization_enabled(self.to_glib_none().0, enabled.into_glib());
800 }
801 }
802
803 #[doc(alias = "gst_play_set_volume")]
807 #[doc(alias = "volume")]
808 pub fn set_volume(&self, val: f64) {
809 unsafe {
810 ffi::gst_play_set_volume(self.to_glib_none().0, val);
811 }
812 }
813
814 #[doc(alias = "gst_play_stop")]
817 pub fn stop(&self) {
818 unsafe {
819 ffi::gst_play_stop(self.to_glib_none().0);
820 }
821 }
822
823 pub fn suburi(&self) -> Option<glib::GString> {
824 ObjectExt::property(self, "suburi")
825 }
826
827 pub fn set_suburi(&self, suburi: Option<&str>) {
828 ObjectExt::set_property(self, "suburi", suburi)
829 }
830
831 #[doc(alias = "video-multiview-flags")]
832 pub fn video_multiview_flags(&self) -> gst_video::VideoMultiviewFlags {
833 ObjectExt::property(self, "video-multiview-flags")
834 }
835
836 #[doc(alias = "video-multiview-flags")]
837 pub fn set_video_multiview_flags(&self, video_multiview_flags: gst_video::VideoMultiviewFlags) {
838 ObjectExt::set_property(self, "video-multiview-flags", video_multiview_flags)
839 }
840
841 #[doc(alias = "video-multiview-mode")]
842 pub fn video_multiview_mode(&self) -> gst_video::VideoMultiviewFramePacking {
843 ObjectExt::property(self, "video-multiview-mode")
844 }
845
846 #[doc(alias = "video-multiview-mode")]
847 pub fn set_video_multiview_mode(
848 &self,
849 video_multiview_mode: gst_video::VideoMultiviewFramePacking,
850 ) {
851 ObjectExt::set_property(self, "video-multiview-mode", video_multiview_mode)
852 }
853
854 #[doc(alias = "video-renderer")]
855 pub fn video_renderer(&self) -> Option<PlayVideoRenderer> {
856 ObjectExt::property(self, "video-renderer")
857 }
858
859 #[doc(alias = "video-renderer")]
860 pub fn set_video_renderer<P: IsA<PlayVideoRenderer>>(&self, video_renderer: Option<&P>) {
861 ObjectExt::set_property(self, "video-renderer", video_renderer)
862 }
863
864 #[doc(alias = "gst_play_get_audio_streams")]
872 #[doc(alias = "get_audio_streams")]
873 pub fn audio_streams(info: &PlayMediaInfo) -> Vec<PlayAudioInfo> {
874 skip_assert_initialized!();
875 unsafe {
876 FromGlibPtrContainer::from_glib_none(ffi::gst_play_get_audio_streams(
877 info.to_glib_none().0,
878 ))
879 }
880 }
881
882 #[doc(alias = "gst_play_get_subtitle_streams")]
890 #[doc(alias = "get_subtitle_streams")]
891 pub fn subtitle_streams(info: &PlayMediaInfo) -> Vec<PlaySubtitleInfo> {
892 skip_assert_initialized!();
893 unsafe {
894 FromGlibPtrContainer::from_glib_none(ffi::gst_play_get_subtitle_streams(
895 info.to_glib_none().0,
896 ))
897 }
898 }
899
900 #[doc(alias = "gst_play_get_video_streams")]
908 #[doc(alias = "get_video_streams")]
909 pub fn video_streams(info: &PlayMediaInfo) -> Vec<PlayVideoInfo> {
910 skip_assert_initialized!();
911 unsafe {
912 FromGlibPtrContainer::from_glib_none(ffi::gst_play_get_video_streams(
913 info.to_glib_none().0,
914 ))
915 }
916 }
917
918 #[doc(alias = "gst_play_is_play_message")]
925 pub fn is_play_message(msg: &gst::Message) -> bool {
926 assert_initialized_main_thread!();
927 unsafe { from_glib(ffi::gst_play_is_play_message(msg.to_glib_none().0)) }
928 }
929
930 #[doc(alias = "gst_play_visualizations_get")]
938 pub fn visualizations_get() -> Vec<PlayVisualization> {
939 assert_initialized_main_thread!();
940 unsafe { FromGlibPtrContainer::from_glib_full(ffi::gst_play_visualizations_get()) }
941 }
942
943 #[doc(alias = "audio-video-offset")]
944 pub fn connect_audio_video_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
945 &self,
946 f: F,
947 ) -> SignalHandlerId {
948 unsafe extern "C" fn notify_audio_video_offset_trampoline<
949 F: Fn(&Play) + Send + Sync + 'static,
950 >(
951 this: *mut ffi::GstPlay,
952 _param_spec: glib::ffi::gpointer,
953 f: glib::ffi::gpointer,
954 ) {
955 let f: &F = &*(f as *const F);
956 f(&from_glib_borrow(this))
957 }
958 unsafe {
959 let f: Box_<F> = Box_::new(f);
960 connect_raw(
961 self.as_ptr() as *mut _,
962 c"notify::audio-video-offset".as_ptr() as *const _,
963 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
964 notify_audio_video_offset_trampoline::<F> as *const (),
965 )),
966 Box_::into_raw(f),
967 )
968 }
969 }
970
971 #[doc(alias = "current-audio-track")]
972 pub fn connect_current_audio_track_notify<F: Fn(&Self) + Send + Sync + 'static>(
973 &self,
974 f: F,
975 ) -> SignalHandlerId {
976 unsafe extern "C" fn notify_current_audio_track_trampoline<
977 F: Fn(&Play) + Send + Sync + 'static,
978 >(
979 this: *mut ffi::GstPlay,
980 _param_spec: glib::ffi::gpointer,
981 f: glib::ffi::gpointer,
982 ) {
983 let f: &F = &*(f as *const F);
984 f(&from_glib_borrow(this))
985 }
986 unsafe {
987 let f: Box_<F> = Box_::new(f);
988 connect_raw(
989 self.as_ptr() as *mut _,
990 c"notify::current-audio-track".as_ptr() as *const _,
991 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
992 notify_current_audio_track_trampoline::<F> as *const (),
993 )),
994 Box_::into_raw(f),
995 )
996 }
997 }
998
999 #[doc(alias = "current-subtitle-track")]
1000 pub fn connect_current_subtitle_track_notify<F: Fn(&Self) + Send + Sync + 'static>(
1001 &self,
1002 f: F,
1003 ) -> SignalHandlerId {
1004 unsafe extern "C" fn notify_current_subtitle_track_trampoline<
1005 F: Fn(&Play) + Send + Sync + 'static,
1006 >(
1007 this: *mut ffi::GstPlay,
1008 _param_spec: glib::ffi::gpointer,
1009 f: glib::ffi::gpointer,
1010 ) {
1011 let f: &F = &*(f as *const F);
1012 f(&from_glib_borrow(this))
1013 }
1014 unsafe {
1015 let f: Box_<F> = Box_::new(f);
1016 connect_raw(
1017 self.as_ptr() as *mut _,
1018 c"notify::current-subtitle-track".as_ptr() as *const _,
1019 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1020 notify_current_subtitle_track_trampoline::<F> as *const (),
1021 )),
1022 Box_::into_raw(f),
1023 )
1024 }
1025 }
1026
1027 #[doc(alias = "current-video-track")]
1028 pub fn connect_current_video_track_notify<F: Fn(&Self) + Send + Sync + 'static>(
1029 &self,
1030 f: F,
1031 ) -> SignalHandlerId {
1032 unsafe extern "C" fn notify_current_video_track_trampoline<
1033 F: Fn(&Play) + Send + Sync + 'static,
1034 >(
1035 this: *mut ffi::GstPlay,
1036 _param_spec: glib::ffi::gpointer,
1037 f: glib::ffi::gpointer,
1038 ) {
1039 let f: &F = &*(f as *const F);
1040 f(&from_glib_borrow(this))
1041 }
1042 unsafe {
1043 let f: Box_<F> = Box_::new(f);
1044 connect_raw(
1045 self.as_ptr() as *mut _,
1046 c"notify::current-video-track".as_ptr() as *const _,
1047 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1048 notify_current_video_track_trampoline::<F> as *const (),
1049 )),
1050 Box_::into_raw(f),
1051 )
1052 }
1053 }
1054
1055 #[doc(alias = "duration")]
1056 pub fn connect_duration_notify<F: Fn(&Self) + Send + Sync + 'static>(
1057 &self,
1058 f: F,
1059 ) -> SignalHandlerId {
1060 unsafe extern "C" fn notify_duration_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1061 this: *mut ffi::GstPlay,
1062 _param_spec: glib::ffi::gpointer,
1063 f: glib::ffi::gpointer,
1064 ) {
1065 let f: &F = &*(f as *const F);
1066 f(&from_glib_borrow(this))
1067 }
1068 unsafe {
1069 let f: Box_<F> = Box_::new(f);
1070 connect_raw(
1071 self.as_ptr() as *mut _,
1072 c"notify::duration".as_ptr() as *const _,
1073 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1074 notify_duration_trampoline::<F> as *const (),
1075 )),
1076 Box_::into_raw(f),
1077 )
1078 }
1079 }
1080
1081 #[doc(alias = "media-info")]
1082 pub fn connect_media_info_notify<F: Fn(&Self) + Send + Sync + 'static>(
1083 &self,
1084 f: F,
1085 ) -> SignalHandlerId {
1086 unsafe extern "C" fn notify_media_info_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1087 this: *mut ffi::GstPlay,
1088 _param_spec: glib::ffi::gpointer,
1089 f: glib::ffi::gpointer,
1090 ) {
1091 let f: &F = &*(f as *const F);
1092 f(&from_glib_borrow(this))
1093 }
1094 unsafe {
1095 let f: Box_<F> = Box_::new(f);
1096 connect_raw(
1097 self.as_ptr() as *mut _,
1098 c"notify::media-info".as_ptr() as *const _,
1099 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1100 notify_media_info_trampoline::<F> as *const (),
1101 )),
1102 Box_::into_raw(f),
1103 )
1104 }
1105 }
1106
1107 #[doc(alias = "mute")]
1108 pub fn connect_mute_notify<F: Fn(&Self) + Send + Sync + 'static>(
1109 &self,
1110 f: F,
1111 ) -> SignalHandlerId {
1112 unsafe extern "C" fn notify_mute_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1113 this: *mut ffi::GstPlay,
1114 _param_spec: glib::ffi::gpointer,
1115 f: glib::ffi::gpointer,
1116 ) {
1117 let f: &F = &*(f as *const F);
1118 f(&from_glib_borrow(this))
1119 }
1120 unsafe {
1121 let f: Box_<F> = Box_::new(f);
1122 connect_raw(
1123 self.as_ptr() as *mut _,
1124 c"notify::mute".as_ptr() as *const _,
1125 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1126 notify_mute_trampoline::<F> as *const (),
1127 )),
1128 Box_::into_raw(f),
1129 )
1130 }
1131 }
1132
1133 #[doc(alias = "pipeline")]
1134 pub fn connect_pipeline_notify<F: Fn(&Self) + Send + Sync + 'static>(
1135 &self,
1136 f: F,
1137 ) -> SignalHandlerId {
1138 unsafe extern "C" fn notify_pipeline_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1139 this: *mut ffi::GstPlay,
1140 _param_spec: glib::ffi::gpointer,
1141 f: glib::ffi::gpointer,
1142 ) {
1143 let f: &F = &*(f as *const F);
1144 f(&from_glib_borrow(this))
1145 }
1146 unsafe {
1147 let f: Box_<F> = Box_::new(f);
1148 connect_raw(
1149 self.as_ptr() as *mut _,
1150 c"notify::pipeline".as_ptr() as *const _,
1151 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1152 notify_pipeline_trampoline::<F> as *const (),
1153 )),
1154 Box_::into_raw(f),
1155 )
1156 }
1157 }
1158
1159 #[doc(alias = "position")]
1160 pub fn connect_position_notify<F: Fn(&Self) + Send + Sync + 'static>(
1161 &self,
1162 f: F,
1163 ) -> SignalHandlerId {
1164 unsafe extern "C" fn notify_position_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1165 this: *mut ffi::GstPlay,
1166 _param_spec: glib::ffi::gpointer,
1167 f: glib::ffi::gpointer,
1168 ) {
1169 let f: &F = &*(f as *const F);
1170 f(&from_glib_borrow(this))
1171 }
1172 unsafe {
1173 let f: Box_<F> = Box_::new(f);
1174 connect_raw(
1175 self.as_ptr() as *mut _,
1176 c"notify::position".as_ptr() as *const _,
1177 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1178 notify_position_trampoline::<F> as *const (),
1179 )),
1180 Box_::into_raw(f),
1181 )
1182 }
1183 }
1184
1185 #[doc(alias = "rate")]
1186 pub fn connect_rate_notify<F: Fn(&Self) + Send + Sync + 'static>(
1187 &self,
1188 f: F,
1189 ) -> SignalHandlerId {
1190 unsafe extern "C" fn notify_rate_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1191 this: *mut ffi::GstPlay,
1192 _param_spec: glib::ffi::gpointer,
1193 f: glib::ffi::gpointer,
1194 ) {
1195 let f: &F = &*(f as *const F);
1196 f(&from_glib_borrow(this))
1197 }
1198 unsafe {
1199 let f: Box_<F> = Box_::new(f);
1200 connect_raw(
1201 self.as_ptr() as *mut _,
1202 c"notify::rate".as_ptr() as *const _,
1203 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1204 notify_rate_trampoline::<F> as *const (),
1205 )),
1206 Box_::into_raw(f),
1207 )
1208 }
1209 }
1210
1211 #[doc(alias = "subtitle-video-offset")]
1212 pub fn connect_subtitle_video_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
1213 &self,
1214 f: F,
1215 ) -> SignalHandlerId {
1216 unsafe extern "C" fn notify_subtitle_video_offset_trampoline<
1217 F: Fn(&Play) + Send + Sync + 'static,
1218 >(
1219 this: *mut ffi::GstPlay,
1220 _param_spec: glib::ffi::gpointer,
1221 f: glib::ffi::gpointer,
1222 ) {
1223 let f: &F = &*(f as *const F);
1224 f(&from_glib_borrow(this))
1225 }
1226 unsafe {
1227 let f: Box_<F> = Box_::new(f);
1228 connect_raw(
1229 self.as_ptr() as *mut _,
1230 c"notify::subtitle-video-offset".as_ptr() as *const _,
1231 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1232 notify_subtitle_video_offset_trampoline::<F> as *const (),
1233 )),
1234 Box_::into_raw(f),
1235 )
1236 }
1237 }
1238
1239 #[doc(alias = "suburi")]
1240 pub fn connect_suburi_notify<F: Fn(&Self) + Send + Sync + 'static>(
1241 &self,
1242 f: F,
1243 ) -> SignalHandlerId {
1244 unsafe extern "C" fn notify_suburi_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1245 this: *mut ffi::GstPlay,
1246 _param_spec: glib::ffi::gpointer,
1247 f: glib::ffi::gpointer,
1248 ) {
1249 let f: &F = &*(f as *const F);
1250 f(&from_glib_borrow(this))
1251 }
1252 unsafe {
1253 let f: Box_<F> = Box_::new(f);
1254 connect_raw(
1255 self.as_ptr() as *mut _,
1256 c"notify::suburi".as_ptr() as *const _,
1257 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1258 notify_suburi_trampoline::<F> as *const (),
1259 )),
1260 Box_::into_raw(f),
1261 )
1262 }
1263 }
1264
1265 #[doc(alias = "uri")]
1266 pub fn connect_uri_notify<F: Fn(&Self) + Send + Sync + 'static>(
1267 &self,
1268 f: F,
1269 ) -> SignalHandlerId {
1270 unsafe extern "C" fn notify_uri_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1271 this: *mut ffi::GstPlay,
1272 _param_spec: glib::ffi::gpointer,
1273 f: glib::ffi::gpointer,
1274 ) {
1275 let f: &F = &*(f as *const F);
1276 f(&from_glib_borrow(this))
1277 }
1278 unsafe {
1279 let f: Box_<F> = Box_::new(f);
1280 connect_raw(
1281 self.as_ptr() as *mut _,
1282 c"notify::uri".as_ptr() as *const _,
1283 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1284 notify_uri_trampoline::<F> as *const (),
1285 )),
1286 Box_::into_raw(f),
1287 )
1288 }
1289 }
1290
1291 #[doc(alias = "video-multiview-flags")]
1292 pub fn connect_video_multiview_flags_notify<F: Fn(&Self) + Send + Sync + 'static>(
1293 &self,
1294 f: F,
1295 ) -> SignalHandlerId {
1296 unsafe extern "C" fn notify_video_multiview_flags_trampoline<
1297 F: Fn(&Play) + Send + Sync + 'static,
1298 >(
1299 this: *mut ffi::GstPlay,
1300 _param_spec: glib::ffi::gpointer,
1301 f: glib::ffi::gpointer,
1302 ) {
1303 let f: &F = &*(f as *const F);
1304 f(&from_glib_borrow(this))
1305 }
1306 unsafe {
1307 let f: Box_<F> = Box_::new(f);
1308 connect_raw(
1309 self.as_ptr() as *mut _,
1310 c"notify::video-multiview-flags".as_ptr() as *const _,
1311 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1312 notify_video_multiview_flags_trampoline::<F> as *const (),
1313 )),
1314 Box_::into_raw(f),
1315 )
1316 }
1317 }
1318
1319 #[doc(alias = "video-multiview-mode")]
1320 pub fn connect_video_multiview_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
1321 &self,
1322 f: F,
1323 ) -> SignalHandlerId {
1324 unsafe extern "C" fn notify_video_multiview_mode_trampoline<
1325 F: Fn(&Play) + Send + Sync + 'static,
1326 >(
1327 this: *mut ffi::GstPlay,
1328 _param_spec: glib::ffi::gpointer,
1329 f: glib::ffi::gpointer,
1330 ) {
1331 let f: &F = &*(f as *const F);
1332 f(&from_glib_borrow(this))
1333 }
1334 unsafe {
1335 let f: Box_<F> = Box_::new(f);
1336 connect_raw(
1337 self.as_ptr() as *mut _,
1338 c"notify::video-multiview-mode".as_ptr() as *const _,
1339 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1340 notify_video_multiview_mode_trampoline::<F> as *const (),
1341 )),
1342 Box_::into_raw(f),
1343 )
1344 }
1345 }
1346
1347 #[doc(alias = "video-renderer")]
1348 pub fn connect_video_renderer_notify<F: Fn(&Self) + Send + Sync + 'static>(
1349 &self,
1350 f: F,
1351 ) -> SignalHandlerId {
1352 unsafe extern "C" fn notify_video_renderer_trampoline<
1353 F: Fn(&Play) + Send + Sync + 'static,
1354 >(
1355 this: *mut ffi::GstPlay,
1356 _param_spec: glib::ffi::gpointer,
1357 f: glib::ffi::gpointer,
1358 ) {
1359 let f: &F = &*(f as *const F);
1360 f(&from_glib_borrow(this))
1361 }
1362 unsafe {
1363 let f: Box_<F> = Box_::new(f);
1364 connect_raw(
1365 self.as_ptr() as *mut _,
1366 c"notify::video-renderer".as_ptr() as *const _,
1367 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1368 notify_video_renderer_trampoline::<F> as *const (),
1369 )),
1370 Box_::into_raw(f),
1371 )
1372 }
1373 }
1374
1375 #[doc(alias = "volume")]
1376 pub fn connect_volume_notify<F: Fn(&Self) + Send + Sync + 'static>(
1377 &self,
1378 f: F,
1379 ) -> SignalHandlerId {
1380 unsafe extern "C" fn notify_volume_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1381 this: *mut ffi::GstPlay,
1382 _param_spec: glib::ffi::gpointer,
1383 f: glib::ffi::gpointer,
1384 ) {
1385 let f: &F = &*(f as *const F);
1386 f(&from_glib_borrow(this))
1387 }
1388 unsafe {
1389 let f: Box_<F> = Box_::new(f);
1390 connect_raw(
1391 self.as_ptr() as *mut _,
1392 c"notify::volume".as_ptr() as *const _,
1393 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1394 notify_volume_trampoline::<F> as *const (),
1395 )),
1396 Box_::into_raw(f),
1397 )
1398 }
1399 }
1400}
1401
1402unsafe impl Send for Play {}
1403unsafe impl Sync for Play {}