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 glib::{prelude::*, translate::*};
7
8#[cfg(feature = "v1_20")]
9#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
10#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
11#[non_exhaustive]
12#[doc(alias = "GstAppLeakyType")]
13pub enum AppLeakyType {
14 #[doc(alias = "GST_APP_LEAKY_TYPE_NONE")]
15 None,
16 #[doc(alias = "GST_APP_LEAKY_TYPE_UPSTREAM")]
17 Upstream,
18 #[doc(alias = "GST_APP_LEAKY_TYPE_DOWNSTREAM")]
19 Downstream,
20 #[doc(hidden)]
21 __Unknown(i32),
22}
23
24#[cfg(feature = "v1_20")]
25#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
26#[doc(hidden)]
27impl IntoGlib for AppLeakyType {
28 type GlibType = ffi::GstAppLeakyType;
29
30 #[inline]
31 fn into_glib(self) -> ffi::GstAppLeakyType {
32 match self {
33 Self::None => ffi::GST_APP_LEAKY_TYPE_NONE,
34 Self::Upstream => ffi::GST_APP_LEAKY_TYPE_UPSTREAM,
35 Self::Downstream => ffi::GST_APP_LEAKY_TYPE_DOWNSTREAM,
36 Self::__Unknown(value) => value,
37 }
38 }
39}
40
41#[cfg(feature = "v1_20")]
42#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
43#[doc(hidden)]
44impl FromGlib<ffi::GstAppLeakyType> for AppLeakyType {
45 #[inline]
46 unsafe fn from_glib(value: ffi::GstAppLeakyType) -> Self {
47 skip_assert_initialized!();
48
49 match value {
50 ffi::GST_APP_LEAKY_TYPE_NONE => Self::None,
51 ffi::GST_APP_LEAKY_TYPE_UPSTREAM => Self::Upstream,
52 ffi::GST_APP_LEAKY_TYPE_DOWNSTREAM => Self::Downstream,
53 value => Self::__Unknown(value),
54 }
55 }
56}
57
58#[cfg(feature = "v1_20")]
59#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
60impl StaticType for AppLeakyType {
61 #[inline]
62 #[doc(alias = "gst_app_leaky_type_get_type")]
63 fn static_type() -> glib::Type {
64 unsafe { from_glib(ffi::gst_app_leaky_type_get_type()) }
65 }
66}
67
68#[cfg(feature = "v1_20")]
69#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
70impl glib::HasParamSpec for AppLeakyType {
71 type ParamSpec = glib::ParamSpecEnum;
72 type SetValue = Self;
73 type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
74
75 fn param_spec_builder() -> Self::BuilderFn {
76 Self::ParamSpec::builder_with_default
77 }
78}
79
80#[cfg(feature = "v1_20")]
81#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
82impl glib::value::ValueType for AppLeakyType {
83 type Type = Self;
84}
85
86#[cfg(feature = "v1_20")]
87#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
88unsafe impl<'a> glib::value::FromValue<'a> for AppLeakyType {
89 type Checker = glib::value::GenericValueTypeChecker<Self>;
90
91 #[inline]
92 unsafe fn from_value(value: &'a glib::Value) -> Self {
93 skip_assert_initialized!();
94 from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
95 }
96}
97
98#[cfg(feature = "v1_20")]
99#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
100impl ToValue for AppLeakyType {
101 #[inline]
102 fn to_value(&self) -> glib::Value {
103 let mut value = glib::Value::for_value_type::<Self>();
104 unsafe {
105 glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
106 }
107 value
108 }
109
110 #[inline]
111 fn value_type(&self) -> glib::Type {
112 Self::static_type()
113 }
114}
115
116#[cfg(feature = "v1_20")]
117#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
118impl From<AppLeakyType> for glib::Value {
119 #[inline]
120 fn from(v: AppLeakyType) -> Self {
121 skip_assert_initialized!();
122 ToValue::to_value(&v)
123 }
124}
125
126#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
127#[non_exhaustive]
128#[doc(alias = "GstAppStreamType")]
129pub enum AppStreamType {
130 #[doc(alias = "GST_APP_STREAM_TYPE_STREAM")]
131 Stream,
132 #[doc(alias = "GST_APP_STREAM_TYPE_SEEKABLE")]
133 Seekable,
134 #[doc(alias = "GST_APP_STREAM_TYPE_RANDOM_ACCESS")]
135 RandomAccess,
136 #[doc(hidden)]
137 __Unknown(i32),
138}
139
140#[doc(hidden)]
141impl IntoGlib for AppStreamType {
142 type GlibType = ffi::GstAppStreamType;
143
144 #[inline]
145 fn into_glib(self) -> ffi::GstAppStreamType {
146 match self {
147 Self::Stream => ffi::GST_APP_STREAM_TYPE_STREAM,
148 Self::Seekable => ffi::GST_APP_STREAM_TYPE_SEEKABLE,
149 Self::RandomAccess => ffi::GST_APP_STREAM_TYPE_RANDOM_ACCESS,
150 Self::__Unknown(value: i32) => value,
151 }
152 }
153}
154
155#[doc(hidden)]
156impl FromGlib<ffi::GstAppStreamType> for AppStreamType {
157 #[inline]
158 unsafe fn from_glib(value: ffi::GstAppStreamType) -> Self {
159 skip_assert_initialized!();
160
161 match value {
162 ffi::GST_APP_STREAM_TYPE_STREAM => Self::Stream,
163 ffi::GST_APP_STREAM_TYPE_SEEKABLE => Self::Seekable,
164 ffi::GST_APP_STREAM_TYPE_RANDOM_ACCESS => Self::RandomAccess,
165 value: i32 => Self::__Unknown(value),
166 }
167 }
168}
169
170impl StaticType for AppStreamType {
171 #[inline]
172 #[doc(alias = "gst_app_stream_type_get_type")]
173 fn static_type() -> glib::Type {
174 unsafe { from_glib(val:ffi::gst_app_stream_type_get_type()) }
175 }
176}
177
178impl glib::HasParamSpec for AppStreamType {
179 type ParamSpec = glib::ParamSpecEnum;
180 type SetValue = Self;
181 type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
182
183 fn param_spec_builder() -> Self::BuilderFn {
184 Self::ParamSpec::builder_with_default
185 }
186}
187
188impl glib::value::ValueType for AppStreamType {
189 type Type = Self;
190}
191
192unsafe impl<'a> glib::value::FromValue<'a> for AppStreamType {
193 type Checker = glib::value::GenericValueTypeChecker<Self>;
194
195 #[inline]
196 unsafe fn from_value(value: &'a glib::Value) -> Self {
197 skip_assert_initialized!();
198 from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
199 }
200}
201
202impl ToValue for AppStreamType {
203 #[inline]
204 fn to_value(&self) -> glib::Value {
205 let mut value: Value = glib::Value::for_value_type::<Self>();
206 unsafe {
207 glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib());
208 }
209 value
210 }
211
212 #[inline]
213 fn value_type(&self) -> glib::Type {
214 Self::static_type()
215 }
216}
217
218impl From<AppStreamType> for glib::Value {
219 #[inline]
220 fn from(v: AppStreamType) -> Self {
221 skip_assert_initialized!();
222 ToValue::to_value(&v)
223 }
224}
225