Skip to main content

gstreamer_play/auto/
play.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
4// DO NOT EDIT
5#![allow(deprecated)]
6
7use crate::{
8    PlayAudioInfo, PlayColorBalanceType, PlayMediaInfo, PlaySubtitleInfo, PlayVideoInfo,
9    PlayVideoRenderer, PlayVisualization, ffi,
10};
11use glib::{
12    prelude::*,
13    signal::{SignalHandlerId, connect_raw},
14    translate::*,
15};
16use std::boxed::Box as Box_;
17
18glib::wrapper! {
19    #[doc(alias = "GstPlay")]
20    pub struct Play(Object<ffi::GstPlay, ffi::GstPlayClass>) @extends gst::Object;
21
22    match fn {
23        type_ => || ffi::gst_play_get_type(),
24    }
25}
26
27impl Play {
28    #[doc(alias = "gst_play_new")]
29    pub fn new(video_renderer: Option<impl IsA<PlayVideoRenderer>>) -> Play {
30        assert_initialized_main_thread!();
31        unsafe {
32            from_glib_full(ffi::gst_play_new(
33                video_renderer.map(|p| p.upcast()).into_glib_ptr(),
34            ))
35        }
36    }
37
38    #[doc(alias = "gst_play_get_audio_video_offset")]
39    #[doc(alias = "get_audio_video_offset")]
40    #[doc(alias = "audio-video-offset")]
41    pub fn audio_video_offset(&self) -> i64 {
42        unsafe { ffi::gst_play_get_audio_video_offset(self.to_glib_none().0) }
43    }
44
45    #[doc(alias = "gst_play_get_color_balance")]
46    #[doc(alias = "get_color_balance")]
47    pub fn color_balance(&self, type_: PlayColorBalanceType) -> f64 {
48        unsafe { ffi::gst_play_get_color_balance(self.to_glib_none().0, type_.into_glib()) }
49    }
50
51    #[doc(alias = "gst_play_get_current_audio_track")]
52    #[doc(alias = "get_current_audio_track")]
53    #[doc(alias = "current-audio-track")]
54    pub fn current_audio_track(&self) -> Option<PlayAudioInfo> {
55        unsafe { from_glib_full(ffi::gst_play_get_current_audio_track(self.to_glib_none().0)) }
56    }
57
58    #[doc(alias = "gst_play_get_current_subtitle_track")]
59    #[doc(alias = "get_current_subtitle_track")]
60    #[doc(alias = "current-subtitle-track")]
61    pub fn current_subtitle_track(&self) -> Option<PlaySubtitleInfo> {
62        unsafe {
63            from_glib_full(ffi::gst_play_get_current_subtitle_track(
64                self.to_glib_none().0,
65            ))
66        }
67    }
68
69    #[doc(alias = "gst_play_get_current_video_track")]
70    #[doc(alias = "get_current_video_track")]
71    #[doc(alias = "current-video-track")]
72    pub fn current_video_track(&self) -> Option<PlayVideoInfo> {
73        unsafe { from_glib_full(ffi::gst_play_get_current_video_track(self.to_glib_none().0)) }
74    }
75
76    #[doc(alias = "gst_play_get_current_visualization")]
77    #[doc(alias = "get_current_visualization")]
78    pub fn current_visualization(&self) -> Option<glib::GString> {
79        unsafe {
80            from_glib_full(ffi::gst_play_get_current_visualization(
81                self.to_glib_none().0,
82            ))
83        }
84    }
85
86    #[doc(alias = "gst_play_get_duration")]
87    #[doc(alias = "get_duration")]
88    pub fn duration(&self) -> Option<gst::ClockTime> {
89        unsafe { from_glib(ffi::gst_play_get_duration(self.to_glib_none().0)) }
90    }
91
92    #[doc(alias = "gst_play_get_media_info")]
93    #[doc(alias = "get_media_info")]
94    #[doc(alias = "media-info")]
95    pub fn media_info(&self) -> Option<PlayMediaInfo> {
96        unsafe { from_glib_full(ffi::gst_play_get_media_info(self.to_glib_none().0)) }
97    }
98
99    #[doc(alias = "gst_play_get_message_bus")]
100    #[doc(alias = "get_message_bus")]
101    pub fn message_bus(&self) -> gst::Bus {
102        unsafe { from_glib_full(ffi::gst_play_get_message_bus(self.to_glib_none().0)) }
103    }
104
105    #[doc(alias = "gst_play_get_multiview_flags")]
106    #[doc(alias = "get_multiview_flags")]
107    pub fn multiview_flags(&self) -> gst_video::VideoMultiviewFlags {
108        unsafe { from_glib(ffi::gst_play_get_multiview_flags(self.to_glib_none().0)) }
109    }
110
111    #[doc(alias = "gst_play_get_multiview_mode")]
112    #[doc(alias = "get_multiview_mode")]
113    pub fn multiview_mode(&self) -> gst_video::VideoMultiviewFramePacking {
114        unsafe { from_glib(ffi::gst_play_get_multiview_mode(self.to_glib_none().0)) }
115    }
116
117    #[doc(alias = "gst_play_get_mute")]
118    #[doc(alias = "get_mute")]
119    #[doc(alias = "mute")]
120    pub fn is_muted(&self) -> bool {
121        unsafe { from_glib(ffi::gst_play_get_mute(self.to_glib_none().0)) }
122    }
123
124    #[doc(alias = "gst_play_get_pipeline")]
125    #[doc(alias = "get_pipeline")]
126    pub fn pipeline(&self) -> gst::Element {
127        unsafe { from_glib_full(ffi::gst_play_get_pipeline(self.to_glib_none().0)) }
128    }
129
130    #[doc(alias = "gst_play_get_position")]
131    #[doc(alias = "get_position")]
132    pub fn position(&self) -> Option<gst::ClockTime> {
133        unsafe { from_glib(ffi::gst_play_get_position(self.to_glib_none().0)) }
134    }
135
136    #[doc(alias = "gst_play_get_rate")]
137    #[doc(alias = "get_rate")]
138    pub fn rate(&self) -> f64 {
139        unsafe { ffi::gst_play_get_rate(self.to_glib_none().0) }
140    }
141
142    #[doc(alias = "gst_play_get_subtitle_uri")]
143    #[doc(alias = "get_subtitle_uri")]
144    pub fn subtitle_uri(&self) -> Option<glib::GString> {
145        unsafe { from_glib_full(ffi::gst_play_get_subtitle_uri(self.to_glib_none().0)) }
146    }
147
148    #[doc(alias = "gst_play_get_subtitle_video_offset")]
149    #[doc(alias = "get_subtitle_video_offset")]
150    #[doc(alias = "subtitle-video-offset")]
151    pub fn subtitle_video_offset(&self) -> i64 {
152        unsafe { ffi::gst_play_get_subtitle_video_offset(self.to_glib_none().0) }
153    }
154
155    #[doc(alias = "gst_play_get_uri")]
156    #[doc(alias = "get_uri")]
157    pub fn uri(&self) -> Option<glib::GString> {
158        unsafe { from_glib_full(ffi::gst_play_get_uri(self.to_glib_none().0)) }
159    }
160
161    #[doc(alias = "gst_play_get_volume")]
162    #[doc(alias = "get_volume")]
163    pub fn volume(&self) -> f64 {
164        unsafe { ffi::gst_play_get_volume(self.to_glib_none().0) }
165    }
166
167    #[doc(alias = "gst_play_has_color_balance")]
168    pub fn has_color_balance(&self) -> bool {
169        unsafe { from_glib(ffi::gst_play_has_color_balance(self.to_glib_none().0)) }
170    }
171
172    #[doc(alias = "gst_play_pause")]
173    pub fn pause(&self) {
174        unsafe {
175            ffi::gst_play_pause(self.to_glib_none().0);
176        }
177    }
178
179    #[doc(alias = "gst_play_play")]
180    pub fn play(&self) {
181        unsafe {
182            ffi::gst_play_play(self.to_glib_none().0);
183        }
184    }
185
186    #[doc(alias = "gst_play_seek")]
187    pub fn seek(&self, position: gst::ClockTime) {
188        unsafe {
189            ffi::gst_play_seek(self.to_glib_none().0, position.into_glib());
190        }
191    }
192
193    #[cfg_attr(feature = "v1_26", deprecated = "Since 1.26")]
194    #[allow(deprecated)]
195    #[doc(alias = "gst_play_set_audio_track")]
196    pub fn set_audio_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> {
197        unsafe {
198            glib::result_from_gboolean!(
199                ffi::gst_play_set_audio_track(self.to_glib_none().0, stream_index),
200                "Failed to set audio track"
201            )
202        }
203    }
204
205    #[doc(alias = "gst_play_set_audio_track_enabled")]
206    pub fn set_audio_track_enabled(&self, enabled: bool) {
207        unsafe {
208            ffi::gst_play_set_audio_track_enabled(self.to_glib_none().0, enabled.into_glib());
209        }
210    }
211
212    #[cfg(feature = "v1_26")]
213    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
214    #[doc(alias = "gst_play_set_audio_track_id")]
215    pub fn set_audio_track_id(
216        &self,
217        stream_id: Option<&str>,
218    ) -> Result<(), glib::error::BoolError> {
219        unsafe {
220            glib::result_from_gboolean!(
221                ffi::gst_play_set_audio_track_id(self.to_glib_none().0, stream_id.to_glib_none().0),
222                "Failed to set audio track"
223            )
224        }
225    }
226
227    #[doc(alias = "gst_play_set_audio_video_offset")]
228    #[doc(alias = "audio-video-offset")]
229    pub fn set_audio_video_offset(&self, offset: i64) {
230        unsafe {
231            ffi::gst_play_set_audio_video_offset(self.to_glib_none().0, offset);
232        }
233    }
234
235    #[doc(alias = "gst_play_set_color_balance")]
236    pub fn set_color_balance(&self, type_: PlayColorBalanceType, value: f64) {
237        unsafe {
238            ffi::gst_play_set_color_balance(self.to_glib_none().0, type_.into_glib(), value);
239        }
240    }
241
242    #[doc(alias = "gst_play_set_multiview_flags")]
243    pub fn set_multiview_flags(&self, flags: gst_video::VideoMultiviewFlags) {
244        unsafe {
245            ffi::gst_play_set_multiview_flags(self.to_glib_none().0, flags.into_glib());
246        }
247    }
248
249    #[doc(alias = "gst_play_set_multiview_mode")]
250    pub fn set_multiview_mode(&self, mode: gst_video::VideoMultiviewFramePacking) {
251        unsafe {
252            ffi::gst_play_set_multiview_mode(self.to_glib_none().0, mode.into_glib());
253        }
254    }
255
256    #[doc(alias = "gst_play_set_mute")]
257    #[doc(alias = "mute")]
258    pub fn set_mute(&self, val: bool) {
259        unsafe {
260            ffi::gst_play_set_mute(self.to_glib_none().0, val.into_glib());
261        }
262    }
263
264    #[doc(alias = "gst_play_set_rate")]
265    #[doc(alias = "rate")]
266    pub fn set_rate(&self, rate: f64) {
267        unsafe {
268            ffi::gst_play_set_rate(self.to_glib_none().0, rate);
269        }
270    }
271
272    #[cfg_attr(feature = "v1_26", deprecated = "Since 1.26")]
273    #[allow(deprecated)]
274    #[doc(alias = "gst_play_set_subtitle_track")]
275    pub fn set_subtitle_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> {
276        unsafe {
277            glib::result_from_gboolean!(
278                ffi::gst_play_set_subtitle_track(self.to_glib_none().0, stream_index),
279                "Failed to set subtitle track"
280            )
281        }
282    }
283
284    #[doc(alias = "gst_play_set_subtitle_track_enabled")]
285    pub fn set_subtitle_track_enabled(&self, enabled: bool) {
286        unsafe {
287            ffi::gst_play_set_subtitle_track_enabled(self.to_glib_none().0, enabled.into_glib());
288        }
289    }
290
291    #[cfg(feature = "v1_26")]
292    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
293    #[doc(alias = "gst_play_set_subtitle_track_id")]
294    pub fn set_subtitle_track_id(
295        &self,
296        stream_id: Option<&str>,
297    ) -> Result<(), glib::error::BoolError> {
298        unsafe {
299            glib::result_from_gboolean!(
300                ffi::gst_play_set_subtitle_track_id(
301                    self.to_glib_none().0,
302                    stream_id.to_glib_none().0
303                ),
304                "Failed to set subtitle track"
305            )
306        }
307    }
308
309    #[doc(alias = "gst_play_set_subtitle_uri")]
310    pub fn set_subtitle_uri(&self, uri: Option<&str>) {
311        unsafe {
312            ffi::gst_play_set_subtitle_uri(self.to_glib_none().0, uri.to_glib_none().0);
313        }
314    }
315
316    #[doc(alias = "gst_play_set_subtitle_video_offset")]
317    #[doc(alias = "subtitle-video-offset")]
318    pub fn set_subtitle_video_offset(&self, offset: i64) {
319        unsafe {
320            ffi::gst_play_set_subtitle_video_offset(self.to_glib_none().0, offset);
321        }
322    }
323
324    #[cfg(feature = "v1_26")]
325    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
326    #[doc(alias = "gst_play_set_track_ids")]
327    pub fn set_track_ids(
328        &self,
329        audio_stream_id: Option<&str>,
330        video_stream_id: Option<&str>,
331        subtitle_stream_id: Option<&str>,
332    ) -> Result<(), glib::error::BoolError> {
333        unsafe {
334            glib::result_from_gboolean!(
335                ffi::gst_play_set_track_ids(
336                    self.to_glib_none().0,
337                    audio_stream_id.to_glib_none().0,
338                    video_stream_id.to_glib_none().0,
339                    subtitle_stream_id.to_glib_none().0
340                ),
341                "Failed to set tracks"
342            )
343        }
344    }
345
346    #[doc(alias = "gst_play_set_uri")]
347    #[doc(alias = "uri")]
348    pub fn set_uri(&self, uri: Option<&str>) {
349        unsafe {
350            ffi::gst_play_set_uri(self.to_glib_none().0, uri.to_glib_none().0);
351        }
352    }
353
354    #[cfg_attr(feature = "v1_26", deprecated = "Since 1.26")]
355    #[allow(deprecated)]
356    #[doc(alias = "gst_play_set_video_track")]
357    pub fn set_video_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> {
358        unsafe {
359            glib::result_from_gboolean!(
360                ffi::gst_play_set_video_track(self.to_glib_none().0, stream_index),
361                "Failed to set video track"
362            )
363        }
364    }
365
366    #[doc(alias = "gst_play_set_video_track_enabled")]
367    pub fn set_video_track_enabled(&self, enabled: bool) {
368        unsafe {
369            ffi::gst_play_set_video_track_enabled(self.to_glib_none().0, enabled.into_glib());
370        }
371    }
372
373    #[cfg(feature = "v1_26")]
374    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
375    #[doc(alias = "gst_play_set_video_track_id")]
376    pub fn set_video_track_id(
377        &self,
378        stream_id: Option<&str>,
379    ) -> Result<(), glib::error::BoolError> {
380        unsafe {
381            glib::result_from_gboolean!(
382                ffi::gst_play_set_video_track_id(self.to_glib_none().0, stream_id.to_glib_none().0),
383                "Failed to set video track"
384            )
385        }
386    }
387
388    #[doc(alias = "gst_play_set_visualization")]
389    pub fn set_visualization(&self, name: Option<&str>) -> Result<(), glib::error::BoolError> {
390        unsafe {
391            glib::result_from_gboolean!(
392                ffi::gst_play_set_visualization(self.to_glib_none().0, name.to_glib_none().0),
393                "Failed to set visualization"
394            )
395        }
396    }
397
398    #[doc(alias = "gst_play_set_visualization_enabled")]
399    pub fn set_visualization_enabled(&self, enabled: bool) {
400        unsafe {
401            ffi::gst_play_set_visualization_enabled(self.to_glib_none().0, enabled.into_glib());
402        }
403    }
404
405    #[doc(alias = "gst_play_set_volume")]
406    #[doc(alias = "volume")]
407    pub fn set_volume(&self, val: f64) {
408        unsafe {
409            ffi::gst_play_set_volume(self.to_glib_none().0, val);
410        }
411    }
412
413    #[doc(alias = "gst_play_stop")]
414    pub fn stop(&self) {
415        unsafe {
416            ffi::gst_play_stop(self.to_glib_none().0);
417        }
418    }
419
420    pub fn suburi(&self) -> Option<glib::GString> {
421        ObjectExt::property(self, "suburi")
422    }
423
424    pub fn set_suburi(&self, suburi: Option<&str>) {
425        ObjectExt::set_property(self, "suburi", suburi)
426    }
427
428    #[doc(alias = "video-multiview-flags")]
429    pub fn video_multiview_flags(&self) -> gst_video::VideoMultiviewFlags {
430        ObjectExt::property(self, "video-multiview-flags")
431    }
432
433    #[doc(alias = "video-multiview-flags")]
434    pub fn set_video_multiview_flags(&self, video_multiview_flags: gst_video::VideoMultiviewFlags) {
435        ObjectExt::set_property(self, "video-multiview-flags", video_multiview_flags)
436    }
437
438    #[doc(alias = "video-multiview-mode")]
439    pub fn video_multiview_mode(&self) -> gst_video::VideoMultiviewFramePacking {
440        ObjectExt::property(self, "video-multiview-mode")
441    }
442
443    #[doc(alias = "video-multiview-mode")]
444    pub fn set_video_multiview_mode(
445        &self,
446        video_multiview_mode: gst_video::VideoMultiviewFramePacking,
447    ) {
448        ObjectExt::set_property(self, "video-multiview-mode", video_multiview_mode)
449    }
450
451    #[doc(alias = "video-renderer")]
452    pub fn video_renderer(&self) -> Option<PlayVideoRenderer> {
453        ObjectExt::property(self, "video-renderer")
454    }
455
456    #[doc(alias = "video-renderer")]
457    pub fn set_video_renderer<P: IsA<PlayVideoRenderer>>(&self, video_renderer: Option<&P>) {
458        ObjectExt::set_property(self, "video-renderer", video_renderer)
459    }
460
461    #[doc(alias = "gst_play_get_audio_streams")]
462    #[doc(alias = "get_audio_streams")]
463    pub fn audio_streams(info: &PlayMediaInfo) -> Vec<PlayAudioInfo> {
464        skip_assert_initialized!();
465        unsafe {
466            FromGlibPtrContainer::from_glib_none(ffi::gst_play_get_audio_streams(
467                info.to_glib_none().0,
468            ))
469        }
470    }
471
472    #[doc(alias = "gst_play_get_subtitle_streams")]
473    #[doc(alias = "get_subtitle_streams")]
474    pub fn subtitle_streams(info: &PlayMediaInfo) -> Vec<PlaySubtitleInfo> {
475        skip_assert_initialized!();
476        unsafe {
477            FromGlibPtrContainer::from_glib_none(ffi::gst_play_get_subtitle_streams(
478                info.to_glib_none().0,
479            ))
480        }
481    }
482
483    #[doc(alias = "gst_play_get_video_streams")]
484    #[doc(alias = "get_video_streams")]
485    pub fn video_streams(info: &PlayMediaInfo) -> Vec<PlayVideoInfo> {
486        skip_assert_initialized!();
487        unsafe {
488            FromGlibPtrContainer::from_glib_none(ffi::gst_play_get_video_streams(
489                info.to_glib_none().0,
490            ))
491        }
492    }
493
494    #[doc(alias = "gst_play_is_play_message")]
495    pub fn is_play_message(msg: &gst::Message) -> bool {
496        assert_initialized_main_thread!();
497        unsafe { from_glib(ffi::gst_play_is_play_message(msg.to_glib_none().0)) }
498    }
499
500    #[doc(alias = "gst_play_visualizations_get")]
501    pub fn visualizations_get() -> Vec<PlayVisualization> {
502        assert_initialized_main_thread!();
503        unsafe { FromGlibPtrContainer::from_glib_full(ffi::gst_play_visualizations_get()) }
504    }
505
506    #[doc(alias = "audio-video-offset")]
507    pub fn connect_audio_video_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
508        &self,
509        f: F,
510    ) -> SignalHandlerId {
511        unsafe extern "C" fn notify_audio_video_offset_trampoline<
512            F: Fn(&Play) + Send + Sync + 'static,
513        >(
514            this: *mut ffi::GstPlay,
515            _param_spec: glib::ffi::gpointer,
516            f: glib::ffi::gpointer,
517        ) {
518            unsafe {
519                let f: &F = &*(f as *const F);
520                f(&from_glib_borrow(this))
521            }
522        }
523        unsafe {
524            let f: Box_<F> = Box_::new(f);
525            connect_raw(
526                self.as_ptr() as *mut _,
527                c"notify::audio-video-offset".as_ptr(),
528                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
529                    notify_audio_video_offset_trampoline::<F> as *const (),
530                )),
531                Box_::into_raw(f),
532            )
533        }
534    }
535
536    #[doc(alias = "current-audio-track")]
537    pub fn connect_current_audio_track_notify<F: Fn(&Self) + Send + Sync + 'static>(
538        &self,
539        f: F,
540    ) -> SignalHandlerId {
541        unsafe extern "C" fn notify_current_audio_track_trampoline<
542            F: Fn(&Play) + Send + Sync + 'static,
543        >(
544            this: *mut ffi::GstPlay,
545            _param_spec: glib::ffi::gpointer,
546            f: glib::ffi::gpointer,
547        ) {
548            unsafe {
549                let f: &F = &*(f as *const F);
550                f(&from_glib_borrow(this))
551            }
552        }
553        unsafe {
554            let f: Box_<F> = Box_::new(f);
555            connect_raw(
556                self.as_ptr() as *mut _,
557                c"notify::current-audio-track".as_ptr(),
558                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
559                    notify_current_audio_track_trampoline::<F> as *const (),
560                )),
561                Box_::into_raw(f),
562            )
563        }
564    }
565
566    #[doc(alias = "current-subtitle-track")]
567    pub fn connect_current_subtitle_track_notify<F: Fn(&Self) + Send + Sync + 'static>(
568        &self,
569        f: F,
570    ) -> SignalHandlerId {
571        unsafe extern "C" fn notify_current_subtitle_track_trampoline<
572            F: Fn(&Play) + Send + Sync + 'static,
573        >(
574            this: *mut ffi::GstPlay,
575            _param_spec: glib::ffi::gpointer,
576            f: glib::ffi::gpointer,
577        ) {
578            unsafe {
579                let f: &F = &*(f as *const F);
580                f(&from_glib_borrow(this))
581            }
582        }
583        unsafe {
584            let f: Box_<F> = Box_::new(f);
585            connect_raw(
586                self.as_ptr() as *mut _,
587                c"notify::current-subtitle-track".as_ptr(),
588                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
589                    notify_current_subtitle_track_trampoline::<F> as *const (),
590                )),
591                Box_::into_raw(f),
592            )
593        }
594    }
595
596    #[doc(alias = "current-video-track")]
597    pub fn connect_current_video_track_notify<F: Fn(&Self) + Send + Sync + 'static>(
598        &self,
599        f: F,
600    ) -> SignalHandlerId {
601        unsafe extern "C" fn notify_current_video_track_trampoline<
602            F: Fn(&Play) + Send + Sync + 'static,
603        >(
604            this: *mut ffi::GstPlay,
605            _param_spec: glib::ffi::gpointer,
606            f: glib::ffi::gpointer,
607        ) {
608            unsafe {
609                let f: &F = &*(f as *const F);
610                f(&from_glib_borrow(this))
611            }
612        }
613        unsafe {
614            let f: Box_<F> = Box_::new(f);
615            connect_raw(
616                self.as_ptr() as *mut _,
617                c"notify::current-video-track".as_ptr(),
618                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
619                    notify_current_video_track_trampoline::<F> as *const (),
620                )),
621                Box_::into_raw(f),
622            )
623        }
624    }
625
626    #[doc(alias = "duration")]
627    pub fn connect_duration_notify<F: Fn(&Self) + Send + Sync + 'static>(
628        &self,
629        f: F,
630    ) -> SignalHandlerId {
631        unsafe extern "C" fn notify_duration_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
632            this: *mut ffi::GstPlay,
633            _param_spec: glib::ffi::gpointer,
634            f: glib::ffi::gpointer,
635        ) {
636            unsafe {
637                let f: &F = &*(f as *const F);
638                f(&from_glib_borrow(this))
639            }
640        }
641        unsafe {
642            let f: Box_<F> = Box_::new(f);
643            connect_raw(
644                self.as_ptr() as *mut _,
645                c"notify::duration".as_ptr(),
646                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
647                    notify_duration_trampoline::<F> as *const (),
648                )),
649                Box_::into_raw(f),
650            )
651        }
652    }
653
654    #[doc(alias = "media-info")]
655    pub fn connect_media_info_notify<F: Fn(&Self) + Send + Sync + 'static>(
656        &self,
657        f: F,
658    ) -> SignalHandlerId {
659        unsafe extern "C" fn notify_media_info_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
660            this: *mut ffi::GstPlay,
661            _param_spec: glib::ffi::gpointer,
662            f: glib::ffi::gpointer,
663        ) {
664            unsafe {
665                let f: &F = &*(f as *const F);
666                f(&from_glib_borrow(this))
667            }
668        }
669        unsafe {
670            let f: Box_<F> = Box_::new(f);
671            connect_raw(
672                self.as_ptr() as *mut _,
673                c"notify::media-info".as_ptr(),
674                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
675                    notify_media_info_trampoline::<F> as *const (),
676                )),
677                Box_::into_raw(f),
678            )
679        }
680    }
681
682    #[doc(alias = "mute")]
683    pub fn connect_mute_notify<F: Fn(&Self) + Send + Sync + 'static>(
684        &self,
685        f: F,
686    ) -> SignalHandlerId {
687        unsafe extern "C" fn notify_mute_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
688            this: *mut ffi::GstPlay,
689            _param_spec: glib::ffi::gpointer,
690            f: glib::ffi::gpointer,
691        ) {
692            unsafe {
693                let f: &F = &*(f as *const F);
694                f(&from_glib_borrow(this))
695            }
696        }
697        unsafe {
698            let f: Box_<F> = Box_::new(f);
699            connect_raw(
700                self.as_ptr() as *mut _,
701                c"notify::mute".as_ptr(),
702                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
703                    notify_mute_trampoline::<F> as *const (),
704                )),
705                Box_::into_raw(f),
706            )
707        }
708    }
709
710    #[doc(alias = "pipeline")]
711    pub fn connect_pipeline_notify<F: Fn(&Self) + Send + Sync + 'static>(
712        &self,
713        f: F,
714    ) -> SignalHandlerId {
715        unsafe extern "C" fn notify_pipeline_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
716            this: *mut ffi::GstPlay,
717            _param_spec: glib::ffi::gpointer,
718            f: glib::ffi::gpointer,
719        ) {
720            unsafe {
721                let f: &F = &*(f as *const F);
722                f(&from_glib_borrow(this))
723            }
724        }
725        unsafe {
726            let f: Box_<F> = Box_::new(f);
727            connect_raw(
728                self.as_ptr() as *mut _,
729                c"notify::pipeline".as_ptr(),
730                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
731                    notify_pipeline_trampoline::<F> as *const (),
732                )),
733                Box_::into_raw(f),
734            )
735        }
736    }
737
738    #[doc(alias = "position")]
739    pub fn connect_position_notify<F: Fn(&Self) + Send + Sync + 'static>(
740        &self,
741        f: F,
742    ) -> SignalHandlerId {
743        unsafe extern "C" fn notify_position_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
744            this: *mut ffi::GstPlay,
745            _param_spec: glib::ffi::gpointer,
746            f: glib::ffi::gpointer,
747        ) {
748            unsafe {
749                let f: &F = &*(f as *const F);
750                f(&from_glib_borrow(this))
751            }
752        }
753        unsafe {
754            let f: Box_<F> = Box_::new(f);
755            connect_raw(
756                self.as_ptr() as *mut _,
757                c"notify::position".as_ptr(),
758                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
759                    notify_position_trampoline::<F> as *const (),
760                )),
761                Box_::into_raw(f),
762            )
763        }
764    }
765
766    #[doc(alias = "rate")]
767    pub fn connect_rate_notify<F: Fn(&Self) + Send + Sync + 'static>(
768        &self,
769        f: F,
770    ) -> SignalHandlerId {
771        unsafe extern "C" fn notify_rate_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
772            this: *mut ffi::GstPlay,
773            _param_spec: glib::ffi::gpointer,
774            f: glib::ffi::gpointer,
775        ) {
776            unsafe {
777                let f: &F = &*(f as *const F);
778                f(&from_glib_borrow(this))
779            }
780        }
781        unsafe {
782            let f: Box_<F> = Box_::new(f);
783            connect_raw(
784                self.as_ptr() as *mut _,
785                c"notify::rate".as_ptr(),
786                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
787                    notify_rate_trampoline::<F> as *const (),
788                )),
789                Box_::into_raw(f),
790            )
791        }
792    }
793
794    #[doc(alias = "subtitle-video-offset")]
795    pub fn connect_subtitle_video_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
796        &self,
797        f: F,
798    ) -> SignalHandlerId {
799        unsafe extern "C" fn notify_subtitle_video_offset_trampoline<
800            F: Fn(&Play) + Send + Sync + 'static,
801        >(
802            this: *mut ffi::GstPlay,
803            _param_spec: glib::ffi::gpointer,
804            f: glib::ffi::gpointer,
805        ) {
806            unsafe {
807                let f: &F = &*(f as *const F);
808                f(&from_glib_borrow(this))
809            }
810        }
811        unsafe {
812            let f: Box_<F> = Box_::new(f);
813            connect_raw(
814                self.as_ptr() as *mut _,
815                c"notify::subtitle-video-offset".as_ptr(),
816                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
817                    notify_subtitle_video_offset_trampoline::<F> as *const (),
818                )),
819                Box_::into_raw(f),
820            )
821        }
822    }
823
824    #[doc(alias = "suburi")]
825    pub fn connect_suburi_notify<F: Fn(&Self) + Send + Sync + 'static>(
826        &self,
827        f: F,
828    ) -> SignalHandlerId {
829        unsafe extern "C" fn notify_suburi_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
830            this: *mut ffi::GstPlay,
831            _param_spec: glib::ffi::gpointer,
832            f: glib::ffi::gpointer,
833        ) {
834            unsafe {
835                let f: &F = &*(f as *const F);
836                f(&from_glib_borrow(this))
837            }
838        }
839        unsafe {
840            let f: Box_<F> = Box_::new(f);
841            connect_raw(
842                self.as_ptr() as *mut _,
843                c"notify::suburi".as_ptr(),
844                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
845                    notify_suburi_trampoline::<F> as *const (),
846                )),
847                Box_::into_raw(f),
848            )
849        }
850    }
851
852    #[doc(alias = "uri")]
853    pub fn connect_uri_notify<F: Fn(&Self) + Send + Sync + 'static>(
854        &self,
855        f: F,
856    ) -> SignalHandlerId {
857        unsafe extern "C" fn notify_uri_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
858            this: *mut ffi::GstPlay,
859            _param_spec: glib::ffi::gpointer,
860            f: glib::ffi::gpointer,
861        ) {
862            unsafe {
863                let f: &F = &*(f as *const F);
864                f(&from_glib_borrow(this))
865            }
866        }
867        unsafe {
868            let f: Box_<F> = Box_::new(f);
869            connect_raw(
870                self.as_ptr() as *mut _,
871                c"notify::uri".as_ptr(),
872                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
873                    notify_uri_trampoline::<F> as *const (),
874                )),
875                Box_::into_raw(f),
876            )
877        }
878    }
879
880    #[doc(alias = "video-multiview-flags")]
881    pub fn connect_video_multiview_flags_notify<F: Fn(&Self) + Send + Sync + 'static>(
882        &self,
883        f: F,
884    ) -> SignalHandlerId {
885        unsafe extern "C" fn notify_video_multiview_flags_trampoline<
886            F: Fn(&Play) + Send + Sync + 'static,
887        >(
888            this: *mut ffi::GstPlay,
889            _param_spec: glib::ffi::gpointer,
890            f: glib::ffi::gpointer,
891        ) {
892            unsafe {
893                let f: &F = &*(f as *const F);
894                f(&from_glib_borrow(this))
895            }
896        }
897        unsafe {
898            let f: Box_<F> = Box_::new(f);
899            connect_raw(
900                self.as_ptr() as *mut _,
901                c"notify::video-multiview-flags".as_ptr(),
902                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
903                    notify_video_multiview_flags_trampoline::<F> as *const (),
904                )),
905                Box_::into_raw(f),
906            )
907        }
908    }
909
910    #[doc(alias = "video-multiview-mode")]
911    pub fn connect_video_multiview_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
912        &self,
913        f: F,
914    ) -> SignalHandlerId {
915        unsafe extern "C" fn notify_video_multiview_mode_trampoline<
916            F: Fn(&Play) + Send + Sync + 'static,
917        >(
918            this: *mut ffi::GstPlay,
919            _param_spec: glib::ffi::gpointer,
920            f: glib::ffi::gpointer,
921        ) {
922            unsafe {
923                let f: &F = &*(f as *const F);
924                f(&from_glib_borrow(this))
925            }
926        }
927        unsafe {
928            let f: Box_<F> = Box_::new(f);
929            connect_raw(
930                self.as_ptr() as *mut _,
931                c"notify::video-multiview-mode".as_ptr(),
932                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
933                    notify_video_multiview_mode_trampoline::<F> as *const (),
934                )),
935                Box_::into_raw(f),
936            )
937        }
938    }
939
940    #[doc(alias = "video-renderer")]
941    pub fn connect_video_renderer_notify<F: Fn(&Self) + Send + Sync + 'static>(
942        &self,
943        f: F,
944    ) -> SignalHandlerId {
945        unsafe extern "C" fn notify_video_renderer_trampoline<
946            F: Fn(&Play) + Send + Sync + 'static,
947        >(
948            this: *mut ffi::GstPlay,
949            _param_spec: glib::ffi::gpointer,
950            f: glib::ffi::gpointer,
951        ) {
952            unsafe {
953                let f: &F = &*(f as *const F);
954                f(&from_glib_borrow(this))
955            }
956        }
957        unsafe {
958            let f: Box_<F> = Box_::new(f);
959            connect_raw(
960                self.as_ptr() as *mut _,
961                c"notify::video-renderer".as_ptr(),
962                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
963                    notify_video_renderer_trampoline::<F> as *const (),
964                )),
965                Box_::into_raw(f),
966            )
967        }
968    }
969
970    #[doc(alias = "volume")]
971    pub fn connect_volume_notify<F: Fn(&Self) + Send + Sync + 'static>(
972        &self,
973        f: F,
974    ) -> SignalHandlerId {
975        unsafe extern "C" fn notify_volume_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
976            this: *mut ffi::GstPlay,
977            _param_spec: glib::ffi::gpointer,
978            f: glib::ffi::gpointer,
979        ) {
980            unsafe {
981                let f: &F = &*(f as *const F);
982                f(&from_glib_borrow(this))
983            }
984        }
985        unsafe {
986            let f: Box_<F> = Box_::new(f);
987            connect_raw(
988                self.as_ptr() as *mut _,
989                c"notify::volume".as_ptr(),
990                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
991                    notify_volume_trampoline::<F> as *const (),
992                )),
993                Box_::into_raw(f),
994            )
995        }
996    }
997}
998
999unsafe impl Send for Play {}
1000unsafe impl Sync for Play {}