gstreamer_pbutils/auto/discoverer_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
6use crate::ffi;
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10 /// Base structure for information concerning a media stream. Depending on the
11 /// stream type, one can find more media-specific information in
12 /// [`DiscovererAudioInfo`][crate::DiscovererAudioInfo], [`DiscovererVideoInfo`][crate::DiscovererVideoInfo], and
13 /// [`DiscovererContainerInfo`][crate::DiscovererContainerInfo].
14 ///
15 /// The [`DiscovererStreamInfo`][crate::DiscovererStreamInfo] represents the topology of the stream. Siblings
16 /// can be iterated over with [`DiscovererStreamInfoExt::next()`][crate::prelude::DiscovererStreamInfoExt::next()] and
17 /// [`DiscovererStreamInfoExt::previous()`][crate::prelude::DiscovererStreamInfoExt::previous()]. Children (sub-streams) of a
18 /// stream can be accessed using the [`DiscovererContainerInfo`][crate::DiscovererContainerInfo] API.
19 ///
20 /// As a simple example, if you run [`Discoverer`][crate::Discoverer] on an AVI file with one audio
21 /// and one video stream, you will get a [`DiscovererContainerInfo`][crate::DiscovererContainerInfo]
22 /// corresponding to the AVI container, which in turn will have a
23 /// [`DiscovererAudioInfo`][crate::DiscovererAudioInfo] sub-stream and a [`DiscovererVideoInfo`][crate::DiscovererVideoInfo] sub-stream
24 /// for the audio and video streams respectively.
25 ///
26 /// # Implements
27 ///
28 /// [`DiscovererStreamInfoExt`][trait@crate::prelude::DiscovererStreamInfoExt], [`trait@glib::ObjectExt`]
29 #[doc(alias = "GstDiscovererStreamInfo")]
30 pub struct DiscovererStreamInfo(Object<ffi::GstDiscovererStreamInfo>);
31
32 match fn {
33 type_ => || ffi::gst_discoverer_stream_info_get_type(),
34 }
35}
36
37impl DiscovererStreamInfo {
38 pub const NONE: Option<&'static DiscovererStreamInfo> = None;
39}
40
41unsafe impl Send for DiscovererStreamInfo {}
42unsafe impl Sync for DiscovererStreamInfo {}
43
44/// Trait containing all [`struct@DiscovererStreamInfo`] methods.
45///
46/// # Implementors
47///
48/// [`DiscovererAudioInfo`][struct@crate::DiscovererAudioInfo], [`DiscovererContainerInfo`][struct@crate::DiscovererContainerInfo], [`DiscovererStreamInfo`][struct@crate::DiscovererStreamInfo], [`DiscovererSubtitleInfo`][struct@crate::DiscovererSubtitleInfo], [`DiscovererVideoInfo`][struct@crate::DiscovererVideoInfo]
49pub trait DiscovererStreamInfoExt: IsA<DiscovererStreamInfo> + 'static {
50 ///
51 /// # Returns
52 ///
53 /// the [`gst::Caps`][crate::gst::Caps] of the stream. Unref with
54 /// `gst_caps_unref` after usage.
55 #[doc(alias = "gst_discoverer_stream_info_get_caps")]
56 #[doc(alias = "get_caps")]
57 fn caps(&self) -> Option<gst::Caps> {
58 unsafe {
59 from_glib_full(ffi::gst_discoverer_stream_info_get_caps(
60 self.as_ref().to_glib_none().0,
61 ))
62 }
63 }
64
65 ///
66 /// # Deprecated
67 ///
68 /// This functions is deprecated since version 1.4, use
69 /// `gst_discoverer_info_get_missing_elements_installer_details`
70 ///
71 /// # Returns
72 ///
73 /// additional information regarding the stream (for
74 /// example codec version, profile, etc..). If you wish to use the [`gst::Structure`][crate::gst::Structure]
75 /// after the life-time of `self` you will need to copy it.
76 #[doc(alias = "gst_discoverer_stream_info_get_misc")]
77 #[doc(alias = "get_misc")]
78 fn misc(&self) -> Option<gst::Structure> {
79 unsafe {
80 from_glib_none(ffi::gst_discoverer_stream_info_get_misc(
81 self.as_ref().to_glib_none().0,
82 ))
83 }
84 }
85
86 ///
87 /// # Returns
88 ///
89 /// the next [`DiscovererStreamInfo`][crate::DiscovererStreamInfo] in a chain. [`None`]
90 /// for final streams.
91 /// Unref with `gst_discoverer_stream_info_unref` after usage.
92 #[doc(alias = "gst_discoverer_stream_info_get_next")]
93 #[doc(alias = "get_next")]
94 #[must_use]
95 fn next(&self) -> Option<DiscovererStreamInfo> {
96 unsafe {
97 from_glib_full(ffi::gst_discoverer_stream_info_get_next(
98 self.as_ref().to_glib_none().0,
99 ))
100 }
101 }
102
103 ///
104 /// # Returns
105 ///
106 /// the previous [`DiscovererStreamInfo`][crate::DiscovererStreamInfo] in a chain.
107 /// [`None`] for starting points. Unref with `gst_discoverer_stream_info_unref`
108 /// after usage.
109 #[doc(alias = "gst_discoverer_stream_info_get_previous")]
110 #[doc(alias = "get_previous")]
111 #[must_use]
112 fn previous(&self) -> Option<DiscovererStreamInfo> {
113 unsafe {
114 from_glib_full(ffi::gst_discoverer_stream_info_get_previous(
115 self.as_ref().to_glib_none().0,
116 ))
117 }
118 }
119
120 ///
121 /// # Returns
122 ///
123 /// the stream ID of this stream. If you wish to
124 /// use the stream ID after the life-time of `self` you will need to copy it.
125 #[doc(alias = "gst_discoverer_stream_info_get_stream_id")]
126 #[doc(alias = "get_stream_id")]
127 fn stream_id(&self) -> Option<glib::GString> {
128 unsafe {
129 from_glib_none(ffi::gst_discoverer_stream_info_get_stream_id(
130 self.as_ref().to_glib_none().0,
131 ))
132 }
133 }
134
135 ///
136 /// # Returns
137 ///
138 /// the stream number, -1 if no index could be determined. This property
139 /// acts as a unique identifier as a 'int' for the stream.
140 #[cfg(feature = "v1_20")]
141 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
142 #[doc(alias = "gst_discoverer_stream_info_get_stream_number")]
143 #[doc(alias = "get_stream_number")]
144 fn stream_number(&self) -> i32 {
145 unsafe { ffi::gst_discoverer_stream_info_get_stream_number(self.as_ref().to_glib_none().0) }
146 }
147
148 ///
149 /// # Returns
150 ///
151 /// a human readable name for the stream type of the given `self` (ex : "audio",
152 /// "container",...).
153 #[doc(alias = "gst_discoverer_stream_info_get_stream_type_nick")]
154 #[doc(alias = "get_stream_type_nick")]
155 fn stream_type_nick(&self) -> glib::GString {
156 unsafe {
157 from_glib_none(ffi::gst_discoverer_stream_info_get_stream_type_nick(
158 self.as_ref().to_glib_none().0,
159 ))
160 }
161 }
162
163 ///
164 /// # Returns
165 ///
166 /// the tags contained in this stream. If you wish to
167 /// use the tags after the life-time of `self` you will need to copy them.
168 #[doc(alias = "gst_discoverer_stream_info_get_tags")]
169 #[doc(alias = "get_tags")]
170 fn tags(&self) -> Option<gst::TagList> {
171 unsafe {
172 from_glib_none(ffi::gst_discoverer_stream_info_get_tags(
173 self.as_ref().to_glib_none().0,
174 ))
175 }
176 }
177
178 ///
179 /// # Returns
180 ///
181 /// the TOC contained in this stream. If you wish to
182 /// use the TOC after the life-time of `self` you will need to copy it.
183 #[doc(alias = "gst_discoverer_stream_info_get_toc")]
184 #[doc(alias = "get_toc")]
185 fn toc(&self) -> Option<gst::Toc> {
186 unsafe {
187 from_glib_none(ffi::gst_discoverer_stream_info_get_toc(
188 self.as_ref().to_glib_none().0,
189 ))
190 }
191 }
192}
193
194impl<O: IsA<DiscovererStreamInfo>> DiscovererStreamInfoExt for O {}