gstreamer_player/auto/
player_audio_info.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::{ffi, PlayerStreamInfo};
7use glib::translate::*;
8
9glib::wrapper! {
10    /// [`PlayerStreamInfo`][crate::PlayerStreamInfo] specific to audio streams.
11    ///
12    /// # Implements
13    ///
14    /// [`PlayerStreamInfoExt`][trait@crate::prelude::PlayerStreamInfoExt], [`trait@glib::ObjectExt`]
15    #[doc(alias = "GstPlayerAudioInfo")]
16    pub struct PlayerAudioInfo(Object<ffi::GstPlayerAudioInfo, ffi::GstPlayerAudioInfoClass>) @extends PlayerStreamInfo;
17
18    match fn {
19        type_ => || ffi::gst_player_audio_info_get_type(),
20    }
21}
22
23impl PlayerAudioInfo {
24    ///
25    /// # Returns
26    ///
27    /// the audio bitrate in [`PlayerAudioInfo`][crate::PlayerAudioInfo] or -1 if unknown.
28    #[doc(alias = "gst_player_audio_info_get_bitrate")]
29    #[doc(alias = "get_bitrate")]
30    pub fn bitrate(&self) -> i32 {
31        unsafe { ffi::gst_player_audio_info_get_bitrate(self.to_glib_none().0) }
32    }
33
34    ///
35    /// # Returns
36    ///
37    /// the number of audio channels in [`PlayerAudioInfo`][crate::PlayerAudioInfo] or 0 if
38    /// unknown.
39    #[doc(alias = "gst_player_audio_info_get_channels")]
40    #[doc(alias = "get_channels")]
41    pub fn channels(&self) -> i32 {
42        unsafe { ffi::gst_player_audio_info_get_channels(self.to_glib_none().0) }
43    }
44
45    ///
46    /// # Returns
47    ///
48    /// the language of the stream, or NULL if unknown.
49    #[doc(alias = "gst_player_audio_info_get_language")]
50    #[doc(alias = "get_language")]
51    pub fn language(&self) -> Option<glib::GString> {
52        unsafe {
53            from_glib_none(ffi::gst_player_audio_info_get_language(
54                self.to_glib_none().0,
55            ))
56        }
57    }
58
59    ///
60    /// # Returns
61    ///
62    /// the audio maximum bitrate in [`PlayerAudioInfo`][crate::PlayerAudioInfo] or -1 if unknown.
63    #[doc(alias = "gst_player_audio_info_get_max_bitrate")]
64    #[doc(alias = "get_max_bitrate")]
65    pub fn max_bitrate(&self) -> i32 {
66        unsafe { ffi::gst_player_audio_info_get_max_bitrate(self.to_glib_none().0) }
67    }
68
69    ///
70    /// # Returns
71    ///
72    /// the audio sample rate in [`PlayerAudioInfo`][crate::PlayerAudioInfo] or 0 if unknown.
73    #[doc(alias = "gst_player_audio_info_get_sample_rate")]
74    #[doc(alias = "get_sample_rate")]
75    pub fn sample_rate(&self) -> i32 {
76        unsafe { ffi::gst_player_audio_info_get_sample_rate(self.to_glib_none().0) }
77    }
78}
79
80unsafe impl Send for PlayerAudioInfo {}
81unsafe impl Sync for PlayerAudioInfo {}