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 | Writable
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 | Writable
84    ///
85    ///
86    /// #### `pipeline`
87    ///  Readable
88    ///
89    ///
90    /// #### `position`
91    ///  Readable
92    ///
93    ///
94    /// #### `rate`
95    ///  Readable | Writable
96    ///
97    ///
98    /// #### `subtitle-video-offset`
99    ///  Readable | Writable
100    ///
101    ///
102    /// #### `suburi`
103    ///  Readable | Writable
104    ///
105    ///
106    /// #### `uri`
107    ///  Readable | Writable
108    ///
109    ///
110    /// #### `video-multiview-flags`
111    ///  Readable | Writable
112    ///
113    ///
114    /// #### `video-multiview-mode`
115    ///  Readable | Writable
116    ///
117    ///
118    /// #### `video-renderer`
119    ///  Readable | Writable
120    ///
121    ///
122    /// #### `volume`
123    ///  Readable | Writable
124    /// <details><summary><h4>Object</h4></summary>
125    ///
126    ///
127    /// #### `name`
128    ///  Readable | Writable | 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 | Writable
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    /// s of
292    /// type GST_MESSAGE_APPLICATION.
293    ///
294    /// Each message carries a "play-message" field of type [`PlayMessage`][crate::PlayMessage].
295    /// Further fields of the message data are specific to each possible value of
296    /// that enumeration.
297    ///
298    /// Applications can consume the messages asynchronously within their own
299    /// event-loop / UI-thread etc. Note that in case the application does not
300    /// consume the messages, the bus will accumulate these internally and eventually
301    /// fill memory. To avoid that, the bus has to be set "flushing".
302    ///
303    /// # Returns
304    ///
305    /// The play message bus instance
306    #[doc(alias = "gst_play_get_message_bus")]
307    #[doc(alias = "get_message_bus")]
308    pub fn message_bus(&self) -> gst::Bus {
309        unsafe { from_glib_full(ffi::gst_play_get_message_bus(self.to_glib_none().0)) }
310    }
311
312    /// Retrieve the current value of the indicated `type_`.
313    ///
314    /// # Returns
315    ///
316    /// The current value of `type_`, Default: 0x00000000 "none
317    #[doc(alias = "gst_play_get_multiview_flags")]
318    #[doc(alias = "get_multiview_flags")]
319    pub fn multiview_flags(&self) -> gst_video::VideoMultiviewFlags {
320        unsafe { from_glib(ffi::gst_play_get_multiview_flags(self.to_glib_none().0)) }
321    }
322
323    /// Retrieve the current value of the indicated `type_`.
324    ///
325    /// # Returns
326    ///
327    /// The current value of `type_`, Default: -1 "none"
328    #[doc(alias = "gst_play_get_multiview_mode")]
329    #[doc(alias = "get_multiview_mode")]
330    pub fn multiview_mode(&self) -> gst_video::VideoMultiviewFramePacking {
331        unsafe { from_glib(ffi::gst_play_get_multiview_mode(self.to_glib_none().0)) }
332    }
333
334    ///
335    /// # Returns
336    ///
337    /// [`true`] if the currently-playing stream is muted.
338    #[doc(alias = "gst_play_get_mute")]
339    #[doc(alias = "get_mute")]
340    #[doc(alias = "mute")]
341    pub fn is_muted(&self) -> bool {
342        unsafe { from_glib(ffi::gst_play_get_mute(self.to_glib_none().0)) }
343    }
344
345    ///
346    /// # Returns
347    ///
348    /// The internal playbin instance.
349    ///
350    /// The caller should free it with `g_object_unref()`
351    #[doc(alias = "gst_play_get_pipeline")]
352    #[doc(alias = "get_pipeline")]
353    pub fn pipeline(&self) -> gst::Element {
354        unsafe { from_glib_full(ffi::gst_play_get_pipeline(self.to_glib_none().0)) }
355    }
356
357    ///
358    /// # Returns
359    ///
360    /// the absolute position time, in nanoseconds, of the
361    /// currently-playing stream.
362    #[doc(alias = "gst_play_get_position")]
363    #[doc(alias = "get_position")]
364    pub fn position(&self) -> Option<gst::ClockTime> {
365        unsafe { from_glib(ffi::gst_play_get_position(self.to_glib_none().0)) }
366    }
367
368    ///
369    /// # Returns
370    ///
371    /// current playback rate
372    #[doc(alias = "gst_play_get_rate")]
373    #[doc(alias = "get_rate")]
374    pub fn rate(&self) -> f64 {
375        unsafe { ffi::gst_play_get_rate(self.to_glib_none().0) }
376    }
377
378    /// Current subtitle URI
379    ///
380    /// # Returns
381    ///
382    /// URI of the current external subtitle.
383    ///  `g_free()` after usage.
384    #[doc(alias = "gst_play_get_subtitle_uri")]
385    #[doc(alias = "get_subtitle_uri")]
386    pub fn subtitle_uri(&self) -> Option<glib::GString> {
387        unsafe { from_glib_full(ffi::gst_play_get_subtitle_uri(self.to_glib_none().0)) }
388    }
389
390    /// Retrieve the current value of subtitle-video-offset property
391    ///
392    /// # Returns
393    ///
394    /// The current value of subtitle-video-offset in nanoseconds
395    #[doc(alias = "gst_play_get_subtitle_video_offset")]
396    #[doc(alias = "get_subtitle_video_offset")]
397    #[doc(alias = "subtitle-video-offset")]
398    pub fn subtitle_video_offset(&self) -> i64 {
399        unsafe { ffi::gst_play_get_subtitle_video_offset(self.to_glib_none().0) }
400    }
401
402    /// Gets the URI of the currently-playing stream.
403    ///
404    /// # Returns
405    ///
406    /// a string containing the URI of the
407    /// currently-playing stream. `g_free()` after usage.
408    #[doc(alias = "gst_play_get_uri")]
409    #[doc(alias = "get_uri")]
410    pub fn uri(&self) -> Option<glib::GString> {
411        unsafe { from_glib_full(ffi::gst_play_get_uri(self.to_glib_none().0)) }
412    }
413
414    /// Returns the current volume level, as a percentage between 0 and 1.
415    ///
416    /// # Returns
417    ///
418    /// the volume as percentage between 0 and 1.
419    #[doc(alias = "gst_play_get_volume")]
420    #[doc(alias = "get_volume")]
421    pub fn volume(&self) -> f64 {
422        unsafe { ffi::gst_play_get_volume(self.to_glib_none().0) }
423    }
424
425    /// Checks whether the `self` has color balance support available.
426    ///
427    /// # Returns
428    ///
429    /// [`true`] if `self` has color balance support. Otherwise,
430    ///  [`false`].
431    #[doc(alias = "gst_play_has_color_balance")]
432    pub fn has_color_balance(&self) -> bool {
433        unsafe { from_glib(ffi::gst_play_has_color_balance(self.to_glib_none().0)) }
434    }
435
436    /// Pauses the current stream.
437    #[doc(alias = "gst_play_pause")]
438    pub fn pause(&self) {
439        unsafe {
440            ffi::gst_play_pause(self.to_glib_none().0);
441        }
442    }
443
444    /// Request to play the loaded stream.
445    #[doc(alias = "gst_play_play")]
446    pub fn play(&self) {
447        unsafe {
448            ffi::gst_play_play(self.to_glib_none().0);
449        }
450    }
451
452    /// Seeks the currently-playing stream to the absolute `position` time
453    /// in nanoseconds.
454    /// ## `position`
455    /// position to seek in nanoseconds
456    #[doc(alias = "gst_play_seek")]
457    pub fn seek(&self, position: gst::ClockTime) {
458        unsafe {
459            ffi::gst_play_seek(self.to_glib_none().0, position.into_glib());
460        }
461    }
462
463    ///
464    /// # Deprecated since 1.26
465    ///
466    /// Use [`set_audio_track_id()`][Self::set_audio_track_id()] instead.
467    /// ## `stream_index`
468    /// stream index
469    ///
470    /// # Returns
471    ///
472    /// [`true`] or [`false`]
473    ///
474    /// Sets the audio track `stream_index`.
475    #[cfg_attr(feature = "v1_26", deprecated = "Since 1.26")]
476    #[allow(deprecated)]
477    #[doc(alias = "gst_play_set_audio_track")]
478    pub fn set_audio_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> {
479        unsafe {
480            glib::result_from_gboolean!(
481                ffi::gst_play_set_audio_track(self.to_glib_none().0, stream_index),
482                "Failed to set audio track"
483            )
484        }
485    }
486
487    /// Enable or disable the current audio track.
488    /// ## `enabled`
489    /// TRUE or FALSE
490    #[doc(alias = "gst_play_set_audio_track_enabled")]
491    pub fn set_audio_track_enabled(&self, enabled: bool) {
492        unsafe {
493            ffi::gst_play_set_audio_track_enabled(self.to_glib_none().0, enabled.into_glib());
494        }
495    }
496
497    /// ## `stream_id`
498    /// stream id
499    ///
500    /// # Returns
501    ///
502    /// [`true`] or [`false`]
503    ///
504    /// Sets the audio track `stream_id`.
505    #[cfg(feature = "v1_26")]
506    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
507    #[doc(alias = "gst_play_set_audio_track_id")]
508    pub fn set_audio_track_id(
509        &self,
510        stream_id: Option<&str>,
511    ) -> Result<(), glib::error::BoolError> {
512        unsafe {
513            glib::result_from_gboolean!(
514                ffi::gst_play_set_audio_track_id(self.to_glib_none().0, stream_id.to_glib_none().0),
515                "Failed to set audio track"
516            )
517        }
518    }
519
520    /// Sets audio-video-offset property by value of `offset`
521    /// ## `offset`
522    /// `gint64` in nanoseconds
523    #[doc(alias = "gst_play_set_audio_video_offset")]
524    #[doc(alias = "audio-video-offset")]
525    pub fn set_audio_video_offset(&self, offset: i64) {
526        unsafe {
527            ffi::gst_play_set_audio_video_offset(self.to_glib_none().0, offset);
528        }
529    }
530
531    /// Sets the current value of the indicated channel `type_` to the passed
532    /// value.
533    /// ## `type_`
534    /// [`PlayColorBalanceType`][crate::PlayColorBalanceType]
535    /// ## `value`
536    /// The new value for the `type_`, ranged [0,1]
537    #[doc(alias = "gst_play_set_color_balance")]
538    pub fn set_color_balance(&self, type_: PlayColorBalanceType, value: f64) {
539        unsafe {
540            ffi::gst_play_set_color_balance(self.to_glib_none().0, type_.into_glib(), value);
541        }
542    }
543
544    /// Sets the current value of the indicated mode `type_` to the passed
545    /// value.
546    /// ## `flags`
547    /// The new value for the `type_`
548    #[doc(alias = "gst_play_set_multiview_flags")]
549    pub fn set_multiview_flags(&self, flags: gst_video::VideoMultiviewFlags) {
550        unsafe {
551            ffi::gst_play_set_multiview_flags(self.to_glib_none().0, flags.into_glib());
552        }
553    }
554
555    /// Sets the current value of the indicated mode `type_` to the passed
556    /// value.
557    /// ## `mode`
558    /// The new value for the `type_`
559    #[doc(alias = "gst_play_set_multiview_mode")]
560    pub fn set_multiview_mode(&self, mode: gst_video::VideoMultiviewFramePacking) {
561        unsafe {
562            ffi::gst_play_set_multiview_mode(self.to_glib_none().0, mode.into_glib());
563        }
564    }
565
566    /// [`true`] if the currently-playing stream should be muted.
567    /// ## `val`
568    /// Mute state the should be set
569    #[doc(alias = "gst_play_set_mute")]
570    #[doc(alias = "mute")]
571    pub fn set_mute(&self, val: bool) {
572        unsafe {
573            ffi::gst_play_set_mute(self.to_glib_none().0, val.into_glib());
574        }
575    }
576
577    /// Playback at specified rate
578    /// ## `rate`
579    /// playback rate
580    #[doc(alias = "gst_play_set_rate")]
581    #[doc(alias = "rate")]
582    pub fn set_rate(&self, rate: f64) {
583        unsafe {
584            ffi::gst_play_set_rate(self.to_glib_none().0, rate);
585        }
586    }
587
588    ///
589    /// # Deprecated since 1.26
590    ///
591    /// Use [`set_subtitle_track_id()`][Self::set_subtitle_track_id()] instead.
592    /// ## `stream_index`
593    /// stream index
594    ///
595    /// # Returns
596    ///
597    /// [`true`] or [`false`]
598    ///
599    /// Sets the subtitle stack `stream_index`.
600    #[cfg_attr(feature = "v1_26", deprecated = "Since 1.26")]
601    #[allow(deprecated)]
602    #[doc(alias = "gst_play_set_subtitle_track")]
603    pub fn set_subtitle_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> {
604        unsafe {
605            glib::result_from_gboolean!(
606                ffi::gst_play_set_subtitle_track(self.to_glib_none().0, stream_index),
607                "Failed to set subtitle track"
608            )
609        }
610    }
611
612    /// Enable or disable the current subtitle track.
613    /// ## `enabled`
614    /// TRUE or FALSE
615    #[doc(alias = "gst_play_set_subtitle_track_enabled")]
616    pub fn set_subtitle_track_enabled(&self, enabled: bool) {
617        unsafe {
618            ffi::gst_play_set_subtitle_track_enabled(self.to_glib_none().0, enabled.into_glib());
619        }
620    }
621
622    /// ## `stream_id`
623    /// stream id
624    ///
625    /// # Returns
626    ///
627    /// [`true`] or [`false`]
628    ///
629    /// Sets the subtitle track `stream_id`.
630    #[cfg(feature = "v1_26")]
631    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
632    #[doc(alias = "gst_play_set_subtitle_track_id")]
633    pub fn set_subtitle_track_id(
634        &self,
635        stream_id: Option<&str>,
636    ) -> Result<(), glib::error::BoolError> {
637        unsafe {
638            glib::result_from_gboolean!(
639                ffi::gst_play_set_subtitle_track_id(
640                    self.to_glib_none().0,
641                    stream_id.to_glib_none().0
642                ),
643                "Failed to set subtitle track"
644            )
645        }
646    }
647
648    /// Sets the external subtitle URI. This should be combined with a call to
649    /// gst_play_set_subtitle_track_enabled(`self`, TRUE) so the subtitles are actually
650    /// rendered.
651    /// ## `uri`
652    /// subtitle URI
653    #[doc(alias = "gst_play_set_subtitle_uri")]
654    pub fn set_subtitle_uri(&self, uri: Option<&str>) {
655        unsafe {
656            ffi::gst_play_set_subtitle_uri(self.to_glib_none().0, uri.to_glib_none().0);
657        }
658    }
659
660    /// Sets subtitle-video-offset property by value of `offset`
661    /// ## `offset`
662    /// `gint64` in nanoseconds
663    #[doc(alias = "gst_play_set_subtitle_video_offset")]
664    #[doc(alias = "subtitle-video-offset")]
665    pub fn set_subtitle_video_offset(&self, offset: i64) {
666        unsafe {
667            ffi::gst_play_set_subtitle_video_offset(self.to_glib_none().0, offset);
668        }
669    }
670
671    /// ## `audio_stream_id`
672    /// audio stream id
673    /// ## `video_stream_id`
674    /// video stream id
675    /// ## `subtitle_stream_id`
676    /// subtitle stream id
677    ///
678    /// # Returns
679    ///
680    /// [`true`] or [`false`]
681    ///
682    /// Sets the selected track stream ids. Setting [`None`] as stream id disables the
683    /// corresponding track.
684    #[cfg(feature = "v1_26")]
685    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
686    #[doc(alias = "gst_play_set_track_ids")]
687    pub fn set_track_ids(
688        &self,
689        audio_stream_id: Option<&str>,
690        video_stream_id: Option<&str>,
691        subtitle_stream_id: Option<&str>,
692    ) -> Result<(), glib::error::BoolError> {
693        unsafe {
694            glib::result_from_gboolean!(
695                ffi::gst_play_set_track_ids(
696                    self.to_glib_none().0,
697                    audio_stream_id.to_glib_none().0,
698                    video_stream_id.to_glib_none().0,
699                    subtitle_stream_id.to_glib_none().0
700                ),
701                "Failed to set tracks"
702            )
703        }
704    }
705
706    /// Sets the next URI to play.
707    /// ## `uri`
708    /// next URI to play.
709    #[doc(alias = "gst_play_set_uri")]
710    #[doc(alias = "uri")]
711    pub fn set_uri(&self, uri: Option<&str>) {
712        unsafe {
713            ffi::gst_play_set_uri(self.to_glib_none().0, uri.to_glib_none().0);
714        }
715    }
716
717    ///
718    /// # Deprecated since 1.26
719    ///
720    /// Use [`set_video_track_id()`][Self::set_video_track_id()] instead.
721    /// ## `stream_index`
722    /// stream index
723    ///
724    /// # Returns
725    ///
726    /// [`true`] or [`false`]
727    ///
728    /// Sets the video track `stream_index`.
729    #[cfg_attr(feature = "v1_26", deprecated = "Since 1.26")]
730    #[allow(deprecated)]
731    #[doc(alias = "gst_play_set_video_track")]
732    pub fn set_video_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> {
733        unsafe {
734            glib::result_from_gboolean!(
735                ffi::gst_play_set_video_track(self.to_glib_none().0, stream_index),
736                "Failed to set video track"
737            )
738        }
739    }
740
741    /// Enable or disable the current video track.
742    /// ## `enabled`
743    /// TRUE or FALSE
744    #[doc(alias = "gst_play_set_video_track_enabled")]
745    pub fn set_video_track_enabled(&self, enabled: bool) {
746        unsafe {
747            ffi::gst_play_set_video_track_enabled(self.to_glib_none().0, enabled.into_glib());
748        }
749    }
750
751    /// ## `stream_id`
752    /// stream id
753    ///
754    /// # Returns
755    ///
756    /// [`true`] or [`false`]
757    ///
758    /// Sets the video track `stream_id`.
759    #[cfg(feature = "v1_26")]
760    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
761    #[doc(alias = "gst_play_set_video_track_id")]
762    pub fn set_video_track_id(
763        &self,
764        stream_id: Option<&str>,
765    ) -> Result<(), glib::error::BoolError> {
766        unsafe {
767            glib::result_from_gboolean!(
768                ffi::gst_play_set_video_track_id(self.to_glib_none().0, stream_id.to_glib_none().0),
769                "Failed to set video track"
770            )
771        }
772    }
773
774    /// ## `name`
775    /// visualization element obtained from
776    /// [`visualizations_get()`][Self::visualizations_get()]
777    ///
778    /// # Returns
779    ///
780    /// [`true`] if the visualization was set correctly. Otherwise,
781    /// [`false`].
782    #[doc(alias = "gst_play_set_visualization")]
783    pub fn set_visualization(&self, name: Option<&str>) -> Result<(), glib::error::BoolError> {
784        unsafe {
785            glib::result_from_gboolean!(
786                ffi::gst_play_set_visualization(self.to_glib_none().0, name.to_glib_none().0),
787                "Failed to set visualization"
788            )
789        }
790    }
791
792    /// Enable or disable the visualization.
793    /// ## `enabled`
794    /// TRUE or FALSE
795    #[doc(alias = "gst_play_set_visualization_enabled")]
796    pub fn set_visualization_enabled(&self, enabled: bool) {
797        unsafe {
798            ffi::gst_play_set_visualization_enabled(self.to_glib_none().0, enabled.into_glib());
799        }
800    }
801
802    /// Sets the volume level of the stream as a percentage between 0 and 1.
803    /// ## `val`
804    /// the new volume level, as a percentage between 0 and 1
805    #[doc(alias = "gst_play_set_volume")]
806    #[doc(alias = "volume")]
807    pub fn set_volume(&self, val: f64) {
808        unsafe {
809            ffi::gst_play_set_volume(self.to_glib_none().0, val);
810        }
811    }
812
813    /// Stops playing the current stream and resets to the first position
814    /// in the stream.
815    #[doc(alias = "gst_play_stop")]
816    pub fn stop(&self) {
817        unsafe {
818            ffi::gst_play_stop(self.to_glib_none().0);
819        }
820    }
821
822    pub fn suburi(&self) -> Option<glib::GString> {
823        ObjectExt::property(self, "suburi")
824    }
825
826    pub fn set_suburi(&self, suburi: Option<&str>) {
827        ObjectExt::set_property(self, "suburi", suburi)
828    }
829
830    #[doc(alias = "video-multiview-flags")]
831    pub fn video_multiview_flags(&self) -> gst_video::VideoMultiviewFlags {
832        ObjectExt::property(self, "video-multiview-flags")
833    }
834
835    #[doc(alias = "video-multiview-flags")]
836    pub fn set_video_multiview_flags(&self, video_multiview_flags: gst_video::VideoMultiviewFlags) {
837        ObjectExt::set_property(self, "video-multiview-flags", video_multiview_flags)
838    }
839
840    #[doc(alias = "video-multiview-mode")]
841    pub fn video_multiview_mode(&self) -> gst_video::VideoMultiviewFramePacking {
842        ObjectExt::property(self, "video-multiview-mode")
843    }
844
845    #[doc(alias = "video-multiview-mode")]
846    pub fn set_video_multiview_mode(
847        &self,
848        video_multiview_mode: gst_video::VideoMultiviewFramePacking,
849    ) {
850        ObjectExt::set_property(self, "video-multiview-mode", video_multiview_mode)
851    }
852
853    #[doc(alias = "video-renderer")]
854    pub fn video_renderer(&self) -> Option<PlayVideoRenderer> {
855        ObjectExt::property(self, "video-renderer")
856    }
857
858    #[doc(alias = "video-renderer")]
859    pub fn set_video_renderer<P: IsA<PlayVideoRenderer>>(&self, video_renderer: Option<&P>) {
860        ObjectExt::set_property(self, "video-renderer", video_renderer)
861    }
862
863    /// ## `info`
864    /// a [`PlayMediaInfo`][crate::PlayMediaInfo]
865    ///
866    /// # Returns
867    ///
868    /// A `GList` of
869    /// matching [`PlayAudioInfo`][crate::PlayAudioInfo].
870    #[doc(alias = "gst_play_get_audio_streams")]
871    #[doc(alias = "get_audio_streams")]
872    pub fn audio_streams(info: &PlayMediaInfo) -> Vec<PlayAudioInfo> {
873        skip_assert_initialized!();
874        unsafe {
875            FromGlibPtrContainer::from_glib_none(ffi::gst_play_get_audio_streams(
876                info.to_glib_none().0,
877            ))
878        }
879    }
880
881    /// ## `info`
882    /// a [`PlayMediaInfo`][crate::PlayMediaInfo]
883    ///
884    /// # Returns
885    ///
886    /// A `GList` of
887    /// matching [`PlaySubtitleInfo`][crate::PlaySubtitleInfo].
888    #[doc(alias = "gst_play_get_subtitle_streams")]
889    #[doc(alias = "get_subtitle_streams")]
890    pub fn subtitle_streams(info: &PlayMediaInfo) -> Vec<PlaySubtitleInfo> {
891        skip_assert_initialized!();
892        unsafe {
893            FromGlibPtrContainer::from_glib_none(ffi::gst_play_get_subtitle_streams(
894                info.to_glib_none().0,
895            ))
896        }
897    }
898
899    /// ## `info`
900    /// a [`PlayMediaInfo`][crate::PlayMediaInfo]
901    ///
902    /// # Returns
903    ///
904    /// A `GList` of
905    /// matching [`PlayVideoInfo`][crate::PlayVideoInfo].
906    #[doc(alias = "gst_play_get_video_streams")]
907    #[doc(alias = "get_video_streams")]
908    pub fn video_streams(info: &PlayMediaInfo) -> Vec<PlayVideoInfo> {
909        skip_assert_initialized!();
910        unsafe {
911            FromGlibPtrContainer::from_glib_none(ffi::gst_play_get_video_streams(
912                info.to_glib_none().0,
913            ))
914        }
915    }
916
917    /// ## `msg`
918    /// A [`gst::Message`][crate::gst::Message]
919    ///
920    /// # Returns
921    ///
922    /// A `gboolean` indicating whether the passed message represents a [`Play`][crate::Play] message or not.
923    #[doc(alias = "gst_play_is_play_message")]
924    pub fn is_play_message(msg: &gst::Message) -> bool {
925        assert_initialized_main_thread!();
926        unsafe { from_glib(ffi::gst_play_is_play_message(msg.to_glib_none().0)) }
927    }
928
929    ///
930    /// # Returns
931    ///
932    ///
933    ///  a [`None`] terminated array containing all available
934    ///  visualizations. Use `gst_play_visualizations_free()` after
935    ///  usage.
936    #[doc(alias = "gst_play_visualizations_get")]
937    pub fn visualizations_get() -> Vec<PlayVisualization> {
938        assert_initialized_main_thread!();
939        unsafe { FromGlibPtrContainer::from_glib_full(ffi::gst_play_visualizations_get()) }
940    }
941
942    #[doc(alias = "audio-video-offset")]
943    pub fn connect_audio_video_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
944        &self,
945        f: F,
946    ) -> SignalHandlerId {
947        unsafe extern "C" fn notify_audio_video_offset_trampoline<
948            F: Fn(&Play) + Send + Sync + 'static,
949        >(
950            this: *mut ffi::GstPlay,
951            _param_spec: glib::ffi::gpointer,
952            f: glib::ffi::gpointer,
953        ) {
954            unsafe {
955                let f: &F = &*(f as *const F);
956                f(&from_glib_borrow(this))
957            }
958        }
959        unsafe {
960            let f: Box_<F> = Box_::new(f);
961            connect_raw(
962                self.as_ptr() as *mut _,
963                c"notify::audio-video-offset".as_ptr(),
964                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
965                    notify_audio_video_offset_trampoline::<F> as *const (),
966                )),
967                Box_::into_raw(f),
968            )
969        }
970    }
971
972    #[doc(alias = "current-audio-track")]
973    pub fn connect_current_audio_track_notify<F: Fn(&Self) + Send + Sync + 'static>(
974        &self,
975        f: F,
976    ) -> SignalHandlerId {
977        unsafe extern "C" fn notify_current_audio_track_trampoline<
978            F: Fn(&Play) + Send + Sync + 'static,
979        >(
980            this: *mut ffi::GstPlay,
981            _param_spec: glib::ffi::gpointer,
982            f: glib::ffi::gpointer,
983        ) {
984            unsafe {
985                let f: &F = &*(f as *const F);
986                f(&from_glib_borrow(this))
987            }
988        }
989        unsafe {
990            let f: Box_<F> = Box_::new(f);
991            connect_raw(
992                self.as_ptr() as *mut _,
993                c"notify::current-audio-track".as_ptr(),
994                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
995                    notify_current_audio_track_trampoline::<F> as *const (),
996                )),
997                Box_::into_raw(f),
998            )
999        }
1000    }
1001
1002    #[doc(alias = "current-subtitle-track")]
1003    pub fn connect_current_subtitle_track_notify<F: Fn(&Self) + Send + Sync + 'static>(
1004        &self,
1005        f: F,
1006    ) -> SignalHandlerId {
1007        unsafe extern "C" fn notify_current_subtitle_track_trampoline<
1008            F: Fn(&Play) + Send + Sync + 'static,
1009        >(
1010            this: *mut ffi::GstPlay,
1011            _param_spec: glib::ffi::gpointer,
1012            f: glib::ffi::gpointer,
1013        ) {
1014            unsafe {
1015                let f: &F = &*(f as *const F);
1016                f(&from_glib_borrow(this))
1017            }
1018        }
1019        unsafe {
1020            let f: Box_<F> = Box_::new(f);
1021            connect_raw(
1022                self.as_ptr() as *mut _,
1023                c"notify::current-subtitle-track".as_ptr(),
1024                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1025                    notify_current_subtitle_track_trampoline::<F> as *const (),
1026                )),
1027                Box_::into_raw(f),
1028            )
1029        }
1030    }
1031
1032    #[doc(alias = "current-video-track")]
1033    pub fn connect_current_video_track_notify<F: Fn(&Self) + Send + Sync + 'static>(
1034        &self,
1035        f: F,
1036    ) -> SignalHandlerId {
1037        unsafe extern "C" fn notify_current_video_track_trampoline<
1038            F: Fn(&Play) + Send + Sync + 'static,
1039        >(
1040            this: *mut ffi::GstPlay,
1041            _param_spec: glib::ffi::gpointer,
1042            f: glib::ffi::gpointer,
1043        ) {
1044            unsafe {
1045                let f: &F = &*(f as *const F);
1046                f(&from_glib_borrow(this))
1047            }
1048        }
1049        unsafe {
1050            let f: Box_<F> = Box_::new(f);
1051            connect_raw(
1052                self.as_ptr() as *mut _,
1053                c"notify::current-video-track".as_ptr(),
1054                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1055                    notify_current_video_track_trampoline::<F> as *const (),
1056                )),
1057                Box_::into_raw(f),
1058            )
1059        }
1060    }
1061
1062    #[doc(alias = "duration")]
1063    pub fn connect_duration_notify<F: Fn(&Self) + Send + Sync + 'static>(
1064        &self,
1065        f: F,
1066    ) -> SignalHandlerId {
1067        unsafe extern "C" fn notify_duration_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1068            this: *mut ffi::GstPlay,
1069            _param_spec: glib::ffi::gpointer,
1070            f: glib::ffi::gpointer,
1071        ) {
1072            unsafe {
1073                let f: &F = &*(f as *const F);
1074                f(&from_glib_borrow(this))
1075            }
1076        }
1077        unsafe {
1078            let f: Box_<F> = Box_::new(f);
1079            connect_raw(
1080                self.as_ptr() as *mut _,
1081                c"notify::duration".as_ptr(),
1082                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1083                    notify_duration_trampoline::<F> as *const (),
1084                )),
1085                Box_::into_raw(f),
1086            )
1087        }
1088    }
1089
1090    #[doc(alias = "media-info")]
1091    pub fn connect_media_info_notify<F: Fn(&Self) + Send + Sync + 'static>(
1092        &self,
1093        f: F,
1094    ) -> SignalHandlerId {
1095        unsafe extern "C" fn notify_media_info_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1096            this: *mut ffi::GstPlay,
1097            _param_spec: glib::ffi::gpointer,
1098            f: glib::ffi::gpointer,
1099        ) {
1100            unsafe {
1101                let f: &F = &*(f as *const F);
1102                f(&from_glib_borrow(this))
1103            }
1104        }
1105        unsafe {
1106            let f: Box_<F> = Box_::new(f);
1107            connect_raw(
1108                self.as_ptr() as *mut _,
1109                c"notify::media-info".as_ptr(),
1110                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1111                    notify_media_info_trampoline::<F> as *const (),
1112                )),
1113                Box_::into_raw(f),
1114            )
1115        }
1116    }
1117
1118    #[doc(alias = "mute")]
1119    pub fn connect_mute_notify<F: Fn(&Self) + Send + Sync + 'static>(
1120        &self,
1121        f: F,
1122    ) -> SignalHandlerId {
1123        unsafe extern "C" fn notify_mute_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1124            this: *mut ffi::GstPlay,
1125            _param_spec: glib::ffi::gpointer,
1126            f: glib::ffi::gpointer,
1127        ) {
1128            unsafe {
1129                let f: &F = &*(f as *const F);
1130                f(&from_glib_borrow(this))
1131            }
1132        }
1133        unsafe {
1134            let f: Box_<F> = Box_::new(f);
1135            connect_raw(
1136                self.as_ptr() as *mut _,
1137                c"notify::mute".as_ptr(),
1138                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1139                    notify_mute_trampoline::<F> as *const (),
1140                )),
1141                Box_::into_raw(f),
1142            )
1143        }
1144    }
1145
1146    #[doc(alias = "pipeline")]
1147    pub fn connect_pipeline_notify<F: Fn(&Self) + Send + Sync + 'static>(
1148        &self,
1149        f: F,
1150    ) -> SignalHandlerId {
1151        unsafe extern "C" fn notify_pipeline_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1152            this: *mut ffi::GstPlay,
1153            _param_spec: glib::ffi::gpointer,
1154            f: glib::ffi::gpointer,
1155        ) {
1156            unsafe {
1157                let f: &F = &*(f as *const F);
1158                f(&from_glib_borrow(this))
1159            }
1160        }
1161        unsafe {
1162            let f: Box_<F> = Box_::new(f);
1163            connect_raw(
1164                self.as_ptr() as *mut _,
1165                c"notify::pipeline".as_ptr(),
1166                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1167                    notify_pipeline_trampoline::<F> as *const (),
1168                )),
1169                Box_::into_raw(f),
1170            )
1171        }
1172    }
1173
1174    #[doc(alias = "position")]
1175    pub fn connect_position_notify<F: Fn(&Self) + Send + Sync + 'static>(
1176        &self,
1177        f: F,
1178    ) -> SignalHandlerId {
1179        unsafe extern "C" fn notify_position_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1180            this: *mut ffi::GstPlay,
1181            _param_spec: glib::ffi::gpointer,
1182            f: glib::ffi::gpointer,
1183        ) {
1184            unsafe {
1185                let f: &F = &*(f as *const F);
1186                f(&from_glib_borrow(this))
1187            }
1188        }
1189        unsafe {
1190            let f: Box_<F> = Box_::new(f);
1191            connect_raw(
1192                self.as_ptr() as *mut _,
1193                c"notify::position".as_ptr(),
1194                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1195                    notify_position_trampoline::<F> as *const (),
1196                )),
1197                Box_::into_raw(f),
1198            )
1199        }
1200    }
1201
1202    #[doc(alias = "rate")]
1203    pub fn connect_rate_notify<F: Fn(&Self) + Send + Sync + 'static>(
1204        &self,
1205        f: F,
1206    ) -> SignalHandlerId {
1207        unsafe extern "C" fn notify_rate_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1208            this: *mut ffi::GstPlay,
1209            _param_spec: glib::ffi::gpointer,
1210            f: glib::ffi::gpointer,
1211        ) {
1212            unsafe {
1213                let f: &F = &*(f as *const F);
1214                f(&from_glib_borrow(this))
1215            }
1216        }
1217        unsafe {
1218            let f: Box_<F> = Box_::new(f);
1219            connect_raw(
1220                self.as_ptr() as *mut _,
1221                c"notify::rate".as_ptr(),
1222                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1223                    notify_rate_trampoline::<F> as *const (),
1224                )),
1225                Box_::into_raw(f),
1226            )
1227        }
1228    }
1229
1230    #[doc(alias = "subtitle-video-offset")]
1231    pub fn connect_subtitle_video_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
1232        &self,
1233        f: F,
1234    ) -> SignalHandlerId {
1235        unsafe extern "C" fn notify_subtitle_video_offset_trampoline<
1236            F: Fn(&Play) + Send + Sync + 'static,
1237        >(
1238            this: *mut ffi::GstPlay,
1239            _param_spec: glib::ffi::gpointer,
1240            f: glib::ffi::gpointer,
1241        ) {
1242            unsafe {
1243                let f: &F = &*(f as *const F);
1244                f(&from_glib_borrow(this))
1245            }
1246        }
1247        unsafe {
1248            let f: Box_<F> = Box_::new(f);
1249            connect_raw(
1250                self.as_ptr() as *mut _,
1251                c"notify::subtitle-video-offset".as_ptr(),
1252                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1253                    notify_subtitle_video_offset_trampoline::<F> as *const (),
1254                )),
1255                Box_::into_raw(f),
1256            )
1257        }
1258    }
1259
1260    #[doc(alias = "suburi")]
1261    pub fn connect_suburi_notify<F: Fn(&Self) + Send + Sync + 'static>(
1262        &self,
1263        f: F,
1264    ) -> SignalHandlerId {
1265        unsafe extern "C" fn notify_suburi_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1266            this: *mut ffi::GstPlay,
1267            _param_spec: glib::ffi::gpointer,
1268            f: glib::ffi::gpointer,
1269        ) {
1270            unsafe {
1271                let f: &F = &*(f as *const F);
1272                f(&from_glib_borrow(this))
1273            }
1274        }
1275        unsafe {
1276            let f: Box_<F> = Box_::new(f);
1277            connect_raw(
1278                self.as_ptr() as *mut _,
1279                c"notify::suburi".as_ptr(),
1280                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1281                    notify_suburi_trampoline::<F> as *const (),
1282                )),
1283                Box_::into_raw(f),
1284            )
1285        }
1286    }
1287
1288    #[doc(alias = "uri")]
1289    pub fn connect_uri_notify<F: Fn(&Self) + Send + Sync + 'static>(
1290        &self,
1291        f: F,
1292    ) -> SignalHandlerId {
1293        unsafe extern "C" fn notify_uri_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1294            this: *mut ffi::GstPlay,
1295            _param_spec: glib::ffi::gpointer,
1296            f: glib::ffi::gpointer,
1297        ) {
1298            unsafe {
1299                let f: &F = &*(f as *const F);
1300                f(&from_glib_borrow(this))
1301            }
1302        }
1303        unsafe {
1304            let f: Box_<F> = Box_::new(f);
1305            connect_raw(
1306                self.as_ptr() as *mut _,
1307                c"notify::uri".as_ptr(),
1308                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1309                    notify_uri_trampoline::<F> as *const (),
1310                )),
1311                Box_::into_raw(f),
1312            )
1313        }
1314    }
1315
1316    #[doc(alias = "video-multiview-flags")]
1317    pub fn connect_video_multiview_flags_notify<F: Fn(&Self) + Send + Sync + 'static>(
1318        &self,
1319        f: F,
1320    ) -> SignalHandlerId {
1321        unsafe extern "C" fn notify_video_multiview_flags_trampoline<
1322            F: Fn(&Play) + Send + Sync + 'static,
1323        >(
1324            this: *mut ffi::GstPlay,
1325            _param_spec: glib::ffi::gpointer,
1326            f: glib::ffi::gpointer,
1327        ) {
1328            unsafe {
1329                let f: &F = &*(f as *const F);
1330                f(&from_glib_borrow(this))
1331            }
1332        }
1333        unsafe {
1334            let f: Box_<F> = Box_::new(f);
1335            connect_raw(
1336                self.as_ptr() as *mut _,
1337                c"notify::video-multiview-flags".as_ptr(),
1338                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1339                    notify_video_multiview_flags_trampoline::<F> as *const (),
1340                )),
1341                Box_::into_raw(f),
1342            )
1343        }
1344    }
1345
1346    #[doc(alias = "video-multiview-mode")]
1347    pub fn connect_video_multiview_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
1348        &self,
1349        f: F,
1350    ) -> SignalHandlerId {
1351        unsafe extern "C" fn notify_video_multiview_mode_trampoline<
1352            F: Fn(&Play) + Send + Sync + 'static,
1353        >(
1354            this: *mut ffi::GstPlay,
1355            _param_spec: glib::ffi::gpointer,
1356            f: glib::ffi::gpointer,
1357        ) {
1358            unsafe {
1359                let f: &F = &*(f as *const F);
1360                f(&from_glib_borrow(this))
1361            }
1362        }
1363        unsafe {
1364            let f: Box_<F> = Box_::new(f);
1365            connect_raw(
1366                self.as_ptr() as *mut _,
1367                c"notify::video-multiview-mode".as_ptr(),
1368                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1369                    notify_video_multiview_mode_trampoline::<F> as *const (),
1370                )),
1371                Box_::into_raw(f),
1372            )
1373        }
1374    }
1375
1376    #[doc(alias = "video-renderer")]
1377    pub fn connect_video_renderer_notify<F: Fn(&Self) + Send + Sync + 'static>(
1378        &self,
1379        f: F,
1380    ) -> SignalHandlerId {
1381        unsafe extern "C" fn notify_video_renderer_trampoline<
1382            F: Fn(&Play) + Send + Sync + 'static,
1383        >(
1384            this: *mut ffi::GstPlay,
1385            _param_spec: glib::ffi::gpointer,
1386            f: glib::ffi::gpointer,
1387        ) {
1388            unsafe {
1389                let f: &F = &*(f as *const F);
1390                f(&from_glib_borrow(this))
1391            }
1392        }
1393        unsafe {
1394            let f: Box_<F> = Box_::new(f);
1395            connect_raw(
1396                self.as_ptr() as *mut _,
1397                c"notify::video-renderer".as_ptr(),
1398                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1399                    notify_video_renderer_trampoline::<F> as *const (),
1400                )),
1401                Box_::into_raw(f),
1402            )
1403        }
1404    }
1405
1406    #[doc(alias = "volume")]
1407    pub fn connect_volume_notify<F: Fn(&Self) + Send + Sync + 'static>(
1408        &self,
1409        f: F,
1410    ) -> SignalHandlerId {
1411        unsafe extern "C" fn notify_volume_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
1412            this: *mut ffi::GstPlay,
1413            _param_spec: glib::ffi::gpointer,
1414            f: glib::ffi::gpointer,
1415        ) {
1416            unsafe {
1417                let f: &F = &*(f as *const F);
1418                f(&from_glib_borrow(this))
1419            }
1420        }
1421        unsafe {
1422            let f: Box_<F> = Box_::new(f);
1423            connect_raw(
1424                self.as_ptr() as *mut _,
1425                c"notify::volume".as_ptr(),
1426                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1427                    notify_volume_trampoline::<F> as *const (),
1428                )),
1429                Box_::into_raw(f),
1430            )
1431        }
1432    }
1433}
1434
1435unsafe impl Send for Play {}
1436unsafe impl Sync for Play {}