gstreamer_play/auto/
play_video_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 video streams.
11    ///
12    /// # Implements
13    ///
14    /// [`PlayStreamInfoExt`][trait@crate::prelude::PlayStreamInfoExt], [`trait@glib::ObjectExt`]
15    #[doc(alias = "GstPlayVideoInfo")]
16    pub struct PlayVideoInfo(Object<ffi::GstPlayVideoInfo, ffi::GstPlayVideoInfoClass>) @extends PlayStreamInfo;
17
18    match fn {
19        type_ => || ffi::gst_play_video_info_get_type(),
20    }
21}
22
23impl PlayVideoInfo {
24    ///
25    /// # Returns
26    ///
27    /// the current bitrate of video in [`PlayVideoInfo`][crate::PlayVideoInfo] or -1 if unknown.
28    #[doc(alias = "gst_play_video_info_get_bitrate")]
29    #[doc(alias = "get_bitrate")]
30    pub fn bitrate(&self) -> i32 {
31        unsafe { ffi::gst_play_video_info_get_bitrate(self.to_glib_none().0) }
32    }
33
34    ///
35    /// # Returns
36    ///
37    /// the height of video in [`PlayVideoInfo`][crate::PlayVideoInfo] or -1 if unknown.
38    #[doc(alias = "gst_play_video_info_get_height")]
39    #[doc(alias = "get_height")]
40    pub fn height(&self) -> i32 {
41        unsafe { ffi::gst_play_video_info_get_height(self.to_glib_none().0) }
42    }
43
44    ///
45    /// # Returns
46    ///
47    /// the maximum bitrate of video in [`PlayVideoInfo`][crate::PlayVideoInfo] or -1 if unknown.
48    #[doc(alias = "gst_play_video_info_get_max_bitrate")]
49    #[doc(alias = "get_max_bitrate")]
50    pub fn max_bitrate(&self) -> i32 {
51        unsafe { ffi::gst_play_video_info_get_max_bitrate(self.to_glib_none().0) }
52    }
53
54    ///
55    /// # Returns
56    ///
57    /// the width of video in [`PlayVideoInfo`][crate::PlayVideoInfo] or -1 if unknown.
58    #[doc(alias = "gst_play_video_info_get_width")]
59    #[doc(alias = "get_width")]
60    pub fn width(&self) -> i32 {
61        unsafe { ffi::gst_play_video_info_get_width(self.to_glib_none().0) }
62    }
63}
64
65unsafe impl Send for PlayVideoInfo {}
66unsafe impl Sync for PlayVideoInfo {}