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
44mod sealed {
45 pub trait Sealed {}
46 impl<T: super::IsA<super::DiscovererStreamInfo>> Sealed for T {}
47}
48
49/// Trait containing all [`struct@DiscovererStreamInfo`] methods.
50///
51/// # Implementors
52///
53/// [`DiscovererAudioInfo`][struct@crate::DiscovererAudioInfo], [`DiscovererContainerInfo`][struct@crate::DiscovererContainerInfo], [`DiscovererStreamInfo`][struct@crate::DiscovererStreamInfo], [`DiscovererSubtitleInfo`][struct@crate::DiscovererSubtitleInfo], [`DiscovererVideoInfo`][struct@crate::DiscovererVideoInfo]
54pub trait DiscovererStreamInfoExt: IsA<DiscovererStreamInfo> + sealed::Sealed + 'static {
55 ///
56 /// # Returns
57 ///
58 /// the [`gst::Caps`][crate::gst::Caps] of the stream. Unref with
59 /// `gst_caps_unref` after usage.
60 #[doc(alias = "gst_discoverer_stream_info_get_caps")]
61 #[doc(alias = "get_caps")]
62 fn caps(&self) -> Option<gst::Caps> {
63 unsafe {
64 from_glib_full(ffi::gst_discoverer_stream_info_get_caps(
65 self.as_ref().to_glib_none().0,
66 ))
67 }
68 }
69
70 ///
71 /// # Deprecated
72 ///
73 /// This functions is deprecated since version 1.4, use
74 /// `gst_discoverer_info_get_missing_elements_installer_details`
75 ///
76 /// # Returns
77 ///
78 /// additional information regarding the stream (for
79 /// example codec version, profile, etc..). If you wish to use the [`gst::Structure`][crate::gst::Structure]
80 /// after the life-time of `self` you will need to copy it.
81 #[doc(alias = "gst_discoverer_stream_info_get_misc")]
82 #[doc(alias = "get_misc")]
83 fn misc(&self) -> Option<gst::Structure> {
84 unsafe {
85 from_glib_none(ffi::gst_discoverer_stream_info_get_misc(
86 self.as_ref().to_glib_none().0,
87 ))
88 }
89 }
90
91 ///
92 /// # Returns
93 ///
94 /// the next [`DiscovererStreamInfo`][crate::DiscovererStreamInfo] in a chain. [`None`]
95 /// for final streams.
96 /// Unref with `gst_discoverer_stream_info_unref` after usage.
97 #[doc(alias = "gst_discoverer_stream_info_get_next")]
98 #[doc(alias = "get_next")]
99 #[must_use]
100 fn next(&self) -> Option<DiscovererStreamInfo> {
101 unsafe {
102 from_glib_full(ffi::gst_discoverer_stream_info_get_next(
103 self.as_ref().to_glib_none().0,
104 ))
105 }
106 }
107
108 ///
109 /// # Returns
110 ///
111 /// the previous [`DiscovererStreamInfo`][crate::DiscovererStreamInfo] in a chain.
112 /// [`None`] for starting points. Unref with `gst_discoverer_stream_info_unref`
113 /// after usage.
114 #[doc(alias = "gst_discoverer_stream_info_get_previous")]
115 #[doc(alias = "get_previous")]
116 #[must_use]
117 fn previous(&self) -> Option<DiscovererStreamInfo> {
118 unsafe {
119 from_glib_full(ffi::gst_discoverer_stream_info_get_previous(
120 self.as_ref().to_glib_none().0,
121 ))
122 }
123 }
124
125 ///
126 /// # Returns
127 ///
128 /// the stream ID of this stream. If you wish to
129 /// use the stream ID after the life-time of `self` you will need to copy it.
130 #[doc(alias = "gst_discoverer_stream_info_get_stream_id")]
131 #[doc(alias = "get_stream_id")]
132 fn stream_id(&self) -> Option<glib::GString> {
133 unsafe {
134 from_glib_none(ffi::gst_discoverer_stream_info_get_stream_id(
135 self.as_ref().to_glib_none().0,
136 ))
137 }
138 }
139
140 ///
141 /// # Returns
142 ///
143 /// the stream number, -1 if no index could be determined. This property
144 /// acts as a unique identifier as a 'int' for the stream.
145 #[cfg(feature = "v1_20")]
146 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
147 #[doc(alias = "gst_discoverer_stream_info_get_stream_number")]
148 #[doc(alias = "get_stream_number")]
149 fn stream_number(&self) -> i32 {
150 unsafe { ffi::gst_discoverer_stream_info_get_stream_number(self.as_ref().to_glib_none().0) }
151 }
152
153 ///
154 /// # Returns
155 ///
156 /// a human readable name for the stream type of the given `self` (ex : "audio",
157 /// "container",...).
158 #[doc(alias = "gst_discoverer_stream_info_get_stream_type_nick")]
159 #[doc(alias = "get_stream_type_nick")]
160 fn stream_type_nick(&self) -> glib::GString {
161 unsafe {
162 from_glib_none(ffi::gst_discoverer_stream_info_get_stream_type_nick(
163 self.as_ref().to_glib_none().0,
164 ))
165 }
166 }
167
168 ///
169 /// # Returns
170 ///
171 /// the tags contained in this stream. If you wish to
172 /// use the tags after the life-time of `self` you will need to copy them.
173 #[doc(alias = "gst_discoverer_stream_info_get_tags")]
174 #[doc(alias = "get_tags")]
175 fn tags(&self) -> Option<gst::TagList> {
176 unsafe {
177 from_glib_none(ffi::gst_discoverer_stream_info_get_tags(
178 self.as_ref().to_glib_none().0,
179 ))
180 }
181 }
182
183 ///
184 /// # Returns
185 ///
186 /// the TOC contained in this stream. If you wish to
187 /// use the TOC after the life-time of `self` you will need to copy it.
188 #[doc(alias = "gst_discoverer_stream_info_get_toc")]
189 #[doc(alias = "get_toc")]
190 fn toc(&self) -> Option<gst::Toc> {
191 unsafe {
192 from_glib_none(ffi::gst_discoverer_stream_info_get_toc(
193 self.as_ref().to_glib_none().0,
194 ))
195 }
196 }
197}
198
199impl<O: IsA<DiscovererStreamInfo>> DiscovererStreamInfoExt for O {}