gstreamer_play/auto/play_stream_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#![allow(deprecated)]
6
7use crate::ffi;
8use glib::{prelude::*, translate::*};
9
10glib::wrapper! {
11 /// Base structure for information concerning a media stream. Depending on
12 /// the stream type, one can find more media-specific information in
13 /// [`PlayVideoInfo`][crate::PlayVideoInfo], [`PlayAudioInfo`][crate::PlayAudioInfo], [`PlaySubtitleInfo`][crate::PlaySubtitleInfo].
14 ///
15 /// This is an Abstract Base Class, you cannot instantiate it.
16 ///
17 /// # Implements
18 ///
19 /// [`PlayStreamInfoExt`][trait@crate::prelude::PlayStreamInfoExt], [`trait@glib::ObjectExt`]
20 #[doc(alias = "GstPlayStreamInfo")]
21 pub struct PlayStreamInfo(Object<ffi::GstPlayStreamInfo, ffi::GstPlayStreamInfoClass>);
22
23 match fn {
24 type_ => || ffi::gst_play_stream_info_get_type(),
25 }
26}
27
28impl PlayStreamInfo {
29 pub const NONE: Option<&'static PlayStreamInfo> = None;
30}
31
32unsafe impl Send for PlayStreamInfo {}
33unsafe impl Sync for PlayStreamInfo {}
34
35/// Trait containing all [`struct@PlayStreamInfo`] methods.
36///
37/// # Implementors
38///
39/// [`PlayAudioInfo`][struct@crate::PlayAudioInfo], [`PlayStreamInfo`][struct@crate::PlayStreamInfo], [`PlaySubtitleInfo`][struct@crate::PlaySubtitleInfo], [`PlayVideoInfo`][struct@crate::PlayVideoInfo]
40pub trait PlayStreamInfoExt: IsA<PlayStreamInfo> + 'static {
41 ///
42 /// # Returns
43 ///
44 /// the [`gst::Caps`][crate::gst::Caps] of the stream or [`None`] if
45 /// unknown.
46 #[doc(alias = "gst_play_stream_info_get_caps")]
47 #[doc(alias = "get_caps")]
48 fn caps(&self) -> Option<gst::Caps> {
49 unsafe {
50 from_glib_none(ffi::gst_play_stream_info_get_caps(const_override(
51 self.as_ref().to_glib_none().0,
52 )))
53 }
54 }
55
56 /// A string describing codec used in [`PlayStreamInfo`][crate::PlayStreamInfo].
57 ///
58 /// # Returns
59 ///
60 /// codec string or [`None`] on unknown.
61 #[doc(alias = "gst_play_stream_info_get_codec")]
62 #[doc(alias = "get_codec")]
63 fn codec(&self) -> Option<glib::GString> {
64 unsafe {
65 from_glib_none(ffi::gst_play_stream_info_get_codec(const_override(
66 self.as_ref().to_glib_none().0,
67 )))
68 }
69 }
70
71 /// Function to get stream index from [`PlayStreamInfo`][crate::PlayStreamInfo] instance or -1 if
72 /// unknown.
73 ///
74 /// # Deprecated since 1.26
75 ///
76 /// Use [`stream_id()`][Self::stream_id()].
77 ///
78 /// # Returns
79 ///
80 /// the stream index of this stream.
81 #[cfg_attr(feature = "v1_26", deprecated = "Since 1.26")]
82 #[allow(deprecated)]
83 #[doc(alias = "gst_play_stream_info_get_index")]
84 #[doc(alias = "get_index")]
85 fn index(&self) -> i32 {
86 unsafe {
87 ffi::gst_play_stream_info_get_index(const_override(self.as_ref().to_glib_none().0))
88 }
89 }
90
91 /// A string stream id identifying this [`PlayStreamInfo`][crate::PlayStreamInfo].
92 ///
93 /// # Returns
94 ///
95 /// stream id string.
96 #[cfg(feature = "v1_26")]
97 #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
98 #[doc(alias = "gst_play_stream_info_get_stream_id")]
99 #[doc(alias = "get_stream_id")]
100 fn stream_id(&self) -> glib::GString {
101 unsafe {
102 from_glib_none(ffi::gst_play_stream_info_get_stream_id(const_override(
103 self.as_ref().to_glib_none().0,
104 )))
105 }
106 }
107
108 /// Function to return human readable name for the stream type
109 /// of the given `self` (ex: "audio", "video", "subtitle")
110 ///
111 /// # Returns
112 ///
113 /// a human readable name
114 #[doc(alias = "gst_play_stream_info_get_stream_type")]
115 #[doc(alias = "get_stream_type")]
116 fn stream_type(&self) -> glib::GString {
117 unsafe {
118 from_glib_none(ffi::gst_play_stream_info_get_stream_type(const_override(
119 self.as_ref().to_glib_none().0,
120 )))
121 }
122 }
123
124 ///
125 /// # Returns
126 ///
127 /// the tags contained in this stream.
128 #[doc(alias = "gst_play_stream_info_get_tags")]
129 #[doc(alias = "get_tags")]
130 fn tags(&self) -> Option<gst::TagList> {
131 unsafe {
132 from_glib_none(ffi::gst_play_stream_info_get_tags(const_override(
133 self.as_ref().to_glib_none().0,
134 )))
135 }
136 }
137}
138
139impl<O: IsA<PlayStreamInfo>> PlayStreamInfoExt for O {}