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    /// The goal of the GstPlay library is to ease the integration of multimedia
20    /// playback features in applications. Thus, if you need to build a media player
21    /// from the ground-up, GstPlay provides the features you will most likely need.
22    ///
23    /// An example player is available in gst-examples/playback/player/gst-play/.
24    ///
25    /// Internally the GstPlay makes use of the `playbin3` element. The legacy
26    /// `playbin2` can be selected if the `GST_PLAY_USE_PLAYBIN3=0` environment
27    /// variable has been set.
28    ///
29    /// **Important note**: If your application relies on the GstBus to get
30    /// notifications from GstPlay, you need to add some explicit clean-up code in
31    /// order to prevent the GstPlay object from leaking. See below for the details.
32    /// If you use the GstPlaySignalAdapter, no special clean-up is required.
33    ///
34    /// When the GstPlaySignalAdapter is not used, the GstBus owned by GstPlay should
35    /// be set to flushing state before any attempt to drop the last reference of the
36    /// GstPlay object. An example in C:
37    ///
38    /// **⚠️ The following code is in c ⚠️**
39    ///
40    /// ```c
41    /// ...
42    /// GstBus *bus = gst_play_get_message_bus (player);
43    /// gst_bus_set_flushing (bus, TRUE);
44    /// gst_object_unref (bus);
45    /// gst_object_unref (player);
46    /// ```
47    ///
48    /// The messages managed by the player contain a reference to itself, and if the
49    /// bus watch is just removed together with dropping the player then the bus will
50    /// simply keep them around forever (and the bus never goes away because the
51    /// player has a strong reference to it, so there's a reference cycle as long as
52    /// there are messages). Setting the bus to flushing state forces it to get rid
53    /// of its queued messages, thus breaking any possible reference cycle.
54    ///
55    /// ## Properties
56    ///
57    ///
58    /// #### `audio-video-offset`
59    ///  Readable | Writeable
60    ///
61    ///
62    /// #### `current-audio-track`
63    ///  Readable
64    ///
65    ///
66    /// #### `current-subtitle-track`
67    ///  Readable
68    ///
69    ///
70    /// #### `current-video-track`
71    ///  Readable
72    ///
73    ///
74    /// #### `duration`
75    ///  Readable
76    ///
77    ///
78    /// #### `media-info`
79    ///  Readable
80    ///
81    ///
82    /// #### `mute`
83    ///  Readable | Writeable
84    ///
85    ///
86    /// #### `pipeline`
87    ///  Readable
88    ///
89    ///
90    /// #### `position`
91    ///  Readable
92    ///
93    ///
94    /// #### `rate`
95    ///  Readable | Writeable
96    ///
97    ///
98    /// #### `subtitle-video-offset`
99    ///  Readable | Writeable
100    ///
101    ///
102    /// #### `suburi`
103    ///  Readable | Writeable
104    ///
105    ///
106    /// #### `uri`
107    ///  Readable | Writeable
108    ///
109    ///
110    /// #### `video-multiview-flags`
111    ///  Readable | Writeable
112    ///
113    ///
114    /// #### `video-multiview-mode`
115    ///  Readable | Writeable
116    ///
117    ///
118    /// #### `video-renderer`
119    ///  Readable | Writeable
120    ///
121    ///
122    /// #### `volume`
123    ///  Readable | Writeable
124    /// <details><summary><h4>Object</h4></summary>
125    ///
126    ///
127    /// #### `name`
128    ///  Readable | Writeable | Construct
129    ///
130    ///
131    /// #### `parent`
132    ///  The parent of the object. Please note, that when changing the 'parent'
133    /// property, we don't emit [`notify`][struct@crate::glib::Object#notify] and [`deep-notify`][struct@crate::gst::Object#deep-notify]
134    /// signals due to locking issues. In some cases one can use
135    /// `GstBin::element-added` or `GstBin::element-removed` signals on the parent to
136    /// achieve a similar effect.
137    ///
138    /// Readable | Writeable
139    /// </details>
140    ///
141    /// # Implements
142    ///
143    /// [`trait@gst::prelude::ObjectExt`], [`trait@glib::ObjectExt`]
144    #[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    /// Creates a new [`Play`][crate::Play] instance.
154    ///
155    /// Video is going to be rendered by `video_renderer`, or if [`None`] is provided
156    /// no special video set up will be done and some default handling will be
157    /// performed.
158    ///
159    /// This also initializes GStreamer via ``gst_init()`` on the first call if this
160    /// didn't happen before.
161    /// ## `video_renderer`
162    /// GstPlayVideoRenderer to use
163    ///
164    /// # Returns
165    ///
166    /// a new [`Play`][crate::Play] instance
167    #[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    /// Retrieve the current value of audio-video-offset property
178    ///
179    /// # Returns
180    ///
181    /// The current value of audio-video-offset in nanoseconds
182    #[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    /// Retrieve the current value of the indicated `type_`.
190    /// ## `type_`
191    /// [`PlayColorBalanceType`][crate::PlayColorBalanceType]
192    ///
193    /// # Returns
194    ///
195    /// The current value of `type_`, between [0,1]. In case of
196    ///  error -1 is returned.
197    #[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    /// A Function to get current audio [`PlayAudioInfo`][crate::PlayAudioInfo] instance.
204    ///
205    /// # Returns
206    ///
207    /// current audio track.
208    ///
209    /// The caller should free it with `g_object_unref()`
210    #[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    /// A Function to get current subtitle [`PlaySubtitleInfo`][crate::PlaySubtitleInfo] instance.
218    ///
219    /// # Returns
220    ///
221    /// current subtitle track.
222    ///
223    /// The caller should free it with `g_object_unref()`
224    #[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    /// A Function to get current video [`PlayVideoInfo`][crate::PlayVideoInfo] instance.
236    ///
237    /// # Returns
238    ///
239    /// current video track.
240    ///
241    /// The caller should free it with `g_object_unref()`
242    #[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    ///
250    /// # Returns
251    ///
252    /// Name of the currently enabled
253    ///  visualization.
254    ///  `g_free()` after usage.
255    #[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    /// Retrieves the duration of the media stream that self represents.
266    ///
267    /// # Returns
268    ///
269    /// the duration of the currently-playing media stream, in
270    /// nanoseconds.
271    #[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    /// A Function to get the current media info [`PlayMediaInfo`][crate::PlayMediaInfo] instance.
278    ///
279    /// # Returns
280    ///
281    /// media info instance.
282    ///
283    /// The caller should free it with `g_object_unref()`
284    #[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    /// GstPlay API exposes a [`gst::Bus`][crate::gst::Bus] instance which purpose is to provide data
292    /// structures representing play-internal events in form of [`gst::Message`][crate::gst::Message]<!-- -->s of
293    /// type GST_MESSAGE_APPLICATION.
294    ///
295    /// Each message carries a "play-message" field of type [`PlayMessage`][crate::PlayMessage].
296    /// Further fields of the message data are specific to each possible value of
297    /// that enumeration.
298    ///
299    /// Applications can consume the messages asynchronously within their own
300    /// event-loop / UI-thread etc. Note that in case the application does not
301    /// consume the messages, the bus will accumulate these internally and eventually
302    /// fill memory. To avoid that, the bus has to be set "flushing".
303    ///
304    /// # Returns
305    ///
306    /// The play message bus instance
307    #[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    /// Retrieve the current value of the indicated `type_`.
314    ///
315    /// # Returns
316    ///
317    /// The current value of `type_`, Default: 0x00000000 "none
318    #[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    /// Retrieve the current value of the indicated `type_`.
325    ///
326    /// # Returns
327    ///
328    /// The current value of `type_`, Default: -1 "none"
329    #[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    ///
336    /// # Returns
337    ///
338    /// [`true`] if the currently-playing stream is muted.
339    #[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    ///
347    /// # Returns
348    ///
349    /// The internal playbin instance.
350    ///
351    /// The caller should free it with `g_object_unref()`
352    #[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    ///
359    /// # Returns
360    ///
361    /// the absolute position time, in nanoseconds, of the
362    /// currently-playing stream.
363    #[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    ///
370    /// # Returns
371    ///
372    /// current playback rate
373    #[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    /// Current subtitle URI
380    ///
381    /// # Returns
382    ///
383    /// URI of the current external subtitle.
384    ///  `g_free()` after usage.
385    #[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    /// Retrieve the current value of subtitle-video-offset property
392    ///
393    /// # Returns
394    ///
395    /// The current value of subtitle-video-offset in nanoseconds
396    #[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    /// Gets the URI of the currently-playing stream.
404    ///
405    /// # Returns
406    ///
407    /// a string containing the URI of the
408    /// currently-playing stream. `g_free()` after usage.
409    #[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    /// Returns the current volume level, as a percentage between 0 and 1.
416    ///
417    /// # Returns
418    ///
419    /// the volume as percentage between 0 and 1.
420    #[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    /// Checks whether the `self` has color balance support available.
427    ///
428    /// # Returns
429    ///
430    /// [`true`] if `self` has color balance support. Otherwise,
431    ///  [`false`].
432    #[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    /// Pauses the current stream.
438    #[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    /// Request to play the loaded stream.
446    #[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    /// Seeks the currently-playing stream to the absolute `position` time
454    /// in nanoseconds.
455    /// ## `position`
456    /// position to seek in nanoseconds
457    #[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    ///
465    /// # Deprecated since 1.26
466    ///
467    /// Use [`set_audio_track_id()`][Self::set_audio_track_id()] instead.
468    /// ## `stream_index`
469    /// stream index
470    ///
471    /// # Returns
472    ///
473    /// [`true`] or [`false`]
474    ///
475    /// Sets the audio track `stream_index`.
476    #[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    /// Enable or disable the current audio track.
489    /// ## `enabled`
490    /// TRUE or FALSE
491    #[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    /// ## `stream_id`
499    /// stream id
500    ///
501    /// # Returns
502    ///
503    /// [`true`] or [`false`]
504    ///
505    /// Sets the audio track `stream_id`.
506    #[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    /// Sets audio-video-offset property by value of `offset`
522    /// ## `offset`
523    /// `gint64` in nanoseconds
524    #[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    /// Sets the current value of the indicated channel `type_` to the passed
533    /// value.
534    /// ## `type_`
535    /// [`PlayColorBalanceType`][crate::PlayColorBalanceType]
536    /// ## `value`
537    /// The new value for the `type_`, ranged [0,1]
538    #[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    /// Sets the current value of the indicated mode `type_` to the passed
546    /// value.
547    /// ## `flags`
548    /// The new value for the `type_`
549    #[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    /// Sets the current value of the indicated mode `type_` to the passed
557    /// value.
558    /// ## `mode`
559    /// The new value for the `type_`
560    #[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    /// [`true`] if the currently-playing stream should be muted.
568    /// ## `val`
569    /// Mute state the should be set
570    #[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    /// Playback at specified rate
579    /// ## `rate`
580    /// playback rate
581    #[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    ///
590    /// # Deprecated since 1.26
591    ///
592    /// Use [`set_subtitle_track_id()`][Self::set_subtitle_track_id()] instead.
593    /// ## `stream_index`
594    /// stream index
595    ///
596    /// # Returns
597    ///
598    /// [`true`] or [`false`]
599    ///
600    /// Sets the subtitle stack `stream_index`.
601    #[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    /// Enable or disable the current subtitle track.
614    /// ## `enabled`
615    /// TRUE or FALSE
616    #[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    /// ## `stream_id`
624    /// stream id
625    ///
626    /// # Returns
627    ///
628    /// [`true`] or [`false`]
629    ///
630    /// Sets the subtitle track `stream_id`.
631    #[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    /// Sets the external subtitle URI. This should be combined with a call to
650    /// gst_play_set_subtitle_track_enabled(`self`, TRUE) so the subtitles are actually
651    /// rendered.
652    /// ## `uri`
653    /// subtitle URI
654    #[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    /// Sets subtitle-video-offset property by value of `offset`
662    /// ## `offset`
663    /// `gint64` in nanoseconds
664    #[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    /// ## `audio_stream_id`
673    /// audio stream id
674    /// ## `video_stream_id`
675    /// video stream id
676    /// ## `subtitle_stream_id`
677    /// subtitle stream id
678    ///
679    /// # Returns
680    ///
681    /// [`true`] or [`false`]
682    ///
683    /// Sets the selected track stream ids. Setting [`None`] as stream id disables the
684    /// corresponding track.
685    #[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    /// Sets the next URI to play.
708    /// ## `uri`
709    /// next URI to play.
710    #[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    ///
719    /// # Deprecated since 1.26
720    ///
721    /// Use [`set_video_track_id()`][Self::set_video_track_id()] instead.
722    /// ## `stream_index`
723    /// stream index
724    ///
725    /// # Returns
726    ///
727    /// [`true`] or [`false`]
728    ///
729    /// Sets the video track `stream_index`.
730    #[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    /// Enable or disable the current video track.
743    /// ## `enabled`
744    /// TRUE or FALSE
745    #[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    /// ## `stream_id`
753    /// stream id
754    ///
755    /// # Returns
756    ///
757    /// [`true`] or [`false`]
758    ///
759    /// Sets the video track `stream_id`.
760    #[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    /// ## `name`
776    /// visualization element obtained from
777    /// [`visualizations_get()`][Self::visualizations_get()]
778    ///
779    /// # Returns
780    ///
781    /// [`true`] if the visualization was set correctly. Otherwise,
782    /// [`false`].
783    #[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    /// Enable or disable the visualization.
794    /// ## `enabled`
795    /// TRUE or FALSE
796    #[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    /// Sets the volume level of the stream as a percentage between 0 and 1.
804    /// ## `val`
805    /// the new volume level, as a percentage between 0 and 1
806    #[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    /// Stops playing the current stream and resets to the first position
815    /// in the stream.
816    #[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    /// ## `info`
865    /// a [`PlayMediaInfo`][crate::PlayMediaInfo]
866    ///
867    /// # Returns
868    ///
869    /// A `GList` of
870    /// matching [`PlayAudioInfo`][crate::PlayAudioInfo].
871    #[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    /// ## `info`
883    /// a [`PlayMediaInfo`][crate::PlayMediaInfo]
884    ///
885    /// # Returns
886    ///
887    /// A `GList` of
888    /// matching [`PlaySubtitleInfo`][crate::PlaySubtitleInfo].
889    #[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    /// ## `info`
901    /// a [`PlayMediaInfo`][crate::PlayMediaInfo]
902    ///
903    /// # Returns
904    ///
905    /// A `GList` of
906    /// matching [`PlayVideoInfo`][crate::PlayVideoInfo].
907    #[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    /// ## `msg`
919    /// A [`gst::Message`][crate::gst::Message]
920    ///
921    /// # Returns
922    ///
923    /// A `gboolean` indicating whether the passed message represents a [`Play`][crate::Play] message or not.
924    #[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    ///
931    /// # Returns
932    ///
933    ///
934    ///  a [`None`] terminated array containing all available
935    ///  visualizations. Use `gst_play_visualizations_free()` after
936    ///  usage.
937    #[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            unsafe {
956                let f: &F = &*(f as *const F);
957                f(&from_glib_borrow(this))
958            }
959        }
960        unsafe {
961            let f: Box_<F> = Box_::new(f);
962            connect_raw(
963                self.as_ptr() as *mut _,
964                c"notify::audio-video-offset".as_ptr(),
965                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
966                    notify_audio_video_offset_trampoline::<F> as *const (),
967                )),
968                Box_::into_raw(f),
969            )
970        }
971    }
972
973    #[doc(alias = "current-audio-track")]
974    pub fn connect_current_audio_track_notify<F: Fn(&Self) + Send + Sync + 'static>(
975        &self,
976        f: F,
977    ) -> SignalHandlerId {
978        unsafe extern "C" fn notify_current_audio_track_trampoline<
979            F: Fn(&Play) + Send + Sync + 'static,
980        >(
981            this: *mut ffi::GstPlay,
982            _param_spec: glib::ffi::gpointer,
983            f: glib::ffi::gpointer,
984        ) {
985            unsafe {
986                let f: &F = &*(f as *const F);
987                f(&from_glib_borrow(this))
988            }
989        }
990        unsafe {
991            let f: Box_<F> = Box_::new(f);
992            connect_raw(
993                self.as_ptr() as *mut _,
994                c"notify::current-audio-track".as_ptr(),
995                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
996                    notify_current_audio_track_trampoline::<F> as *const (),
997                )),
998                Box_::into_raw(f),
999            )
1000        }
1001    }
1002
1003    #[doc(alias = "current-subtitle-track")]
1004    pub fn connect_current_subtitle_track_notify<F: Fn(&Self) + Send + Sync + 'static>(
1005        &self,
1006        f: F,
1007    ) -> SignalHandlerId {
1008        unsafe extern "C" fn notify_current_subtitle_track_trampoline<
1009            F: Fn(&Play) + Send + Sync + 'static,
1010        >(
1011            this: *mut ffi::GstPlay,
1012            _param_spec: glib::ffi::gpointer,
1013            f: glib::ffi::gpointer,
1014        ) {
1015            unsafe {
1016                let f: &F = &*(f as *const F);
1017                f(&from_glib_borrow(this))
1018            }
1019        }
1020        unsafe {
1021            let f: Box_<F> = Box_::new(f);
1022            connect_raw(
1023                self.as_ptr() as *mut _,
1024                c"notify::current-subtitle-track".as_ptr(),
1025                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1026                    notify_current_subtitle_track_trampoline::<F> as *const (),
1027                )),
1028                Box_::into_raw(f),
1029            )
1030        }
1031    }
1032
1033    #[doc(alias = "current-video-track")]
1034    pub fn connect_current_video_track_notify<F: Fn(&Self) + Send + Sync + 'static>(
1035        &self,
1036        f: F,
1037    ) -> SignalHandlerId {
1038        unsafe extern "C" fn notify_current_video_track_trampoline<
1039            F: Fn(&Play) + Send + Sync + 'static,
1040        >(
1041            this: *mut ffi::GstPlay,
1042            _param_spec: glib::ffi::gpointer,
1043            f: glib::ffi::gpointer,
1044        ) {
1045            unsafe {
1046                let f: &F = &*(f as *const F);
1047                f(&from_glib_borrow(this))
1048            }
1049        }
1050        unsafe {
1051            let f: Box_<F> = Box_::new(f);
1052            connect_raw(
1053                self.as_ptr() as *mut _,
1054                c"notify::current-video-track".as_ptr(),
1055                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1056                    notify_current_video_track_trampoline::<F> as *const (),
1057                )),
1058                Box_::into_raw(f),
1059            )
1060        }
1061    }
1062
1063    #[doc(alias = "duration")]
1064    pub fn connect_duration_notify<F: Fn(&Self) + Send + Sync + 'static>(
1065        &self,
1066        f: F,
1067    ) -> SignalHandlerId {
1068        unsafe extern "C" fn notify_duration_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1069            this: *mut ffi::GstPlay,
1070            _param_spec: glib::ffi::gpointer,
1071            f: glib::ffi::gpointer,
1072        ) {
1073            unsafe {
1074                let f: &F = &*(f as *const F);
1075                f(&from_glib_borrow(this))
1076            }
1077        }
1078        unsafe {
1079            let f: Box_<F> = Box_::new(f);
1080            connect_raw(
1081                self.as_ptr() as *mut _,
1082                c"notify::duration".as_ptr(),
1083                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1084                    notify_duration_trampoline::<F> as *const (),
1085                )),
1086                Box_::into_raw(f),
1087            )
1088        }
1089    }
1090
1091    #[doc(alias = "media-info")]
1092    pub fn connect_media_info_notify<F: Fn(&Self) + Send + Sync + 'static>(
1093        &self,
1094        f: F,
1095    ) -> SignalHandlerId {
1096        unsafe extern "C" fn notify_media_info_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1097            this: *mut ffi::GstPlay,
1098            _param_spec: glib::ffi::gpointer,
1099            f: glib::ffi::gpointer,
1100        ) {
1101            unsafe {
1102                let f: &F = &*(f as *const F);
1103                f(&from_glib_borrow(this))
1104            }
1105        }
1106        unsafe {
1107            let f: Box_<F> = Box_::new(f);
1108            connect_raw(
1109                self.as_ptr() as *mut _,
1110                c"notify::media-info".as_ptr(),
1111                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1112                    notify_media_info_trampoline::<F> as *const (),
1113                )),
1114                Box_::into_raw(f),
1115            )
1116        }
1117    }
1118
1119    #[doc(alias = "mute")]
1120    pub fn connect_mute_notify<F: Fn(&Self) + Send + Sync + 'static>(
1121        &self,
1122        f: F,
1123    ) -> SignalHandlerId {
1124        unsafe extern "C" fn notify_mute_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1125            this: *mut ffi::GstPlay,
1126            _param_spec: glib::ffi::gpointer,
1127            f: glib::ffi::gpointer,
1128        ) {
1129            unsafe {
1130                let f: &F = &*(f as *const F);
1131                f(&from_glib_borrow(this))
1132            }
1133        }
1134        unsafe {
1135            let f: Box_<F> = Box_::new(f);
1136            connect_raw(
1137                self.as_ptr() as *mut _,
1138                c"notify::mute".as_ptr(),
1139                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1140                    notify_mute_trampoline::<F> as *const (),
1141                )),
1142                Box_::into_raw(f),
1143            )
1144        }
1145    }
1146
1147    #[doc(alias = "pipeline")]
1148    pub fn connect_pipeline_notify<F: Fn(&Self) + Send + Sync + 'static>(
1149        &self,
1150        f: F,
1151    ) -> SignalHandlerId {
1152        unsafe extern "C" fn notify_pipeline_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1153            this: *mut ffi::GstPlay,
1154            _param_spec: glib::ffi::gpointer,
1155            f: glib::ffi::gpointer,
1156        ) {
1157            unsafe {
1158                let f: &F = &*(f as *const F);
1159                f(&from_glib_borrow(this))
1160            }
1161        }
1162        unsafe {
1163            let f: Box_<F> = Box_::new(f);
1164            connect_raw(
1165                self.as_ptr() as *mut _,
1166                c"notify::pipeline".as_ptr(),
1167                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1168                    notify_pipeline_trampoline::<F> as *const (),
1169                )),
1170                Box_::into_raw(f),
1171            )
1172        }
1173    }
1174
1175    #[doc(alias = "position")]
1176    pub fn connect_position_notify<F: Fn(&Self) + Send + Sync + 'static>(
1177        &self,
1178        f: F,
1179    ) -> SignalHandlerId {
1180        unsafe extern "C" fn notify_position_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1181            this: *mut ffi::GstPlay,
1182            _param_spec: glib::ffi::gpointer,
1183            f: glib::ffi::gpointer,
1184        ) {
1185            unsafe {
1186                let f: &F = &*(f as *const F);
1187                f(&from_glib_borrow(this))
1188            }
1189        }
1190        unsafe {
1191            let f: Box_<F> = Box_::new(f);
1192            connect_raw(
1193                self.as_ptr() as *mut _,
1194                c"notify::position".as_ptr(),
1195                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1196                    notify_position_trampoline::<F> as *const (),
1197                )),
1198                Box_::into_raw(f),
1199            )
1200        }
1201    }
1202
1203    #[doc(alias = "rate")]
1204    pub fn connect_rate_notify<F: Fn(&Self) + Send + Sync + 'static>(
1205        &self,
1206        f: F,
1207    ) -> SignalHandlerId {
1208        unsafe extern "C" fn notify_rate_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1209            this: *mut ffi::GstPlay,
1210            _param_spec: glib::ffi::gpointer,
1211            f: glib::ffi::gpointer,
1212        ) {
1213            unsafe {
1214                let f: &F = &*(f as *const F);
1215                f(&from_glib_borrow(this))
1216            }
1217        }
1218        unsafe {
1219            let f: Box_<F> = Box_::new(f);
1220            connect_raw(
1221                self.as_ptr() as *mut _,
1222                c"notify::rate".as_ptr(),
1223                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1224                    notify_rate_trampoline::<F> as *const (),
1225                )),
1226                Box_::into_raw(f),
1227            )
1228        }
1229    }
1230
1231    #[doc(alias = "subtitle-video-offset")]
1232    pub fn connect_subtitle_video_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
1233        &self,
1234        f: F,
1235    ) -> SignalHandlerId {
1236        unsafe extern "C" fn notify_subtitle_video_offset_trampoline<
1237            F: Fn(&Play) + Send + Sync + 'static,
1238        >(
1239            this: *mut ffi::GstPlay,
1240            _param_spec: glib::ffi::gpointer,
1241            f: glib::ffi::gpointer,
1242        ) {
1243            unsafe {
1244                let f: &F = &*(f as *const F);
1245                f(&from_glib_borrow(this))
1246            }
1247        }
1248        unsafe {
1249            let f: Box_<F> = Box_::new(f);
1250            connect_raw(
1251                self.as_ptr() as *mut _,
1252                c"notify::subtitle-video-offset".as_ptr(),
1253                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1254                    notify_subtitle_video_offset_trampoline::<F> as *const (),
1255                )),
1256                Box_::into_raw(f),
1257            )
1258        }
1259    }
1260
1261    #[doc(alias = "suburi")]
1262    pub fn connect_suburi_notify<F: Fn(&Self) + Send + Sync + 'static>(
1263        &self,
1264        f: F,
1265    ) -> SignalHandlerId {
1266        unsafe extern "C" fn notify_suburi_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1267            this: *mut ffi::GstPlay,
1268            _param_spec: glib::ffi::gpointer,
1269            f: glib::ffi::gpointer,
1270        ) {
1271            unsafe {
1272                let f: &F = &*(f as *const F);
1273                f(&from_glib_borrow(this))
1274            }
1275        }
1276        unsafe {
1277            let f: Box_<F> = Box_::new(f);
1278            connect_raw(
1279                self.as_ptr() as *mut _,
1280                c"notify::suburi".as_ptr(),
1281                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1282                    notify_suburi_trampoline::<F> as *const (),
1283                )),
1284                Box_::into_raw(f),
1285            )
1286        }
1287    }
1288
1289    #[doc(alias = "uri")]
1290    pub fn connect_uri_notify<F: Fn(&Self) + Send + Sync + 'static>(
1291        &self,
1292        f: F,
1293    ) -> SignalHandlerId {
1294        unsafe extern "C" fn notify_uri_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1295            this: *mut ffi::GstPlay,
1296            _param_spec: glib::ffi::gpointer,
1297            f: glib::ffi::gpointer,
1298        ) {
1299            unsafe {
1300                let f: &F = &*(f as *const F);
1301                f(&from_glib_borrow(this))
1302            }
1303        }
1304        unsafe {
1305            let f: Box_<F> = Box_::new(f);
1306            connect_raw(
1307                self.as_ptr() as *mut _,
1308                c"notify::uri".as_ptr(),
1309                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1310                    notify_uri_trampoline::<F> as *const (),
1311                )),
1312                Box_::into_raw(f),
1313            )
1314        }
1315    }
1316
1317    #[doc(alias = "video-multiview-flags")]
1318    pub fn connect_video_multiview_flags_notify<F: Fn(&Self) + Send + Sync + 'static>(
1319        &self,
1320        f: F,
1321    ) -> SignalHandlerId {
1322        unsafe extern "C" fn notify_video_multiview_flags_trampoline<
1323            F: Fn(&Play) + Send + Sync + 'static,
1324        >(
1325            this: *mut ffi::GstPlay,
1326            _param_spec: glib::ffi::gpointer,
1327            f: glib::ffi::gpointer,
1328        ) {
1329            unsafe {
1330                let f: &F = &*(f as *const F);
1331                f(&from_glib_borrow(this))
1332            }
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-flags".as_ptr(),
1339                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1340                    notify_video_multiview_flags_trampoline::<F> as *const (),
1341                )),
1342                Box_::into_raw(f),
1343            )
1344        }
1345    }
1346
1347    #[doc(alias = "video-multiview-mode")]
1348    pub fn connect_video_multiview_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
1349        &self,
1350        f: F,
1351    ) -> SignalHandlerId {
1352        unsafe extern "C" fn notify_video_multiview_mode_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            unsafe {
1360                let f: &F = &*(f as *const F);
1361                f(&from_glib_borrow(this))
1362            }
1363        }
1364        unsafe {
1365            let f: Box_<F> = Box_::new(f);
1366            connect_raw(
1367                self.as_ptr() as *mut _,
1368                c"notify::video-multiview-mode".as_ptr(),
1369                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1370                    notify_video_multiview_mode_trampoline::<F> as *const (),
1371                )),
1372                Box_::into_raw(f),
1373            )
1374        }
1375    }
1376
1377    #[doc(alias = "video-renderer")]
1378    pub fn connect_video_renderer_notify<F: Fn(&Self) + Send + Sync + 'static>(
1379        &self,
1380        f: F,
1381    ) -> SignalHandlerId {
1382        unsafe extern "C" fn notify_video_renderer_trampoline<
1383            F: Fn(&Play) + Send + Sync + 'static,
1384        >(
1385            this: *mut ffi::GstPlay,
1386            _param_spec: glib::ffi::gpointer,
1387            f: glib::ffi::gpointer,
1388        ) {
1389            unsafe {
1390                let f: &F = &*(f as *const F);
1391                f(&from_glib_borrow(this))
1392            }
1393        }
1394        unsafe {
1395            let f: Box_<F> = Box_::new(f);
1396            connect_raw(
1397                self.as_ptr() as *mut _,
1398                c"notify::video-renderer".as_ptr(),
1399                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1400                    notify_video_renderer_trampoline::<F> as *const (),
1401                )),
1402                Box_::into_raw(f),
1403            )
1404        }
1405    }
1406
1407    #[doc(alias = "volume")]
1408    pub fn connect_volume_notify<F: Fn(&Self) + Send + Sync + 'static>(
1409        &self,
1410        f: F,
1411    ) -> SignalHandlerId {
1412        unsafe extern "C" fn notify_volume_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1413            this: *mut ffi::GstPlay,
1414            _param_spec: glib::ffi::gpointer,
1415            f: glib::ffi::gpointer,
1416        ) {
1417            unsafe {
1418                let f: &F = &*(f as *const F);
1419                f(&from_glib_borrow(this))
1420            }
1421        }
1422        unsafe {
1423            let f: Box_<F> = Box_::new(f);
1424            connect_raw(
1425                self.as_ptr() as *mut _,
1426                c"notify::volume".as_ptr(),
1427                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1428                    notify_volume_trampoline::<F> as *const (),
1429                )),
1430                Box_::into_raw(f),
1431            )
1432        }
1433    }
1434}
1435
1436unsafe impl Send for Play {}
1437unsafe impl Sync for Play {}