gstreamer_player/auto/
player.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
6use crate::{
7    ffi, PlayerAudioInfo, PlayerColorBalanceType, PlayerMediaInfo, PlayerSignalDispatcher,
8    PlayerState, PlayerSubtitleInfo, PlayerVideoInfo, PlayerVideoRenderer, PlayerVisualization,
9};
10use glib::{
11    object::ObjectType as _,
12    prelude::*,
13    signal::{connect_raw, SignalHandlerId},
14    translate::*,
15};
16use std::boxed::Box as Box_;
17
18glib::wrapper! {
19    /// Starting from GStreamer 1.20, application developers are strongly advised to migrate to `GstPlay`.
20    /// [`Player`][crate::Player] will be deprecated in 1.20 and most likely removed by 1.24.
21    ///
22    /// ## Properties
23    ///
24    ///
25    /// #### `audio-video-offset`
26    ///  Readable | Writeable
27    ///
28    ///
29    /// #### `current-audio-track`
30    ///  Readable
31    ///
32    ///
33    /// #### `current-subtitle-track`
34    ///  Readable
35    ///
36    ///
37    /// #### `current-video-track`
38    ///  Readable
39    ///
40    ///
41    /// #### `duration`
42    ///  Readable
43    ///
44    ///
45    /// #### `media-info`
46    ///  Readable
47    ///
48    ///
49    /// #### `mute`
50    ///  Readable | Writeable
51    ///
52    ///
53    /// #### `pipeline`
54    ///  Readable
55    ///
56    ///
57    /// #### `position`
58    ///  Readable
59    ///
60    ///
61    /// #### `rate`
62    ///  Readable | Writeable
63    ///
64    ///
65    /// #### `signal-dispatcher`
66    ///  Writeable | Construct Only
67    ///
68    ///
69    /// #### `subtitle-video-offset`
70    ///  Readable | Writeable
71    ///
72    ///
73    /// #### `suburi`
74    ///  Readable | Writeable
75    ///
76    ///
77    /// #### `uri`
78    ///  Readable | Writeable
79    ///
80    ///
81    /// #### `video-multiview-flags`
82    ///  Readable | Writeable
83    ///
84    ///
85    /// #### `video-multiview-mode`
86    ///  Readable | Writeable
87    ///
88    ///
89    /// #### `video-renderer`
90    ///  Readable | Writeable | Construct Only
91    ///
92    ///
93    /// #### `volume`
94    ///  Readable | Writeable
95    /// <details><summary><h4>Object</h4></summary>
96    ///
97    ///
98    /// #### `name`
99    ///  Readable | Writeable | Construct
100    ///
101    ///
102    /// #### `parent`
103    ///  The parent of the object. Please note, that when changing the 'parent'
104    /// property, we don't emit [`notify`][struct@crate::glib::Object#notify] and [`deep-notify`][struct@crate::gst::Object#deep-notify]
105    /// signals due to locking issues. In some cases one can use
106    /// `GstBin::element-added` or `GstBin::element-removed` signals on the parent to
107    /// achieve a similar effect.
108    ///
109    /// Readable | Writeable
110    /// </details>
111    ///
112    /// ## Signals
113    ///
114    ///
115    /// #### `buffering`
116    ///
117    ///
118    ///
119    /// #### `duration-changed`
120    ///
121    ///
122    ///
123    /// #### `end-of-stream`
124    ///
125    ///
126    ///
127    /// #### `error`
128    ///
129    ///
130    ///
131    /// #### `media-info-updated`
132    ///
133    ///
134    ///
135    /// #### `mute-changed`
136    ///
137    ///
138    ///
139    /// #### `position-updated`
140    ///
141    ///
142    ///
143    /// #### `seek-done`
144    ///
145    ///
146    ///
147    /// #### `state-changed`
148    ///
149    ///
150    ///
151    /// #### `uri-loaded`
152    ///
153    ///
154    ///
155    /// #### `video-dimensions-changed`
156    ///
157    ///
158    ///
159    /// #### `volume-changed`
160    ///
161    ///
162    ///
163    /// #### `warning`
164    ///
165    /// <details><summary><h4>Object</h4></summary>
166    ///
167    ///
168    /// #### `deep-notify`
169    ///  The deep notify signal is used to be notified of property changes. It is
170    /// typically attached to the toplevel bin to receive notifications from all
171    /// the elements contained in that bin.
172    ///
173    /// Detailed
174    /// </details>
175    ///
176    /// # Implements
177    ///
178    /// [`trait@gst::prelude::ObjectExt`], [`trait@glib::ObjectExt`]
179    #[doc(alias = "GstPlayer")]
180    pub struct Player(Object<ffi::GstPlayer, ffi::GstPlayerClass>) @extends gst::Object;
181
182    match fn {
183        type_ => || ffi::gst_player_get_type(),
184    }
185}
186
187impl Player {
188    /// Creates a new [`Player`][crate::Player] instance that uses `signal_dispatcher` to dispatch
189    /// signals to some event loop system, or emits signals directly if NULL is
190    /// passed. See `gst_player_g_main_context_signal_dispatcher_new()`.
191    ///
192    /// Video is going to be rendered by `video_renderer`, or if [`None`] is provided
193    /// no special video set up will be done and some default handling will be
194    /// performed.
195    ///
196    /// This also initializes GStreamer via ``gst_init()`` on the first call if this
197    /// didn't happen before.
198    /// ## `video_renderer`
199    /// GstPlayerVideoRenderer to use
200    /// ## `signal_dispatcher`
201    /// GstPlayerSignalDispatcher to use
202    ///
203    /// # Returns
204    ///
205    /// a new [`Player`][crate::Player] instance
206    #[doc(alias = "gst_player_new")]
207    pub fn new(
208        video_renderer: Option<impl IsA<PlayerVideoRenderer>>,
209        signal_dispatcher: Option<impl IsA<PlayerSignalDispatcher>>,
210    ) -> Player {
211        assert_initialized_main_thread!();
212        unsafe {
213            from_glib_full(ffi::gst_player_new(
214                video_renderer.map(|p| p.upcast()).into_glib_ptr(),
215                signal_dispatcher.map(|p| p.upcast()).into_glib_ptr(),
216            ))
217        }
218    }
219
220    /// Retrieve the current value of audio-video-offset property
221    ///
222    /// # Returns
223    ///
224    /// The current value of audio-video-offset in nanoseconds
225    #[doc(alias = "gst_player_get_audio_video_offset")]
226    #[doc(alias = "get_audio_video_offset")]
227    #[doc(alias = "audio-video-offset")]
228    pub fn audio_video_offset(&self) -> i64 {
229        unsafe { ffi::gst_player_get_audio_video_offset(self.to_glib_none().0) }
230    }
231
232    /// Retrieve the current value of the indicated `type_`.
233    /// ## `type_`
234    /// [`PlayerColorBalanceType`][crate::PlayerColorBalanceType]
235    ///
236    /// # Returns
237    ///
238    /// The current value of `type_`, between [0,1]. In case of
239    ///  error -1 is returned.
240    #[doc(alias = "gst_player_get_color_balance")]
241    #[doc(alias = "get_color_balance")]
242    pub fn color_balance(&self, type_: PlayerColorBalanceType) -> f64 {
243        unsafe { ffi::gst_player_get_color_balance(self.to_glib_none().0, type_.into_glib()) }
244    }
245
246    /// A Function to get current audio [`PlayerAudioInfo`][crate::PlayerAudioInfo] instance.
247    ///
248    /// # Returns
249    ///
250    /// current audio track.
251    ///
252    /// The caller should free it with `g_object_unref()`
253    #[doc(alias = "gst_player_get_current_audio_track")]
254    #[doc(alias = "get_current_audio_track")]
255    #[doc(alias = "current-audio-track")]
256    pub fn current_audio_track(&self) -> Option<PlayerAudioInfo> {
257        unsafe {
258            from_glib_full(ffi::gst_player_get_current_audio_track(
259                self.to_glib_none().0,
260            ))
261        }
262    }
263
264    /// A Function to get current subtitle [`PlayerSubtitleInfo`][crate::PlayerSubtitleInfo] instance.
265    ///
266    /// # Returns
267    ///
268    /// current subtitle track.
269    ///
270    /// The caller should free it with `g_object_unref()`
271    #[doc(alias = "gst_player_get_current_subtitle_track")]
272    #[doc(alias = "get_current_subtitle_track")]
273    #[doc(alias = "current-subtitle-track")]
274    pub fn current_subtitle_track(&self) -> Option<PlayerSubtitleInfo> {
275        unsafe {
276            from_glib_full(ffi::gst_player_get_current_subtitle_track(
277                self.to_glib_none().0,
278            ))
279        }
280    }
281
282    /// A Function to get current video [`PlayerVideoInfo`][crate::PlayerVideoInfo] instance.
283    ///
284    /// # Returns
285    ///
286    /// current video track.
287    ///
288    /// The caller should free it with `g_object_unref()`
289    #[doc(alias = "gst_player_get_current_video_track")]
290    #[doc(alias = "get_current_video_track")]
291    #[doc(alias = "current-video-track")]
292    pub fn current_video_track(&self) -> Option<PlayerVideoInfo> {
293        unsafe {
294            from_glib_full(ffi::gst_player_get_current_video_track(
295                self.to_glib_none().0,
296            ))
297        }
298    }
299
300    ///
301    /// # Returns
302    ///
303    /// Name of the currently enabled
304    ///  visualization.
305    ///  `g_free()` after usage.
306    #[doc(alias = "gst_player_get_current_visualization")]
307    #[doc(alias = "get_current_visualization")]
308    pub fn current_visualization(&self) -> Option<glib::GString> {
309        unsafe {
310            from_glib_full(ffi::gst_player_get_current_visualization(
311                self.to_glib_none().0,
312            ))
313        }
314    }
315
316    /// Retrieves the duration of the media stream that self represents.
317    ///
318    /// # Returns
319    ///
320    /// the duration of the currently-playing media stream, in
321    /// nanoseconds.
322    #[doc(alias = "gst_player_get_duration")]
323    #[doc(alias = "get_duration")]
324    pub fn duration(&self) -> Option<gst::ClockTime> {
325        unsafe { from_glib(ffi::gst_player_get_duration(self.to_glib_none().0)) }
326    }
327
328    /// A Function to get the current media info [`PlayerMediaInfo`][crate::PlayerMediaInfo] instance.
329    ///
330    /// # Returns
331    ///
332    /// media info instance.
333    ///
334    /// The caller should free it with `g_object_unref()`
335    #[doc(alias = "gst_player_get_media_info")]
336    #[doc(alias = "get_media_info")]
337    #[doc(alias = "media-info")]
338    pub fn media_info(&self) -> Option<PlayerMediaInfo> {
339        unsafe { from_glib_full(ffi::gst_player_get_media_info(self.to_glib_none().0)) }
340    }
341
342    /// Retrieve the current value of the indicated `type_`.
343    ///
344    /// # Returns
345    ///
346    /// The current value of `type_`, Default: 0x00000000 "none
347    #[doc(alias = "gst_player_get_multiview_flags")]
348    #[doc(alias = "get_multiview_flags")]
349    pub fn multiview_flags(&self) -> gst_video::VideoMultiviewFlags {
350        unsafe { from_glib(ffi::gst_player_get_multiview_flags(self.to_glib_none().0)) }
351    }
352
353    /// Retrieve the current value of the indicated `type_`.
354    ///
355    /// # Returns
356    ///
357    /// The current value of `type_`, Default: -1 "none"
358    #[doc(alias = "gst_player_get_multiview_mode")]
359    #[doc(alias = "get_multiview_mode")]
360    pub fn multiview_mode(&self) -> gst_video::VideoMultiviewFramePacking {
361        unsafe { from_glib(ffi::gst_player_get_multiview_mode(self.to_glib_none().0)) }
362    }
363
364    ///
365    /// # Returns
366    ///
367    /// [`true`] if the currently-playing stream is muted.
368    #[doc(alias = "gst_player_get_mute")]
369    #[doc(alias = "get_mute")]
370    #[doc(alias = "mute")]
371    pub fn is_muted(&self) -> bool {
372        unsafe { from_glib(ffi::gst_player_get_mute(self.to_glib_none().0)) }
373    }
374
375    ///
376    /// # Returns
377    ///
378    /// The internal playbin instance.
379    ///
380    /// The caller should free it with `g_object_unref()`
381    #[doc(alias = "gst_player_get_pipeline")]
382    #[doc(alias = "get_pipeline")]
383    pub fn pipeline(&self) -> gst::Element {
384        unsafe { from_glib_full(ffi::gst_player_get_pipeline(self.to_glib_none().0)) }
385    }
386
387    ///
388    /// # Returns
389    ///
390    /// the absolute position time, in nanoseconds, of the
391    /// currently-playing stream.
392    #[doc(alias = "gst_player_get_position")]
393    #[doc(alias = "get_position")]
394    pub fn position(&self) -> Option<gst::ClockTime> {
395        unsafe { from_glib(ffi::gst_player_get_position(self.to_glib_none().0)) }
396    }
397
398    ///
399    /// # Returns
400    ///
401    /// current playback rate
402    #[doc(alias = "gst_player_get_rate")]
403    #[doc(alias = "get_rate")]
404    pub fn rate(&self) -> f64 {
405        unsafe { ffi::gst_player_get_rate(self.to_glib_none().0) }
406    }
407
408    /// current subtitle URI
409    ///
410    /// # Returns
411    ///
412    /// URI of the current external subtitle.
413    ///  `g_free()` after usage.
414    #[doc(alias = "gst_player_get_subtitle_uri")]
415    #[doc(alias = "get_subtitle_uri")]
416    pub fn subtitle_uri(&self) -> Option<glib::GString> {
417        unsafe { from_glib_full(ffi::gst_player_get_subtitle_uri(self.to_glib_none().0)) }
418    }
419
420    /// Retrieve the current value of subtitle-video-offset property
421    ///
422    /// # Returns
423    ///
424    /// The current value of subtitle-video-offset in nanoseconds
425    #[cfg(feature = "v1_16")]
426    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
427    #[doc(alias = "gst_player_get_subtitle_video_offset")]
428    #[doc(alias = "get_subtitle_video_offset")]
429    #[doc(alias = "subtitle-video-offset")]
430    pub fn subtitle_video_offset(&self) -> i64 {
431        unsafe { ffi::gst_player_get_subtitle_video_offset(self.to_glib_none().0) }
432    }
433
434    /// Gets the URI of the currently-playing stream.
435    ///
436    /// # Returns
437    ///
438    /// a string containing the URI of the
439    /// currently-playing stream. `g_free()` after usage.
440    #[doc(alias = "gst_player_get_uri")]
441    #[doc(alias = "get_uri")]
442    pub fn uri(&self) -> Option<glib::GString> {
443        unsafe { from_glib_full(ffi::gst_player_get_uri(self.to_glib_none().0)) }
444    }
445
446    /// Returns the current volume level, as a percentage between 0 and 1.
447    ///
448    /// # Returns
449    ///
450    /// the volume as percentage between 0 and 1.
451    #[doc(alias = "gst_player_get_volume")]
452    #[doc(alias = "get_volume")]
453    pub fn volume(&self) -> f64 {
454        unsafe { ffi::gst_player_get_volume(self.to_glib_none().0) }
455    }
456
457    /// Checks whether the `self` has color balance support available.
458    ///
459    /// # Returns
460    ///
461    /// [`true`] if `self` has color balance support. Otherwise,
462    ///  [`false`].
463    #[doc(alias = "gst_player_has_color_balance")]
464    pub fn has_color_balance(&self) -> bool {
465        unsafe { from_glib(ffi::gst_player_has_color_balance(self.to_glib_none().0)) }
466    }
467
468    /// Pauses the current stream.
469    #[doc(alias = "gst_player_pause")]
470    pub fn pause(&self) {
471        unsafe {
472            ffi::gst_player_pause(self.to_glib_none().0);
473        }
474    }
475
476    /// Request to play the loaded stream.
477    #[doc(alias = "gst_player_play")]
478    pub fn play(&self) {
479        unsafe {
480            ffi::gst_player_play(self.to_glib_none().0);
481        }
482    }
483
484    /// Seeks the currently-playing stream to the absolute `position` time
485    /// in nanoseconds.
486    /// ## `position`
487    /// position to seek in nanoseconds
488    #[doc(alias = "gst_player_seek")]
489    pub fn seek(&self, position: gst::ClockTime) {
490        unsafe {
491            ffi::gst_player_seek(self.to_glib_none().0, position.into_glib());
492        }
493    }
494
495    /// ## `stream_index`
496    /// stream index
497    ///
498    /// # Returns
499    ///
500    /// [`true`] or [`false`]
501    ///
502    /// Sets the audio track `stream_idex`.
503    #[doc(alias = "gst_player_set_audio_track")]
504    pub fn set_audio_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> {
505        unsafe {
506            glib::result_from_gboolean!(
507                ffi::gst_player_set_audio_track(self.to_glib_none().0, stream_index),
508                "Failed to set audio track"
509            )
510        }
511    }
512
513    /// Enable or disable the current audio track.
514    /// ## `enabled`
515    /// TRUE or FALSE
516    #[doc(alias = "gst_player_set_audio_track_enabled")]
517    pub fn set_audio_track_enabled(&self, enabled: bool) {
518        unsafe {
519            ffi::gst_player_set_audio_track_enabled(self.to_glib_none().0, enabled.into_glib());
520        }
521    }
522
523    /// Sets audio-video-offset property by value of `offset`
524    /// ## `offset`
525    /// `gint64` in nanoseconds
526    #[doc(alias = "gst_player_set_audio_video_offset")]
527    #[doc(alias = "audio-video-offset")]
528    pub fn set_audio_video_offset(&self, offset: i64) {
529        unsafe {
530            ffi::gst_player_set_audio_video_offset(self.to_glib_none().0, offset);
531        }
532    }
533
534    /// Sets the current value of the indicated channel `type_` to the passed
535    /// value.
536    /// ## `type_`
537    /// [`PlayerColorBalanceType`][crate::PlayerColorBalanceType]
538    /// ## `value`
539    /// The new value for the `type_`, ranged [0,1]
540    #[doc(alias = "gst_player_set_color_balance")]
541    pub fn set_color_balance(&self, type_: PlayerColorBalanceType, value: f64) {
542        unsafe {
543            ffi::gst_player_set_color_balance(self.to_glib_none().0, type_.into_glib(), value);
544        }
545    }
546
547    /// Sets the current value of the indicated mode `type_` to the passed
548    /// value.
549    /// ## `flags`
550    /// The new value for the `type_`
551    #[doc(alias = "gst_player_set_multiview_flags")]
552    pub fn set_multiview_flags(&self, flags: gst_video::VideoMultiviewFlags) {
553        unsafe {
554            ffi::gst_player_set_multiview_flags(self.to_glib_none().0, flags.into_glib());
555        }
556    }
557
558    /// Sets the current value of the indicated mode `type_` to the passed
559    /// value.
560    /// ## `mode`
561    /// The new value for the `type_`
562    #[doc(alias = "gst_player_set_multiview_mode")]
563    pub fn set_multiview_mode(&self, mode: gst_video::VideoMultiviewFramePacking) {
564        unsafe {
565            ffi::gst_player_set_multiview_mode(self.to_glib_none().0, mode.into_glib());
566        }
567    }
568
569    /// [`true`] if the currently-playing stream should be muted.
570    /// ## `val`
571    /// Mute state the should be set
572    #[doc(alias = "gst_player_set_mute")]
573    #[doc(alias = "mute")]
574    pub fn set_mute(&self, val: bool) {
575        unsafe {
576            ffi::gst_player_set_mute(self.to_glib_none().0, val.into_glib());
577        }
578    }
579
580    /// Playback at specified rate
581    /// ## `rate`
582    /// playback rate
583    #[doc(alias = "gst_player_set_rate")]
584    #[doc(alias = "rate")]
585    pub fn set_rate(&self, rate: f64) {
586        unsafe {
587            ffi::gst_player_set_rate(self.to_glib_none().0, rate);
588        }
589    }
590
591    /// ## `stream_index`
592    /// stream index
593    ///
594    /// # Returns
595    ///
596    /// [`true`] or [`false`]
597    ///
598    /// Sets the subtitle stack `stream_index`.
599    #[doc(alias = "gst_player_set_subtitle_track")]
600    pub fn set_subtitle_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> {
601        unsafe {
602            glib::result_from_gboolean!(
603                ffi::gst_player_set_subtitle_track(self.to_glib_none().0, stream_index),
604                "Failed to set subtitle track"
605            )
606        }
607    }
608
609    /// Enable or disable the current subtitle track.
610    /// ## `enabled`
611    /// TRUE or FALSE
612    #[doc(alias = "gst_player_set_subtitle_track_enabled")]
613    pub fn set_subtitle_track_enabled(&self, enabled: bool) {
614        unsafe {
615            ffi::gst_player_set_subtitle_track_enabled(self.to_glib_none().0, enabled.into_glib());
616        }
617    }
618
619    /// Sets the external subtitle URI. This should be combined with a call to
620    /// gst_player_set_subtitle_track_enabled(`self`, TRUE) so the subtitles are actually
621    /// rendered.
622    /// ## `uri`
623    /// subtitle URI
624    #[doc(alias = "gst_player_set_subtitle_uri")]
625    pub fn set_subtitle_uri(&self, uri: Option<&str>) {
626        unsafe {
627            ffi::gst_player_set_subtitle_uri(self.to_glib_none().0, uri.to_glib_none().0);
628        }
629    }
630
631    /// Sets subtitle-video-offset property by value of `offset`
632    /// ## `offset`
633    /// `gint64` in nanoseconds
634    #[cfg(feature = "v1_16")]
635    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
636    #[doc(alias = "gst_player_set_subtitle_video_offset")]
637    #[doc(alias = "subtitle-video-offset")]
638    pub fn set_subtitle_video_offset(&self, offset: i64) {
639        unsafe {
640            ffi::gst_player_set_subtitle_video_offset(self.to_glib_none().0, offset);
641        }
642    }
643
644    /// Sets the next URI to play.
645    /// ## `uri`
646    /// next URI to play.
647    #[doc(alias = "gst_player_set_uri")]
648    #[doc(alias = "uri")]
649    pub fn set_uri(&self, uri: Option<&str>) {
650        unsafe {
651            ffi::gst_player_set_uri(self.to_glib_none().0, uri.to_glib_none().0);
652        }
653    }
654
655    /// ## `stream_index`
656    /// stream index
657    ///
658    /// # Returns
659    ///
660    /// [`true`] or [`false`]
661    ///
662    /// Sets the video track `stream_index`.
663    #[doc(alias = "gst_player_set_video_track")]
664    pub fn set_video_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> {
665        unsafe {
666            glib::result_from_gboolean!(
667                ffi::gst_player_set_video_track(self.to_glib_none().0, stream_index),
668                "Failed to set video track"
669            )
670        }
671    }
672
673    /// Enable or disable the current video track.
674    /// ## `enabled`
675    /// TRUE or FALSE
676    #[doc(alias = "gst_player_set_video_track_enabled")]
677    pub fn set_video_track_enabled(&self, enabled: bool) {
678        unsafe {
679            ffi::gst_player_set_video_track_enabled(self.to_glib_none().0, enabled.into_glib());
680        }
681    }
682
683    /// ## `name`
684    /// visualization element obtained from
685    /// [`visualizations_get()`][Self::visualizations_get()]
686    ///
687    /// # Returns
688    ///
689    /// [`true`] if the visualizations was set correctly. Otherwise,
690    /// [`false`].
691    #[doc(alias = "gst_player_set_visualization")]
692    pub fn set_visualization(&self, name: Option<&str>) -> Result<(), glib::error::BoolError> {
693        unsafe {
694            glib::result_from_gboolean!(
695                ffi::gst_player_set_visualization(self.to_glib_none().0, name.to_glib_none().0),
696                "Failed to set visualization"
697            )
698        }
699    }
700
701    /// Enable or disable the visualization.
702    /// ## `enabled`
703    /// TRUE or FALSE
704    #[doc(alias = "gst_player_set_visualization_enabled")]
705    pub fn set_visualization_enabled(&self, enabled: bool) {
706        unsafe {
707            ffi::gst_player_set_visualization_enabled(self.to_glib_none().0, enabled.into_glib());
708        }
709    }
710
711    /// Sets the volume level of the stream as a percentage between 0 and 1.
712    ///
713    /// This volume is a linear factor. For showing the volume in a GUI it
714    /// might make sense to first convert from a different format. Volume sliders
715    /// should usually use a cubic volume. See `gst_stream_volume_convert_volume()`.
716    /// ## `val`
717    /// the new volume level, as a percentage between 0 and 1
718    #[doc(alias = "gst_player_set_volume")]
719    #[doc(alias = "volume")]
720    pub fn set_volume(&self, val: f64) {
721        unsafe {
722            ffi::gst_player_set_volume(self.to_glib_none().0, val);
723        }
724    }
725
726    /// Stops playing the current stream and resets to the first position
727    /// in the stream.
728    #[doc(alias = "gst_player_stop")]
729    pub fn stop(&self) {
730        unsafe {
731            ffi::gst_player_stop(self.to_glib_none().0);
732        }
733    }
734
735    pub fn suburi(&self) -> Option<glib::GString> {
736        ObjectExt::property(self, "suburi")
737    }
738
739    pub fn set_suburi(&self, suburi: Option<&str>) {
740        ObjectExt::set_property(self, "suburi", suburi)
741    }
742
743    #[doc(alias = "video-multiview-flags")]
744    pub fn video_multiview_flags(&self) -> gst_video::VideoMultiviewFlags {
745        ObjectExt::property(self, "video-multiview-flags")
746    }
747
748    #[doc(alias = "video-multiview-flags")]
749    pub fn set_video_multiview_flags(&self, video_multiview_flags: gst_video::VideoMultiviewFlags) {
750        ObjectExt::set_property(self, "video-multiview-flags", video_multiview_flags)
751    }
752
753    #[doc(alias = "video-multiview-mode")]
754    pub fn video_multiview_mode(&self) -> gst_video::VideoMultiviewFramePacking {
755        ObjectExt::property(self, "video-multiview-mode")
756    }
757
758    #[doc(alias = "video-multiview-mode")]
759    pub fn set_video_multiview_mode(
760        &self,
761        video_multiview_mode: gst_video::VideoMultiviewFramePacking,
762    ) {
763        ObjectExt::set_property(self, "video-multiview-mode", video_multiview_mode)
764    }
765
766    #[doc(alias = "video-renderer")]
767    pub fn video_renderer(&self) -> Option<PlayerVideoRenderer> {
768        ObjectExt::property(self, "video-renderer")
769    }
770
771    /// ## `info`
772    /// a [`PlayerMediaInfo`][crate::PlayerMediaInfo]
773    ///
774    /// # Returns
775    ///
776    /// A `GList` of
777    /// matching [`PlayerAudioInfo`][crate::PlayerAudioInfo].
778    #[doc(alias = "gst_player_get_audio_streams")]
779    #[doc(alias = "get_audio_streams")]
780    pub fn audio_streams(info: &PlayerMediaInfo) -> Vec<PlayerAudioInfo> {
781        skip_assert_initialized!();
782        unsafe {
783            FromGlibPtrContainer::from_glib_none(ffi::gst_player_get_audio_streams(
784                info.to_glib_none().0,
785            ))
786        }
787    }
788
789    /// ## `info`
790    /// a [`PlayerMediaInfo`][crate::PlayerMediaInfo]
791    ///
792    /// # Returns
793    ///
794    /// A `GList` of
795    /// matching [`PlayerSubtitleInfo`][crate::PlayerSubtitleInfo].
796    #[doc(alias = "gst_player_get_subtitle_streams")]
797    #[doc(alias = "get_subtitle_streams")]
798    pub fn subtitle_streams(info: &PlayerMediaInfo) -> Vec<PlayerSubtitleInfo> {
799        skip_assert_initialized!();
800        unsafe {
801            FromGlibPtrContainer::from_glib_none(ffi::gst_player_get_subtitle_streams(
802                info.to_glib_none().0,
803            ))
804        }
805    }
806
807    /// ## `info`
808    /// a [`PlayerMediaInfo`][crate::PlayerMediaInfo]
809    ///
810    /// # Returns
811    ///
812    /// A `GList` of
813    /// matching [`PlayerVideoInfo`][crate::PlayerVideoInfo].
814    #[doc(alias = "gst_player_get_video_streams")]
815    #[doc(alias = "get_video_streams")]
816    pub fn video_streams(info: &PlayerMediaInfo) -> Vec<PlayerVideoInfo> {
817        skip_assert_initialized!();
818        unsafe {
819            FromGlibPtrContainer::from_glib_none(ffi::gst_player_get_video_streams(
820                info.to_glib_none().0,
821            ))
822        }
823    }
824
825    ///
826    /// # Returns
827    ///
828    ///
829    ///  a [`None`] terminated array containing all available
830    ///  visualizations. Use `gst_player_visualizations_free()` after
831    ///  usage.
832    #[doc(alias = "gst_player_visualizations_get")]
833    pub fn visualizations_get() -> Vec<PlayerVisualization> {
834        assert_initialized_main_thread!();
835        unsafe { FromGlibPtrContainer::from_glib_full(ffi::gst_player_visualizations_get()) }
836    }
837
838    #[doc(alias = "buffering")]
839    pub fn connect_buffering<F: Fn(&Self, i32) + Send + 'static>(&self, f: F) -> SignalHandlerId {
840        unsafe extern "C" fn buffering_trampoline<F: Fn(&Player, i32) + Send + 'static>(
841            this: *mut ffi::GstPlayer,
842            object: std::ffi::c_int,
843            f: glib::ffi::gpointer,
844        ) {
845            let f: &F = &*(f as *const F);
846            f(&from_glib_borrow(this), object)
847        }
848        unsafe {
849            let f: Box_<F> = Box_::new(f);
850            connect_raw(
851                self.as_ptr() as *mut _,
852                c"buffering".as_ptr() as *const _,
853                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
854                    buffering_trampoline::<F> as *const (),
855                )),
856                Box_::into_raw(f),
857            )
858        }
859    }
860
861    #[doc(alias = "end-of-stream")]
862    pub fn connect_end_of_stream<F: Fn(&Self) + Send + 'static>(&self, f: F) -> SignalHandlerId {
863        unsafe extern "C" fn end_of_stream_trampoline<F: Fn(&Player) + Send + 'static>(
864            this: *mut ffi::GstPlayer,
865            f: glib::ffi::gpointer,
866        ) {
867            let f: &F = &*(f as *const F);
868            f(&from_glib_borrow(this))
869        }
870        unsafe {
871            let f: Box_<F> = Box_::new(f);
872            connect_raw(
873                self.as_ptr() as *mut _,
874                c"end-of-stream".as_ptr() as *const _,
875                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
876                    end_of_stream_trampoline::<F> as *const (),
877                )),
878                Box_::into_raw(f),
879            )
880        }
881    }
882
883    #[doc(alias = "error")]
884    pub fn connect_error<F: Fn(&Self, &glib::Error) + Send + 'static>(
885        &self,
886        f: F,
887    ) -> SignalHandlerId {
888        unsafe extern "C" fn error_trampoline<F: Fn(&Player, &glib::Error) + Send + 'static>(
889            this: *mut ffi::GstPlayer,
890            object: *mut glib::ffi::GError,
891            f: glib::ffi::gpointer,
892        ) {
893            let f: &F = &*(f as *const F);
894            f(&from_glib_borrow(this), &from_glib_borrow(object))
895        }
896        unsafe {
897            let f: Box_<F> = Box_::new(f);
898            connect_raw(
899                self.as_ptr() as *mut _,
900                c"error".as_ptr() as *const _,
901                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
902                    error_trampoline::<F> as *const (),
903                )),
904                Box_::into_raw(f),
905            )
906        }
907    }
908
909    #[doc(alias = "media-info-updated")]
910    pub fn connect_media_info_updated<F: Fn(&Self, &PlayerMediaInfo) + Send + 'static>(
911        &self,
912        f: F,
913    ) -> SignalHandlerId {
914        unsafe extern "C" fn media_info_updated_trampoline<
915            F: Fn(&Player, &PlayerMediaInfo) + Send + 'static,
916        >(
917            this: *mut ffi::GstPlayer,
918            object: *mut ffi::GstPlayerMediaInfo,
919            f: glib::ffi::gpointer,
920        ) {
921            let f: &F = &*(f as *const F);
922            f(&from_glib_borrow(this), &from_glib_borrow(object))
923        }
924        unsafe {
925            let f: Box_<F> = Box_::new(f);
926            connect_raw(
927                self.as_ptr() as *mut _,
928                c"media-info-updated".as_ptr() as *const _,
929                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
930                    media_info_updated_trampoline::<F> as *const (),
931                )),
932                Box_::into_raw(f),
933            )
934        }
935    }
936
937    #[doc(alias = "mute-changed")]
938    pub fn connect_mute_changed<F: Fn(&Self) + Send + 'static>(&self, f: F) -> SignalHandlerId {
939        unsafe extern "C" fn mute_changed_trampoline<F: Fn(&Player) + Send + 'static>(
940            this: *mut ffi::GstPlayer,
941            f: glib::ffi::gpointer,
942        ) {
943            let f: &F = &*(f as *const F);
944            f(&from_glib_borrow(this))
945        }
946        unsafe {
947            let f: Box_<F> = Box_::new(f);
948            connect_raw(
949                self.as_ptr() as *mut _,
950                c"mute-changed".as_ptr() as *const _,
951                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
952                    mute_changed_trampoline::<F> as *const (),
953                )),
954                Box_::into_raw(f),
955            )
956        }
957    }
958
959    #[doc(alias = "state-changed")]
960    pub fn connect_state_changed<F: Fn(&Self, PlayerState) + Send + 'static>(
961        &self,
962        f: F,
963    ) -> SignalHandlerId {
964        unsafe extern "C" fn state_changed_trampoline<
965            F: Fn(&Player, PlayerState) + Send + 'static,
966        >(
967            this: *mut ffi::GstPlayer,
968            object: ffi::GstPlayerState,
969            f: glib::ffi::gpointer,
970        ) {
971            let f: &F = &*(f as *const F);
972            f(&from_glib_borrow(this), from_glib(object))
973        }
974        unsafe {
975            let f: Box_<F> = Box_::new(f);
976            connect_raw(
977                self.as_ptr() as *mut _,
978                c"state-changed".as_ptr() as *const _,
979                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
980                    state_changed_trampoline::<F> as *const (),
981                )),
982                Box_::into_raw(f),
983            )
984        }
985    }
986
987    #[doc(alias = "uri-loaded")]
988    pub fn connect_uri_loaded<F: Fn(&Self, &str) + Send + 'static>(&self, f: F) -> SignalHandlerId {
989        unsafe extern "C" fn uri_loaded_trampoline<F: Fn(&Player, &str) + Send + 'static>(
990            this: *mut ffi::GstPlayer,
991            object: *mut std::ffi::c_char,
992            f: glib::ffi::gpointer,
993        ) {
994            let f: &F = &*(f as *const F);
995            f(
996                &from_glib_borrow(this),
997                &glib::GString::from_glib_borrow(object),
998            )
999        }
1000        unsafe {
1001            let f: Box_<F> = Box_::new(f);
1002            connect_raw(
1003                self.as_ptr() as *mut _,
1004                c"uri-loaded".as_ptr() as *const _,
1005                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1006                    uri_loaded_trampoline::<F> as *const (),
1007                )),
1008                Box_::into_raw(f),
1009            )
1010        }
1011    }
1012
1013    #[doc(alias = "video-dimensions-changed")]
1014    pub fn connect_video_dimensions_changed<F: Fn(&Self, i32, i32) + Send + 'static>(
1015        &self,
1016        f: F,
1017    ) -> SignalHandlerId {
1018        unsafe extern "C" fn video_dimensions_changed_trampoline<
1019            F: Fn(&Player, i32, i32) + Send + 'static,
1020        >(
1021            this: *mut ffi::GstPlayer,
1022            object: std::ffi::c_int,
1023            p0: std::ffi::c_int,
1024            f: glib::ffi::gpointer,
1025        ) {
1026            let f: &F = &*(f as *const F);
1027            f(&from_glib_borrow(this), object, p0)
1028        }
1029        unsafe {
1030            let f: Box_<F> = Box_::new(f);
1031            connect_raw(
1032                self.as_ptr() as *mut _,
1033                c"video-dimensions-changed".as_ptr() as *const _,
1034                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1035                    video_dimensions_changed_trampoline::<F> as *const (),
1036                )),
1037                Box_::into_raw(f),
1038            )
1039        }
1040    }
1041
1042    #[doc(alias = "volume-changed")]
1043    pub fn connect_volume_changed<F: Fn(&Self) + Send + 'static>(&self, f: F) -> SignalHandlerId {
1044        unsafe extern "C" fn volume_changed_trampoline<F: Fn(&Player) + Send + 'static>(
1045            this: *mut ffi::GstPlayer,
1046            f: glib::ffi::gpointer,
1047        ) {
1048            let f: &F = &*(f as *const F);
1049            f(&from_glib_borrow(this))
1050        }
1051        unsafe {
1052            let f: Box_<F> = Box_::new(f);
1053            connect_raw(
1054                self.as_ptr() as *mut _,
1055                c"volume-changed".as_ptr() as *const _,
1056                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1057                    volume_changed_trampoline::<F> as *const (),
1058                )),
1059                Box_::into_raw(f),
1060            )
1061        }
1062    }
1063
1064    #[doc(alias = "warning")]
1065    pub fn connect_warning<F: Fn(&Self, &glib::Error) + Send + 'static>(
1066        &self,
1067        f: F,
1068    ) -> SignalHandlerId {
1069        unsafe extern "C" fn warning_trampoline<F: Fn(&Player, &glib::Error) + Send + 'static>(
1070            this: *mut ffi::GstPlayer,
1071            object: *mut glib::ffi::GError,
1072            f: glib::ffi::gpointer,
1073        ) {
1074            let f: &F = &*(f as *const F);
1075            f(&from_glib_borrow(this), &from_glib_borrow(object))
1076        }
1077        unsafe {
1078            let f: Box_<F> = Box_::new(f);
1079            connect_raw(
1080                self.as_ptr() as *mut _,
1081                c"warning".as_ptr() as *const _,
1082                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1083                    warning_trampoline::<F> as *const (),
1084                )),
1085                Box_::into_raw(f),
1086            )
1087        }
1088    }
1089
1090    #[doc(alias = "audio-video-offset")]
1091    pub fn connect_audio_video_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
1092        &self,
1093        f: F,
1094    ) -> SignalHandlerId {
1095        unsafe extern "C" fn notify_audio_video_offset_trampoline<
1096            F: Fn(&Player) + Send + Sync + 'static,
1097        >(
1098            this: *mut ffi::GstPlayer,
1099            _param_spec: glib::ffi::gpointer,
1100            f: glib::ffi::gpointer,
1101        ) {
1102            let f: &F = &*(f as *const F);
1103            f(&from_glib_borrow(this))
1104        }
1105        unsafe {
1106            let f: Box_<F> = Box_::new(f);
1107            connect_raw(
1108                self.as_ptr() as *mut _,
1109                c"notify::audio-video-offset".as_ptr() as *const _,
1110                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1111                    notify_audio_video_offset_trampoline::<F> as *const (),
1112                )),
1113                Box_::into_raw(f),
1114            )
1115        }
1116    }
1117
1118    #[doc(alias = "current-audio-track")]
1119    pub fn connect_current_audio_track_notify<F: Fn(&Self) + Send + Sync + 'static>(
1120        &self,
1121        f: F,
1122    ) -> SignalHandlerId {
1123        unsafe extern "C" fn notify_current_audio_track_trampoline<
1124            F: Fn(&Player) + Send + Sync + 'static,
1125        >(
1126            this: *mut ffi::GstPlayer,
1127            _param_spec: glib::ffi::gpointer,
1128            f: glib::ffi::gpointer,
1129        ) {
1130            let f: &F = &*(f as *const F);
1131            f(&from_glib_borrow(this))
1132        }
1133        unsafe {
1134            let f: Box_<F> = Box_::new(f);
1135            connect_raw(
1136                self.as_ptr() as *mut _,
1137                c"notify::current-audio-track".as_ptr() as *const _,
1138                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1139                    notify_current_audio_track_trampoline::<F> as *const (),
1140                )),
1141                Box_::into_raw(f),
1142            )
1143        }
1144    }
1145
1146    #[doc(alias = "current-subtitle-track")]
1147    pub fn connect_current_subtitle_track_notify<F: Fn(&Self) + Send + Sync + 'static>(
1148        &self,
1149        f: F,
1150    ) -> SignalHandlerId {
1151        unsafe extern "C" fn notify_current_subtitle_track_trampoline<
1152            F: Fn(&Player) + Send + Sync + 'static,
1153        >(
1154            this: *mut ffi::GstPlayer,
1155            _param_spec: glib::ffi::gpointer,
1156            f: glib::ffi::gpointer,
1157        ) {
1158            let f: &F = &*(f as *const F);
1159            f(&from_glib_borrow(this))
1160        }
1161        unsafe {
1162            let f: Box_<F> = Box_::new(f);
1163            connect_raw(
1164                self.as_ptr() as *mut _,
1165                c"notify::current-subtitle-track".as_ptr() as *const _,
1166                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1167                    notify_current_subtitle_track_trampoline::<F> as *const (),
1168                )),
1169                Box_::into_raw(f),
1170            )
1171        }
1172    }
1173
1174    #[doc(alias = "current-video-track")]
1175    pub fn connect_current_video_track_notify<F: Fn(&Self) + Send + Sync + 'static>(
1176        &self,
1177        f: F,
1178    ) -> SignalHandlerId {
1179        unsafe extern "C" fn notify_current_video_track_trampoline<
1180            F: Fn(&Player) + Send + Sync + 'static,
1181        >(
1182            this: *mut ffi::GstPlayer,
1183            _param_spec: glib::ffi::gpointer,
1184            f: glib::ffi::gpointer,
1185        ) {
1186            let f: &F = &*(f as *const F);
1187            f(&from_glib_borrow(this))
1188        }
1189        unsafe {
1190            let f: Box_<F> = Box_::new(f);
1191            connect_raw(
1192                self.as_ptr() as *mut _,
1193                c"notify::current-video-track".as_ptr() as *const _,
1194                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1195                    notify_current_video_track_trampoline::<F> as *const (),
1196                )),
1197                Box_::into_raw(f),
1198            )
1199        }
1200    }
1201
1202    #[doc(alias = "duration")]
1203    pub fn connect_duration_notify<F: Fn(&Self) + Send + Sync + 'static>(
1204        &self,
1205        f: F,
1206    ) -> SignalHandlerId {
1207        unsafe extern "C" fn notify_duration_trampoline<F: Fn(&Player) + Send + Sync + 'static>(
1208            this: *mut ffi::GstPlayer,
1209            _param_spec: glib::ffi::gpointer,
1210            f: glib::ffi::gpointer,
1211        ) {
1212            let f: &F = &*(f as *const F);
1213            f(&from_glib_borrow(this))
1214        }
1215        unsafe {
1216            let f: Box_<F> = Box_::new(f);
1217            connect_raw(
1218                self.as_ptr() as *mut _,
1219                c"notify::duration".as_ptr() as *const _,
1220                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1221                    notify_duration_trampoline::<F> as *const (),
1222                )),
1223                Box_::into_raw(f),
1224            )
1225        }
1226    }
1227
1228    #[doc(alias = "media-info")]
1229    pub fn connect_media_info_notify<F: Fn(&Self) + Send + Sync + 'static>(
1230        &self,
1231        f: F,
1232    ) -> SignalHandlerId {
1233        unsafe extern "C" fn notify_media_info_trampoline<
1234            F: Fn(&Player) + Send + Sync + 'static,
1235        >(
1236            this: *mut ffi::GstPlayer,
1237            _param_spec: glib::ffi::gpointer,
1238            f: glib::ffi::gpointer,
1239        ) {
1240            let f: &F = &*(f as *const F);
1241            f(&from_glib_borrow(this))
1242        }
1243        unsafe {
1244            let f: Box_<F> = Box_::new(f);
1245            connect_raw(
1246                self.as_ptr() as *mut _,
1247                c"notify::media-info".as_ptr() as *const _,
1248                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1249                    notify_media_info_trampoline::<F> as *const (),
1250                )),
1251                Box_::into_raw(f),
1252            )
1253        }
1254    }
1255
1256    #[doc(alias = "mute")]
1257    pub fn connect_mute_notify<F: Fn(&Self) + Send + Sync + 'static>(
1258        &self,
1259        f: F,
1260    ) -> SignalHandlerId {
1261        unsafe extern "C" fn notify_mute_trampoline<F: Fn(&Player) + Send + Sync + 'static>(
1262            this: *mut ffi::GstPlayer,
1263            _param_spec: glib::ffi::gpointer,
1264            f: glib::ffi::gpointer,
1265        ) {
1266            let f: &F = &*(f as *const F);
1267            f(&from_glib_borrow(this))
1268        }
1269        unsafe {
1270            let f: Box_<F> = Box_::new(f);
1271            connect_raw(
1272                self.as_ptr() as *mut _,
1273                c"notify::mute".as_ptr() as *const _,
1274                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1275                    notify_mute_trampoline::<F> as *const (),
1276                )),
1277                Box_::into_raw(f),
1278            )
1279        }
1280    }
1281
1282    #[doc(alias = "pipeline")]
1283    pub fn connect_pipeline_notify<F: Fn(&Self) + Send + Sync + 'static>(
1284        &self,
1285        f: F,
1286    ) -> SignalHandlerId {
1287        unsafe extern "C" fn notify_pipeline_trampoline<F: Fn(&Player) + Send + Sync + 'static>(
1288            this: *mut ffi::GstPlayer,
1289            _param_spec: glib::ffi::gpointer,
1290            f: glib::ffi::gpointer,
1291        ) {
1292            let f: &F = &*(f as *const F);
1293            f(&from_glib_borrow(this))
1294        }
1295        unsafe {
1296            let f: Box_<F> = Box_::new(f);
1297            connect_raw(
1298                self.as_ptr() as *mut _,
1299                c"notify::pipeline".as_ptr() as *const _,
1300                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1301                    notify_pipeline_trampoline::<F> as *const (),
1302                )),
1303                Box_::into_raw(f),
1304            )
1305        }
1306    }
1307
1308    #[doc(alias = "position")]
1309    pub fn connect_position_notify<F: Fn(&Self) + Send + Sync + 'static>(
1310        &self,
1311        f: F,
1312    ) -> SignalHandlerId {
1313        unsafe extern "C" fn notify_position_trampoline<F: Fn(&Player) + Send + Sync + 'static>(
1314            this: *mut ffi::GstPlayer,
1315            _param_spec: glib::ffi::gpointer,
1316            f: glib::ffi::gpointer,
1317        ) {
1318            let f: &F = &*(f as *const F);
1319            f(&from_glib_borrow(this))
1320        }
1321        unsafe {
1322            let f: Box_<F> = Box_::new(f);
1323            connect_raw(
1324                self.as_ptr() as *mut _,
1325                c"notify::position".as_ptr() as *const _,
1326                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1327                    notify_position_trampoline::<F> as *const (),
1328                )),
1329                Box_::into_raw(f),
1330            )
1331        }
1332    }
1333
1334    #[doc(alias = "rate")]
1335    pub fn connect_rate_notify<F: Fn(&Self) + Send + Sync + 'static>(
1336        &self,
1337        f: F,
1338    ) -> SignalHandlerId {
1339        unsafe extern "C" fn notify_rate_trampoline<F: Fn(&Player) + Send + Sync + 'static>(
1340            this: *mut ffi::GstPlayer,
1341            _param_spec: glib::ffi::gpointer,
1342            f: glib::ffi::gpointer,
1343        ) {
1344            let f: &F = &*(f as *const F);
1345            f(&from_glib_borrow(this))
1346        }
1347        unsafe {
1348            let f: Box_<F> = Box_::new(f);
1349            connect_raw(
1350                self.as_ptr() as *mut _,
1351                c"notify::rate".as_ptr() as *const _,
1352                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1353                    notify_rate_trampoline::<F> as *const (),
1354                )),
1355                Box_::into_raw(f),
1356            )
1357        }
1358    }
1359
1360    #[cfg(feature = "v1_16")]
1361    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
1362    #[doc(alias = "subtitle-video-offset")]
1363    pub fn connect_subtitle_video_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
1364        &self,
1365        f: F,
1366    ) -> SignalHandlerId {
1367        unsafe extern "C" fn notify_subtitle_video_offset_trampoline<
1368            F: Fn(&Player) + Send + Sync + 'static,
1369        >(
1370            this: *mut ffi::GstPlayer,
1371            _param_spec: glib::ffi::gpointer,
1372            f: glib::ffi::gpointer,
1373        ) {
1374            let f: &F = &*(f as *const F);
1375            f(&from_glib_borrow(this))
1376        }
1377        unsafe {
1378            let f: Box_<F> = Box_::new(f);
1379            connect_raw(
1380                self.as_ptr() as *mut _,
1381                c"notify::subtitle-video-offset".as_ptr() as *const _,
1382                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1383                    notify_subtitle_video_offset_trampoline::<F> as *const (),
1384                )),
1385                Box_::into_raw(f),
1386            )
1387        }
1388    }
1389
1390    #[doc(alias = "suburi")]
1391    pub fn connect_suburi_notify<F: Fn(&Self) + Send + Sync + 'static>(
1392        &self,
1393        f: F,
1394    ) -> SignalHandlerId {
1395        unsafe extern "C" fn notify_suburi_trampoline<F: Fn(&Player) + Send + Sync + 'static>(
1396            this: *mut ffi::GstPlayer,
1397            _param_spec: glib::ffi::gpointer,
1398            f: glib::ffi::gpointer,
1399        ) {
1400            let f: &F = &*(f as *const F);
1401            f(&from_glib_borrow(this))
1402        }
1403        unsafe {
1404            let f: Box_<F> = Box_::new(f);
1405            connect_raw(
1406                self.as_ptr() as *mut _,
1407                c"notify::suburi".as_ptr() as *const _,
1408                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1409                    notify_suburi_trampoline::<F> as *const (),
1410                )),
1411                Box_::into_raw(f),
1412            )
1413        }
1414    }
1415
1416    #[doc(alias = "uri")]
1417    pub fn connect_uri_notify<F: Fn(&Self) + Send + Sync + 'static>(
1418        &self,
1419        f: F,
1420    ) -> SignalHandlerId {
1421        unsafe extern "C" fn notify_uri_trampoline<F: Fn(&Player) + Send + Sync + 'static>(
1422            this: *mut ffi::GstPlayer,
1423            _param_spec: glib::ffi::gpointer,
1424            f: glib::ffi::gpointer,
1425        ) {
1426            let f: &F = &*(f as *const F);
1427            f(&from_glib_borrow(this))
1428        }
1429        unsafe {
1430            let f: Box_<F> = Box_::new(f);
1431            connect_raw(
1432                self.as_ptr() as *mut _,
1433                c"notify::uri".as_ptr() as *const _,
1434                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1435                    notify_uri_trampoline::<F> as *const (),
1436                )),
1437                Box_::into_raw(f),
1438            )
1439        }
1440    }
1441
1442    #[doc(alias = "video-multiview-flags")]
1443    pub fn connect_video_multiview_flags_notify<F: Fn(&Self) + Send + Sync + 'static>(
1444        &self,
1445        f: F,
1446    ) -> SignalHandlerId {
1447        unsafe extern "C" fn notify_video_multiview_flags_trampoline<
1448            F: Fn(&Player) + Send + Sync + 'static,
1449        >(
1450            this: *mut ffi::GstPlayer,
1451            _param_spec: glib::ffi::gpointer,
1452            f: glib::ffi::gpointer,
1453        ) {
1454            let f: &F = &*(f as *const F);
1455            f(&from_glib_borrow(this))
1456        }
1457        unsafe {
1458            let f: Box_<F> = Box_::new(f);
1459            connect_raw(
1460                self.as_ptr() as *mut _,
1461                c"notify::video-multiview-flags".as_ptr() as *const _,
1462                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1463                    notify_video_multiview_flags_trampoline::<F> as *const (),
1464                )),
1465                Box_::into_raw(f),
1466            )
1467        }
1468    }
1469
1470    #[doc(alias = "video-multiview-mode")]
1471    pub fn connect_video_multiview_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
1472        &self,
1473        f: F,
1474    ) -> SignalHandlerId {
1475        unsafe extern "C" fn notify_video_multiview_mode_trampoline<
1476            F: Fn(&Player) + Send + Sync + 'static,
1477        >(
1478            this: *mut ffi::GstPlayer,
1479            _param_spec: glib::ffi::gpointer,
1480            f: glib::ffi::gpointer,
1481        ) {
1482            let f: &F = &*(f as *const F);
1483            f(&from_glib_borrow(this))
1484        }
1485        unsafe {
1486            let f: Box_<F> = Box_::new(f);
1487            connect_raw(
1488                self.as_ptr() as *mut _,
1489                c"notify::video-multiview-mode".as_ptr() as *const _,
1490                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1491                    notify_video_multiview_mode_trampoline::<F> as *const (),
1492                )),
1493                Box_::into_raw(f),
1494            )
1495        }
1496    }
1497
1498    #[doc(alias = "volume")]
1499    pub fn connect_volume_notify<F: Fn(&Self) + Send + Sync + 'static>(
1500        &self,
1501        f: F,
1502    ) -> SignalHandlerId {
1503        unsafe extern "C" fn notify_volume_trampoline<F: Fn(&Player) + Send + Sync + 'static>(
1504            this: *mut ffi::GstPlayer,
1505            _param_spec: glib::ffi::gpointer,
1506            f: glib::ffi::gpointer,
1507        ) {
1508            let f: &F = &*(f as *const F);
1509            f(&from_glib_borrow(this))
1510        }
1511        unsafe {
1512            let f: Box_<F> = Box_::new(f);
1513            connect_raw(
1514                self.as_ptr() as *mut _,
1515                c"notify::volume".as_ptr() as *const _,
1516                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1517                    notify_volume_trampoline::<F> as *const (),
1518                )),
1519                Box_::into_raw(f),
1520            )
1521        }
1522    }
1523}
1524
1525unsafe impl Send for Player {}
1526unsafe impl Sync for Player {}