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    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    /// 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            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 {}