gstreamer_player/auto/
player_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, PlayerStreamInfo};
7use glib::translate::*;
8
9glib::wrapper! {
10    /// [`PlayerStreamInfo`][crate::PlayerStreamInfo] specific to video streams.
11    ///
12    /// # Implements
13    ///
14    /// [`PlayerStreamInfoExt`][trait@crate::prelude::PlayerStreamInfoExt], [`trait@glib::ObjectExt`]
15    #[doc(alias = "GstPlayerVideoInfo")]
16    pub struct PlayerVideoInfo(Object<ffi::GstPlayerVideoInfo, ffi::GstPlayerVideoInfoClass>) @extends PlayerStreamInfo;
17
18    match fn {
19        type_ => || ffi::gst_player_video_info_get_type(),
20    }
21}
22
23impl PlayerVideoInfo {
24    ///
25    /// # Returns
26    ///
27    /// the current bitrate of video in [`PlayerVideoInfo`][crate::PlayerVideoInfo] or -1 if
28    /// unknown.
29    #[doc(alias = "gst_player_video_info_get_bitrate")]
30    #[doc(alias = "get_bitrate")]
31    pub fn bitrate(&self) -> i32 {
32        unsafe { ffi::gst_player_video_info_get_bitrate(self.to_glib_none().0) }
33    }
34
35    ///
36    /// # Returns
37    ///
38    /// the height of video in [`PlayerVideoInfo`][crate::PlayerVideoInfo] or -1 if unknown.
39    #[doc(alias = "gst_player_video_info_get_height")]
40    #[doc(alias = "get_height")]
41    pub fn height(&self) -> i32 {
42        unsafe { ffi::gst_player_video_info_get_height(self.to_glib_none().0) }
43    }
44
45    ///
46    /// # Returns
47    ///
48    /// the maximum bitrate of video in [`PlayerVideoInfo`][crate::PlayerVideoInfo] or -1 if
49    /// unknown.
50    #[doc(alias = "gst_player_video_info_get_max_bitrate")]
51    #[doc(alias = "get_max_bitrate")]
52    pub fn max_bitrate(&self) -> i32 {
53        unsafe { ffi::gst_player_video_info_get_max_bitrate(self.to_glib_none().0) }
54    }
55
56    ///
57    /// # Returns
58    ///
59    /// the width of video in [`PlayerVideoInfo`][crate::PlayerVideoInfo] or -1 if unknown.
60    #[doc(alias = "gst_player_video_info_get_width")]
61    #[doc(alias = "get_width")]
62    pub fn width(&self) -> i32 {
63        unsafe { ffi::gst_player_video_info_get_width(self.to_glib_none().0) }
64    }
65}
66
67unsafe impl Send for PlayerVideoInfo {}
68unsafe impl Sync for PlayerVideoInfo {}