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::*};
7use std::fmt;
8
9#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
10#[non_exhaustive]
11#[doc(alias = "GstAudioDitherMethod")]
12pub enum AudioDitherMethod {
13 #[doc(alias = "GST_AUDIO_DITHER_NONE")]
14 None,
15 #[doc(alias = "GST_AUDIO_DITHER_RPDF")]
16 Rpdf,
17 #[doc(alias = "GST_AUDIO_DITHER_TPDF")]
18 Tpdf,
19 #[doc(alias = "GST_AUDIO_DITHER_TPDF_HF")]
20 TpdfHf,
21 #[doc(hidden)]
22 __Unknown(i32),
23}
24
25#[doc(hidden)]
26impl IntoGlib for AudioDitherMethod {
27 type GlibType = ffi::GstAudioDitherMethod;
28
29 #[inline]
30 fn into_glib(self) -> ffi::GstAudioDitherMethod {
31 match self {
32 Self::None => ffi::GST_AUDIO_DITHER_NONE,
33 Self::Rpdf => ffi::GST_AUDIO_DITHER_RPDF,
34 Self::Tpdf => ffi::GST_AUDIO_DITHER_TPDF,
35 Self::TpdfHf => ffi::GST_AUDIO_DITHER_TPDF_HF,
36 Self::__Unknown(value: i32) => value,
37 }
38 }
39}
40
41#[doc(hidden)]
42impl FromGlib<ffi::GstAudioDitherMethod> for AudioDitherMethod {
43 #[inline]
44 unsafe fn from_glib(value: ffi::GstAudioDitherMethod) -> Self {
45 skip_assert_initialized!();
46
47 match value {
48 ffi::GST_AUDIO_DITHER_NONE => Self::None,
49 ffi::GST_AUDIO_DITHER_RPDF => Self::Rpdf,
50 ffi::GST_AUDIO_DITHER_TPDF => Self::Tpdf,
51 ffi::GST_AUDIO_DITHER_TPDF_HF => Self::TpdfHf,
52 value: i32 => Self::__Unknown(value),
53 }
54 }
55}
56
57impl StaticType for AudioDitherMethod {
58 #[inline]
59 #[doc(alias = "gst_audio_dither_method_get_type")]
60 fn static_type() -> glib::Type {
61 unsafe { from_glib(val:ffi::gst_audio_dither_method_get_type()) }
62 }
63}
64
65impl glib::HasParamSpec for AudioDitherMethod {
66 type ParamSpec = glib::ParamSpecEnum;
67 type SetValue = Self;
68 type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
69
70 fn param_spec_builder() -> Self::BuilderFn {
71 Self::ParamSpec::builder_with_default
72 }
73}
74
75impl glib::value::ValueType for AudioDitherMethod {
76 type Type = Self;
77}
78
79unsafe impl<'a> glib::value::FromValue<'a> for AudioDitherMethod {
80 type Checker = glib::value::GenericValueTypeChecker<Self>;
81
82 #[inline]
83 unsafe fn from_value(value: &'a glib::Value) -> Self {
84 skip_assert_initialized!();
85 from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
86 }
87}
88
89impl ToValue for AudioDitherMethod {
90 #[inline]
91 fn to_value(&self) -> glib::Value {
92 let mut value: Value = glib::Value::for_value_type::<Self>();
93 unsafe {
94 glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib());
95 }
96 value
97 }
98
99 #[inline]
100 fn value_type(&self) -> glib::Type {
101 Self::static_type()
102 }
103}
104
105impl From<AudioDitherMethod> for glib::Value {
106 #[inline]
107 fn from(v: AudioDitherMethod) -> Self {
108 skip_assert_initialized!();
109 ToValue::to_value(&v)
110 }
111}
112
113#[derive(Debug, Eq, PartialEq, Hash, Clone, Copy)]
114#[non_exhaustive]
115#[doc(alias = "GstAudioFormat")]
116pub enum AudioFormat {
117 #[doc(alias = "GST_AUDIO_FORMAT_UNKNOWN")]
118 Unknown,
119 #[doc(alias = "GST_AUDIO_FORMAT_ENCODED")]
120 Encoded,
121 #[doc(alias = "GST_AUDIO_FORMAT_S8")]
122 S8,
123 #[doc(alias = "GST_AUDIO_FORMAT_U8")]
124 U8,
125 #[doc(alias = "GST_AUDIO_FORMAT_S16LE")]
126 S16le,
127 #[doc(alias = "GST_AUDIO_FORMAT_S16BE")]
128 S16be,
129 #[doc(alias = "GST_AUDIO_FORMAT_U16LE")]
130 U16le,
131 #[doc(alias = "GST_AUDIO_FORMAT_U16BE")]
132 U16be,
133 #[doc(alias = "GST_AUDIO_FORMAT_S24_32LE")]
134 S2432le,
135 #[doc(alias = "GST_AUDIO_FORMAT_S24_32BE")]
136 S2432be,
137 #[doc(alias = "GST_AUDIO_FORMAT_U24_32LE")]
138 U2432le,
139 #[doc(alias = "GST_AUDIO_FORMAT_U24_32BE")]
140 U2432be,
141 #[doc(alias = "GST_AUDIO_FORMAT_S32LE")]
142 S32le,
143 #[doc(alias = "GST_AUDIO_FORMAT_S32BE")]
144 S32be,
145 #[doc(alias = "GST_AUDIO_FORMAT_U32LE")]
146 U32le,
147 #[doc(alias = "GST_AUDIO_FORMAT_U32BE")]
148 U32be,
149 #[doc(alias = "GST_AUDIO_FORMAT_S24LE")]
150 S24le,
151 #[doc(alias = "GST_AUDIO_FORMAT_S24BE")]
152 S24be,
153 #[doc(alias = "GST_AUDIO_FORMAT_U24LE")]
154 U24le,
155 #[doc(alias = "GST_AUDIO_FORMAT_U24BE")]
156 U24be,
157 #[doc(alias = "GST_AUDIO_FORMAT_S20LE")]
158 S20le,
159 #[doc(alias = "GST_AUDIO_FORMAT_S20BE")]
160 S20be,
161 #[doc(alias = "GST_AUDIO_FORMAT_U20LE")]
162 U20le,
163 #[doc(alias = "GST_AUDIO_FORMAT_U20BE")]
164 U20be,
165 #[doc(alias = "GST_AUDIO_FORMAT_S18LE")]
166 S18le,
167 #[doc(alias = "GST_AUDIO_FORMAT_S18BE")]
168 S18be,
169 #[doc(alias = "GST_AUDIO_FORMAT_U18LE")]
170 U18le,
171 #[doc(alias = "GST_AUDIO_FORMAT_U18BE")]
172 U18be,
173 #[doc(alias = "GST_AUDIO_FORMAT_F32LE")]
174 F32le,
175 #[doc(alias = "GST_AUDIO_FORMAT_F32BE")]
176 F32be,
177 #[doc(alias = "GST_AUDIO_FORMAT_F64LE")]
178 F64le,
179 #[doc(alias = "GST_AUDIO_FORMAT_F64BE")]
180 F64be,
181 #[doc(hidden)]
182 __Unknown(i32),
183}
184
185impl AudioFormat {
186 #[doc(alias = "gst_audio_format_from_string")]
187 pub fn from_string(format: &str) -> AudioFormat {
188 assert_initialized_main_thread!();
189 unsafe { from_glib(val:ffi::gst_audio_format_from_string(format:format.to_glib_none().0)) }
190 }
191}
192
193impl fmt::Display for AudioFormat {
194 #[inline]
195 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
196 f.write_str(&self.to_str())
197 }
198}
199
200#[doc(hidden)]
201impl IntoGlib for AudioFormat {
202 type GlibType = ffi::GstAudioFormat;
203
204 fn into_glib(self) -> ffi::GstAudioFormat {
205 match self {
206 Self::Unknown => ffi::GST_AUDIO_FORMAT_UNKNOWN,
207 Self::Encoded => ffi::GST_AUDIO_FORMAT_ENCODED,
208 Self::S8 => ffi::GST_AUDIO_FORMAT_S8,
209 Self::U8 => ffi::GST_AUDIO_FORMAT_U8,
210 Self::S16le => ffi::GST_AUDIO_FORMAT_S16LE,
211 Self::S16be => ffi::GST_AUDIO_FORMAT_S16BE,
212 Self::U16le => ffi::GST_AUDIO_FORMAT_U16LE,
213 Self::U16be => ffi::GST_AUDIO_FORMAT_U16BE,
214 Self::S2432le => ffi::GST_AUDIO_FORMAT_S24_32LE,
215 Self::S2432be => ffi::GST_AUDIO_FORMAT_S24_32BE,
216 Self::U2432le => ffi::GST_AUDIO_FORMAT_U24_32LE,
217 Self::U2432be => ffi::GST_AUDIO_FORMAT_U24_32BE,
218 Self::S32le => ffi::GST_AUDIO_FORMAT_S32LE,
219 Self::S32be => ffi::GST_AUDIO_FORMAT_S32BE,
220 Self::U32le => ffi::GST_AUDIO_FORMAT_U32LE,
221 Self::U32be => ffi::GST_AUDIO_FORMAT_U32BE,
222 Self::S24le => ffi::GST_AUDIO_FORMAT_S24LE,
223 Self::S24be => ffi::GST_AUDIO_FORMAT_S24BE,
224 Self::U24le => ffi::GST_AUDIO_FORMAT_U24LE,
225 Self::U24be => ffi::GST_AUDIO_FORMAT_U24BE,
226 Self::S20le => ffi::GST_AUDIO_FORMAT_S20LE,
227 Self::S20be => ffi::GST_AUDIO_FORMAT_S20BE,
228 Self::U20le => ffi::GST_AUDIO_FORMAT_U20LE,
229 Self::U20be => ffi::GST_AUDIO_FORMAT_U20BE,
230 Self::S18le => ffi::GST_AUDIO_FORMAT_S18LE,
231 Self::S18be => ffi::GST_AUDIO_FORMAT_S18BE,
232 Self::U18le => ffi::GST_AUDIO_FORMAT_U18LE,
233 Self::U18be => ffi::GST_AUDIO_FORMAT_U18BE,
234 Self::F32le => ffi::GST_AUDIO_FORMAT_F32LE,
235 Self::F32be => ffi::GST_AUDIO_FORMAT_F32BE,
236 Self::F64le => ffi::GST_AUDIO_FORMAT_F64LE,
237 Self::F64be => ffi::GST_AUDIO_FORMAT_F64BE,
238 Self::__Unknown(value) => value,
239 }
240 }
241}
242
243#[doc(hidden)]
244impl FromGlib<ffi::GstAudioFormat> for AudioFormat {
245 unsafe fn from_glib(value: ffi::GstAudioFormat) -> Self {
246 skip_assert_initialized!();
247
248 match value {
249 ffi::GST_AUDIO_FORMAT_UNKNOWN => Self::Unknown,
250 ffi::GST_AUDIO_FORMAT_ENCODED => Self::Encoded,
251 ffi::GST_AUDIO_FORMAT_S8 => Self::S8,
252 ffi::GST_AUDIO_FORMAT_U8 => Self::U8,
253 ffi::GST_AUDIO_FORMAT_S16LE => Self::S16le,
254 ffi::GST_AUDIO_FORMAT_S16BE => Self::S16be,
255 ffi::GST_AUDIO_FORMAT_U16LE => Self::U16le,
256 ffi::GST_AUDIO_FORMAT_U16BE => Self::U16be,
257 ffi::GST_AUDIO_FORMAT_S24_32LE => Self::S2432le,
258 ffi::GST_AUDIO_FORMAT_S24_32BE => Self::S2432be,
259 ffi::GST_AUDIO_FORMAT_U24_32LE => Self::U2432le,
260 ffi::GST_AUDIO_FORMAT_U24_32BE => Self::U2432be,
261 ffi::GST_AUDIO_FORMAT_S32LE => Self::S32le,
262 ffi::GST_AUDIO_FORMAT_S32BE => Self::S32be,
263 ffi::GST_AUDIO_FORMAT_U32LE => Self::U32le,
264 ffi::GST_AUDIO_FORMAT_U32BE => Self::U32be,
265 ffi::GST_AUDIO_FORMAT_S24LE => Self::S24le,
266 ffi::GST_AUDIO_FORMAT_S24BE => Self::S24be,
267 ffi::GST_AUDIO_FORMAT_U24LE => Self::U24le,
268 ffi::GST_AUDIO_FORMAT_U24BE => Self::U24be,
269 ffi::GST_AUDIO_FORMAT_S20LE => Self::S20le,
270 ffi::GST_AUDIO_FORMAT_S20BE => Self::S20be,
271 ffi::GST_AUDIO_FORMAT_U20LE => Self::U20le,
272 ffi::GST_AUDIO_FORMAT_U20BE => Self::U20be,
273 ffi::GST_AUDIO_FORMAT_S18LE => Self::S18le,
274 ffi::GST_AUDIO_FORMAT_S18BE => Self::S18be,
275 ffi::GST_AUDIO_FORMAT_U18LE => Self::U18le,
276 ffi::GST_AUDIO_FORMAT_U18BE => Self::U18be,
277 ffi::GST_AUDIO_FORMAT_F32LE => Self::F32le,
278 ffi::GST_AUDIO_FORMAT_F32BE => Self::F32be,
279 ffi::GST_AUDIO_FORMAT_F64LE => Self::F64le,
280 ffi::GST_AUDIO_FORMAT_F64BE => Self::F64be,
281 value => Self::__Unknown(value),
282 }
283 }
284}
285
286impl StaticType for AudioFormat {
287 #[inline]
288 #[doc(alias = "gst_audio_format_get_type")]
289 fn static_type() -> glib::Type {
290 unsafe { from_glib(val:ffi::gst_audio_format_get_type()) }
291 }
292}
293
294impl glib::HasParamSpec for AudioFormat {
295 type ParamSpec = glib::ParamSpecEnum;
296 type SetValue = Self;
297 type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
298
299 fn param_spec_builder() -> Self::BuilderFn {
300 Self::ParamSpec::builder_with_default
301 }
302}
303
304impl glib::value::ValueType for AudioFormat {
305 type Type = Self;
306}
307
308unsafe impl<'a> glib::value::FromValue<'a> for AudioFormat {
309 type Checker = glib::value::GenericValueTypeChecker<Self>;
310
311 #[inline]
312 unsafe fn from_value(value: &'a glib::Value) -> Self {
313 skip_assert_initialized!();
314 from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
315 }
316}
317
318impl ToValue for AudioFormat {
319 #[inline]
320 fn to_value(&self) -> glib::Value {
321 let mut value: Value = glib::Value::for_value_type::<Self>();
322 unsafe {
323 glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib());
324 }
325 value
326 }
327
328 #[inline]
329 fn value_type(&self) -> glib::Type {
330 Self::static_type()
331 }
332}
333
334impl From<AudioFormat> for glib::Value {
335 #[inline]
336 fn from(v: AudioFormat) -> Self {
337 skip_assert_initialized!();
338 ToValue::to_value(&v)
339 }
340}
341
342#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
343#[non_exhaustive]
344#[doc(alias = "GstAudioLayout")]
345pub enum AudioLayout {
346 #[doc(alias = "GST_AUDIO_LAYOUT_INTERLEAVED")]
347 Interleaved,
348 #[doc(alias = "GST_AUDIO_LAYOUT_NON_INTERLEAVED")]
349 NonInterleaved,
350 #[doc(hidden)]
351 __Unknown(i32),
352}
353
354#[doc(hidden)]
355impl IntoGlib for AudioLayout {
356 type GlibType = ffi::GstAudioLayout;
357
358 #[inline]
359 fn into_glib(self) -> ffi::GstAudioLayout {
360 match self {
361 Self::Interleaved => ffi::GST_AUDIO_LAYOUT_INTERLEAVED,
362 Self::NonInterleaved => ffi::GST_AUDIO_LAYOUT_NON_INTERLEAVED,
363 Self::__Unknown(value: i32) => value,
364 }
365 }
366}
367
368#[doc(hidden)]
369impl FromGlib<ffi::GstAudioLayout> for AudioLayout {
370 #[inline]
371 unsafe fn from_glib(value: ffi::GstAudioLayout) -> Self {
372 skip_assert_initialized!();
373
374 match value {
375 ffi::GST_AUDIO_LAYOUT_INTERLEAVED => Self::Interleaved,
376 ffi::GST_AUDIO_LAYOUT_NON_INTERLEAVED => Self::NonInterleaved,
377 value: i32 => Self::__Unknown(value),
378 }
379 }
380}
381
382impl StaticType for AudioLayout {
383 #[inline]
384 #[doc(alias = "gst_audio_layout_get_type")]
385 fn static_type() -> glib::Type {
386 unsafe { from_glib(val:ffi::gst_audio_layout_get_type()) }
387 }
388}
389
390impl glib::HasParamSpec for AudioLayout {
391 type ParamSpec = glib::ParamSpecEnum;
392 type SetValue = Self;
393 type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
394
395 fn param_spec_builder() -> Self::BuilderFn {
396 Self::ParamSpec::builder_with_default
397 }
398}
399
400impl glib::value::ValueType for AudioLayout {
401 type Type = Self;
402}
403
404unsafe impl<'a> glib::value::FromValue<'a> for AudioLayout {
405 type Checker = glib::value::GenericValueTypeChecker<Self>;
406
407 #[inline]
408 unsafe fn from_value(value: &'a glib::Value) -> Self {
409 skip_assert_initialized!();
410 from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
411 }
412}
413
414impl ToValue for AudioLayout {
415 #[inline]
416 fn to_value(&self) -> glib::Value {
417 let mut value: Value = glib::Value::for_value_type::<Self>();
418 unsafe {
419 glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib());
420 }
421 value
422 }
423
424 #[inline]
425 fn value_type(&self) -> glib::Type {
426 Self::static_type()
427 }
428}
429
430impl From<AudioLayout> for glib::Value {
431 #[inline]
432 fn from(v: AudioLayout) -> Self {
433 skip_assert_initialized!();
434 ToValue::to_value(&v)
435 }
436}
437
438#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
439#[non_exhaustive]
440#[doc(alias = "GstAudioNoiseShapingMethod")]
441pub enum AudioNoiseShapingMethod {
442 #[doc(alias = "GST_AUDIO_NOISE_SHAPING_NONE")]
443 None,
444 #[doc(alias = "GST_AUDIO_NOISE_SHAPING_ERROR_FEEDBACK")]
445 ErrorFeedback,
446 #[doc(alias = "GST_AUDIO_NOISE_SHAPING_SIMPLE")]
447 Simple,
448 #[doc(alias = "GST_AUDIO_NOISE_SHAPING_MEDIUM")]
449 Medium,
450 #[doc(alias = "GST_AUDIO_NOISE_SHAPING_HIGH")]
451 High,
452 #[doc(hidden)]
453 __Unknown(i32),
454}
455
456#[doc(hidden)]
457impl IntoGlib for AudioNoiseShapingMethod {
458 type GlibType = ffi::GstAudioNoiseShapingMethod;
459
460 #[inline]
461 fn into_glib(self) -> ffi::GstAudioNoiseShapingMethod {
462 match self {
463 Self::None => ffi::GST_AUDIO_NOISE_SHAPING_NONE,
464 Self::ErrorFeedback => ffi::GST_AUDIO_NOISE_SHAPING_ERROR_FEEDBACK,
465 Self::Simple => ffi::GST_AUDIO_NOISE_SHAPING_SIMPLE,
466 Self::Medium => ffi::GST_AUDIO_NOISE_SHAPING_MEDIUM,
467 Self::High => ffi::GST_AUDIO_NOISE_SHAPING_HIGH,
468 Self::__Unknown(value: i32) => value,
469 }
470 }
471}
472
473#[doc(hidden)]
474impl FromGlib<ffi::GstAudioNoiseShapingMethod> for AudioNoiseShapingMethod {
475 #[inline]
476 unsafe fn from_glib(value: ffi::GstAudioNoiseShapingMethod) -> Self {
477 skip_assert_initialized!();
478
479 match value {
480 ffi::GST_AUDIO_NOISE_SHAPING_NONE => Self::None,
481 ffi::GST_AUDIO_NOISE_SHAPING_ERROR_FEEDBACK => Self::ErrorFeedback,
482 ffi::GST_AUDIO_NOISE_SHAPING_SIMPLE => Self::Simple,
483 ffi::GST_AUDIO_NOISE_SHAPING_MEDIUM => Self::Medium,
484 ffi::GST_AUDIO_NOISE_SHAPING_HIGH => Self::High,
485 value: i32 => Self::__Unknown(value),
486 }
487 }
488}
489
490impl StaticType for AudioNoiseShapingMethod {
491 #[inline]
492 #[doc(alias = "gst_audio_noise_shaping_method_get_type")]
493 fn static_type() -> glib::Type {
494 unsafe { from_glib(val:ffi::gst_audio_noise_shaping_method_get_type()) }
495 }
496}
497
498impl glib::HasParamSpec for AudioNoiseShapingMethod {
499 type ParamSpec = glib::ParamSpecEnum;
500 type SetValue = Self;
501 type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
502
503 fn param_spec_builder() -> Self::BuilderFn {
504 Self::ParamSpec::builder_with_default
505 }
506}
507
508impl glib::value::ValueType for AudioNoiseShapingMethod {
509 type Type = Self;
510}
511
512unsafe impl<'a> glib::value::FromValue<'a> for AudioNoiseShapingMethod {
513 type Checker = glib::value::GenericValueTypeChecker<Self>;
514
515 #[inline]
516 unsafe fn from_value(value: &'a glib::Value) -> Self {
517 skip_assert_initialized!();
518 from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
519 }
520}
521
522impl ToValue for AudioNoiseShapingMethod {
523 #[inline]
524 fn to_value(&self) -> glib::Value {
525 let mut value: Value = glib::Value::for_value_type::<Self>();
526 unsafe {
527 glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib());
528 }
529 value
530 }
531
532 #[inline]
533 fn value_type(&self) -> glib::Type {
534 Self::static_type()
535 }
536}
537
538impl From<AudioNoiseShapingMethod> for glib::Value {
539 #[inline]
540 fn from(v: AudioNoiseShapingMethod) -> Self {
541 skip_assert_initialized!();
542 ToValue::to_value(&v)
543 }
544}
545
546#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
547#[non_exhaustive]
548#[doc(alias = "GstAudioResamplerMethod")]
549pub enum AudioResamplerMethod {
550 #[doc(alias = "GST_AUDIO_RESAMPLER_METHOD_NEAREST")]
551 Nearest,
552 #[doc(alias = "GST_AUDIO_RESAMPLER_METHOD_LINEAR")]
553 Linear,
554 #[doc(alias = "GST_AUDIO_RESAMPLER_METHOD_CUBIC")]
555 Cubic,
556 #[doc(alias = "GST_AUDIO_RESAMPLER_METHOD_BLACKMAN_NUTTALL")]
557 BlackmanNuttall,
558 #[doc(alias = "GST_AUDIO_RESAMPLER_METHOD_KAISER")]
559 Kaiser,
560 #[doc(hidden)]
561 __Unknown(i32),
562}
563
564#[doc(hidden)]
565impl IntoGlib for AudioResamplerMethod {
566 type GlibType = ffi::GstAudioResamplerMethod;
567
568 #[inline]
569 fn into_glib(self) -> ffi::GstAudioResamplerMethod {
570 match self {
571 Self::Nearest => ffi::GST_AUDIO_RESAMPLER_METHOD_NEAREST,
572 Self::Linear => ffi::GST_AUDIO_RESAMPLER_METHOD_LINEAR,
573 Self::Cubic => ffi::GST_AUDIO_RESAMPLER_METHOD_CUBIC,
574 Self::BlackmanNuttall => ffi::GST_AUDIO_RESAMPLER_METHOD_BLACKMAN_NUTTALL,
575 Self::Kaiser => ffi::GST_AUDIO_RESAMPLER_METHOD_KAISER,
576 Self::__Unknown(value: i32) => value,
577 }
578 }
579}
580
581#[doc(hidden)]
582impl FromGlib<ffi::GstAudioResamplerMethod> for AudioResamplerMethod {
583 #[inline]
584 unsafe fn from_glib(value: ffi::GstAudioResamplerMethod) -> Self {
585 skip_assert_initialized!();
586
587 match value {
588 ffi::GST_AUDIO_RESAMPLER_METHOD_NEAREST => Self::Nearest,
589 ffi::GST_AUDIO_RESAMPLER_METHOD_LINEAR => Self::Linear,
590 ffi::GST_AUDIO_RESAMPLER_METHOD_CUBIC => Self::Cubic,
591 ffi::GST_AUDIO_RESAMPLER_METHOD_BLACKMAN_NUTTALL => Self::BlackmanNuttall,
592 ffi::GST_AUDIO_RESAMPLER_METHOD_KAISER => Self::Kaiser,
593 value: i32 => Self::__Unknown(value),
594 }
595 }
596}
597
598impl StaticType for AudioResamplerMethod {
599 #[inline]
600 #[doc(alias = "gst_audio_resampler_method_get_type")]
601 fn static_type() -> glib::Type {
602 unsafe { from_glib(val:ffi::gst_audio_resampler_method_get_type()) }
603 }
604}
605
606impl glib::HasParamSpec for AudioResamplerMethod {
607 type ParamSpec = glib::ParamSpecEnum;
608 type SetValue = Self;
609 type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
610
611 fn param_spec_builder() -> Self::BuilderFn {
612 Self::ParamSpec::builder_with_default
613 }
614}
615
616impl glib::value::ValueType for AudioResamplerMethod {
617 type Type = Self;
618}
619
620unsafe impl<'a> glib::value::FromValue<'a> for AudioResamplerMethod {
621 type Checker = glib::value::GenericValueTypeChecker<Self>;
622
623 #[inline]
624 unsafe fn from_value(value: &'a glib::Value) -> Self {
625 skip_assert_initialized!();
626 from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
627 }
628}
629
630impl ToValue for AudioResamplerMethod {
631 #[inline]
632 fn to_value(&self) -> glib::Value {
633 let mut value: Value = glib::Value::for_value_type::<Self>();
634 unsafe {
635 glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib());
636 }
637 value
638 }
639
640 #[inline]
641 fn value_type(&self) -> glib::Type {
642 Self::static_type()
643 }
644}
645
646impl From<AudioResamplerMethod> for glib::Value {
647 #[inline]
648 fn from(v: AudioResamplerMethod) -> Self {
649 skip_assert_initialized!();
650 ToValue::to_value(&v)
651 }
652}
653
654#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
655#[non_exhaustive]
656#[doc(alias = "GstAudioRingBufferFormatType")]
657pub enum AudioRingBufferFormatType {
658 #[doc(alias = "GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW")]
659 Raw,
660 #[doc(alias = "GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MU_LAW")]
661 MuLaw,
662 #[doc(alias = "GST_AUDIO_RING_BUFFER_FORMAT_TYPE_A_LAW")]
663 ALaw,
664 #[doc(alias = "GST_AUDIO_RING_BUFFER_FORMAT_TYPE_IMA_ADPCM")]
665 ImaAdpcm,
666 #[doc(alias = "GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG")]
667 Mpeg,
668 #[doc(alias = "GST_AUDIO_RING_BUFFER_FORMAT_TYPE_GSM")]
669 Gsm,
670 #[doc(alias = "GST_AUDIO_RING_BUFFER_FORMAT_TYPE_IEC958")]
671 Iec958,
672 #[doc(alias = "GST_AUDIO_RING_BUFFER_FORMAT_TYPE_AC3")]
673 Ac3,
674 #[doc(alias = "GST_AUDIO_RING_BUFFER_FORMAT_TYPE_EAC3")]
675 Eac3,
676 #[doc(alias = "GST_AUDIO_RING_BUFFER_FORMAT_TYPE_DTS")]
677 Dts,
678 #[doc(alias = "GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG2_AAC")]
679 Mpeg2Aac,
680 #[doc(alias = "GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG4_AAC")]
681 Mpeg4Aac,
682 #[doc(alias = "GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG2_AAC_RAW")]
683 Mpeg2AacRaw,
684 #[doc(alias = "GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG4_AAC_RAW")]
685 Mpeg4AacRaw,
686 #[doc(alias = "GST_AUDIO_RING_BUFFER_FORMAT_TYPE_FLAC")]
687 Flac,
688 #[cfg(feature = "v1_24")]
689 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
690 #[doc(alias = "GST_AUDIO_RING_BUFFER_FORMAT_TYPE_DSD")]
691 Dsd,
692 #[doc(hidden)]
693 __Unknown(i32),
694}
695
696#[doc(hidden)]
697impl IntoGlib for AudioRingBufferFormatType {
698 type GlibType = ffi::GstAudioRingBufferFormatType;
699
700 fn into_glib(self) -> ffi::GstAudioRingBufferFormatType {
701 match self {
702 Self::Raw => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW,
703 Self::MuLaw => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MU_LAW,
704 Self::ALaw => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_A_LAW,
705 Self::ImaAdpcm => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_IMA_ADPCM,
706 Self::Mpeg => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG,
707 Self::Gsm => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_GSM,
708 Self::Iec958 => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_IEC958,
709 Self::Ac3 => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_AC3,
710 Self::Eac3 => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_EAC3,
711 Self::Dts => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_DTS,
712 Self::Mpeg2Aac => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG2_AAC,
713 Self::Mpeg4Aac => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG4_AAC,
714 Self::Mpeg2AacRaw => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG2_AAC_RAW,
715 Self::Mpeg4AacRaw => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG4_AAC_RAW,
716 Self::Flac => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_FLAC,
717 #[cfg(feature = "v1_24")]
718 Self::Dsd => ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_DSD,
719 Self::__Unknown(value) => value,
720 }
721 }
722}
723
724#[doc(hidden)]
725impl FromGlib<ffi::GstAudioRingBufferFormatType> for AudioRingBufferFormatType {
726 unsafe fn from_glib(value: ffi::GstAudioRingBufferFormatType) -> Self {
727 skip_assert_initialized!();
728
729 match value {
730 ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW => Self::Raw,
731 ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MU_LAW => Self::MuLaw,
732 ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_A_LAW => Self::ALaw,
733 ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_IMA_ADPCM => Self::ImaAdpcm,
734 ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG => Self::Mpeg,
735 ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_GSM => Self::Gsm,
736 ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_IEC958 => Self::Iec958,
737 ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_AC3 => Self::Ac3,
738 ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_EAC3 => Self::Eac3,
739 ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_DTS => Self::Dts,
740 ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG2_AAC => Self::Mpeg2Aac,
741 ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG4_AAC => Self::Mpeg4Aac,
742 ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG2_AAC_RAW => Self::Mpeg2AacRaw,
743 ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG4_AAC_RAW => Self::Mpeg4AacRaw,
744 ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_FLAC => Self::Flac,
745 #[cfg(feature = "v1_24")]
746 ffi::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_DSD => Self::Dsd,
747 value => Self::__Unknown(value),
748 }
749 }
750}
751
752impl StaticType for AudioRingBufferFormatType {
753 #[inline]
754 #[doc(alias = "gst_audio_ring_buffer_format_type_get_type")]
755 fn static_type() -> glib::Type {
756 unsafe { from_glib(val:ffi::gst_audio_ring_buffer_format_type_get_type()) }
757 }
758}
759
760impl glib::HasParamSpec for AudioRingBufferFormatType {
761 type ParamSpec = glib::ParamSpecEnum;
762 type SetValue = Self;
763 type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
764
765 fn param_spec_builder() -> Self::BuilderFn {
766 Self::ParamSpec::builder_with_default
767 }
768}
769
770impl glib::value::ValueType for AudioRingBufferFormatType {
771 type Type = Self;
772}
773
774unsafe impl<'a> glib::value::FromValue<'a> for AudioRingBufferFormatType {
775 type Checker = glib::value::GenericValueTypeChecker<Self>;
776
777 #[inline]
778 unsafe fn from_value(value: &'a glib::Value) -> Self {
779 skip_assert_initialized!();
780 from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
781 }
782}
783
784impl ToValue for AudioRingBufferFormatType {
785 #[inline]
786 fn to_value(&self) -> glib::Value {
787 let mut value: Value = glib::Value::for_value_type::<Self>();
788 unsafe {
789 glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib());
790 }
791 value
792 }
793
794 #[inline]
795 fn value_type(&self) -> glib::Type {
796 Self::static_type()
797 }
798}
799
800impl From<AudioRingBufferFormatType> for glib::Value {
801 #[inline]
802 fn from(v: AudioRingBufferFormatType) -> Self {
803 skip_assert_initialized!();
804 ToValue::to_value(&v)
805 }
806}
807
808#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
809#[non_exhaustive]
810#[doc(alias = "GstStreamVolumeFormat")]
811pub enum StreamVolumeFormat {
812 #[doc(alias = "GST_STREAM_VOLUME_FORMAT_LINEAR")]
813 Linear,
814 #[doc(alias = "GST_STREAM_VOLUME_FORMAT_CUBIC")]
815 Cubic,
816 #[doc(alias = "GST_STREAM_VOLUME_FORMAT_DB")]
817 Db,
818 #[doc(hidden)]
819 __Unknown(i32),
820}
821
822#[doc(hidden)]
823impl IntoGlib for StreamVolumeFormat {
824 type GlibType = ffi::GstStreamVolumeFormat;
825
826 #[inline]
827 fn into_glib(self) -> ffi::GstStreamVolumeFormat {
828 match self {
829 Self::Linear => ffi::GST_STREAM_VOLUME_FORMAT_LINEAR,
830 Self::Cubic => ffi::GST_STREAM_VOLUME_FORMAT_CUBIC,
831 Self::Db => ffi::GST_STREAM_VOLUME_FORMAT_DB,
832 Self::__Unknown(value: i32) => value,
833 }
834 }
835}
836
837#[doc(hidden)]
838impl FromGlib<ffi::GstStreamVolumeFormat> for StreamVolumeFormat {
839 #[inline]
840 unsafe fn from_glib(value: ffi::GstStreamVolumeFormat) -> Self {
841 skip_assert_initialized!();
842
843 match value {
844 ffi::GST_STREAM_VOLUME_FORMAT_LINEAR => Self::Linear,
845 ffi::GST_STREAM_VOLUME_FORMAT_CUBIC => Self::Cubic,
846 ffi::GST_STREAM_VOLUME_FORMAT_DB => Self::Db,
847 value: i32 => Self::__Unknown(value),
848 }
849 }
850}
851