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