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
35mod sealed {
36 pub trait Sealed {}
37 impl<T: super::IsA<super::PlayStreamInfo>> Sealed for T {}
38}
39
40/// Trait containing all [`struct@PlayStreamInfo`] methods.
41///
42/// # Implementors
43///
44/// [`PlayAudioInfo`][struct@crate::PlayAudioInfo], [`PlayStreamInfo`][struct@crate::PlayStreamInfo], [`PlaySubtitleInfo`][struct@crate::PlaySubtitleInfo], [`PlayVideoInfo`][struct@crate::PlayVideoInfo]
45pub trait PlayStreamInfoExt: IsA<PlayStreamInfo> + sealed::Sealed + 'static {
46 ///
47 /// # Returns
48 ///
49 /// the [`gst::Caps`][crate::gst::Caps] of the stream or [`None`] if
50 /// unknown.
51 #[doc(alias = "gst_play_stream_info_get_caps")]
52 #[doc(alias = "get_caps")]
53 fn caps(&self) -> Option<gst::Caps> {
54 unsafe {
55 from_glib_none(ffi::gst_play_stream_info_get_caps(const_override(
56 self.as_ref().to_glib_none().0,
57 )))
58 }
59 }
60
61 /// A string describing codec used in [`PlayStreamInfo`][crate::PlayStreamInfo].
62 ///
63 /// # Returns
64 ///
65 /// codec string or [`None`] on unknown.
66 #[doc(alias = "gst_play_stream_info_get_codec")]
67 #[doc(alias = "get_codec")]
68 fn codec(&self) -> Option<glib::GString> {
69 unsafe {
70 from_glib_none(ffi::gst_play_stream_info_get_codec(const_override(
71 self.as_ref().to_glib_none().0,
72 )))
73 }
74 }
75
76 /// Function to get stream index from [`PlayStreamInfo`][crate::PlayStreamInfo] instance or -1 if
77 /// unknown.
78 ///
79 /// # Deprecated since 1.26
80 ///
81 /// Use [`stream_id()`][Self::stream_id()].
82 ///
83 /// # Returns
84 ///
85 /// the stream index of this stream.
86 #[cfg_attr(feature = "v1_26", deprecated = "Since 1.26")]
87 #[allow(deprecated)]
88 #[doc(alias = "gst_play_stream_info_get_index")]
89 #[doc(alias = "get_index")]
90 fn index(&self) -> i32 {
91 unsafe {
92 ffi::gst_play_stream_info_get_index(const_override(self.as_ref().to_glib_none().0))
93 }
94 }
95
96 /// A string stream id identifying this [`PlayStreamInfo`][crate::PlayStreamInfo].
97 ///
98 /// # Returns
99 ///
100 /// stream id string.
101 #[cfg(feature = "v1_26")]
102 #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
103 #[doc(alias = "gst_play_stream_info_get_stream_id")]
104 #[doc(alias = "get_stream_id")]
105 fn stream_id(&self) -> glib::GString {
106 unsafe {
107 from_glib_none(ffi::gst_play_stream_info_get_stream_id(const_override(
108 self.as_ref().to_glib_none().0,
109 )))
110 }
111 }
112
113 /// Function to return human readable name for the stream type
114 /// of the given `self` (ex: "audio", "video", "subtitle")
115 ///
116 /// # Returns
117 ///
118 /// a human readable name
119 #[doc(alias = "gst_play_stream_info_get_stream_type")]
120 #[doc(alias = "get_stream_type")]
121 fn stream_type(&self) -> glib::GString {
122 unsafe {
123 from_glib_none(ffi::gst_play_stream_info_get_stream_type(const_override(
124 self.as_ref().to_glib_none().0,
125 )))
126 }
127 }
128
129 ///
130 /// # Returns
131 ///
132 /// the tags contained in this stream.
133 #[doc(alias = "gst_play_stream_info_get_tags")]
134 #[doc(alias = "get_tags")]
135 fn tags(&self) -> Option<gst::TagList> {
136 unsafe {
137 from_glib_none(ffi::gst_play_stream_info_get_tags(const_override(
138 self.as_ref().to_glib_none().0,
139 )))
140 }
141 }
142}
143
144impl<O: IsA<PlayStreamInfo>> PlayStreamInfoExt for O {}