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 | |
6 | use crate::EventTypeFlags; |
7 | use glib::{prelude::*, translate::*, GStr}; |
8 | use std::fmt; |
9 | |
10 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
11 | #[non_exhaustive ] |
12 | #[doc (alias = "GstBufferingMode" )] |
13 | pub enum BufferingMode { |
14 | #[doc (alias = "GST_BUFFERING_STREAM" )] |
15 | Stream, |
16 | #[doc (alias = "GST_BUFFERING_DOWNLOAD" )] |
17 | Download, |
18 | #[doc (alias = "GST_BUFFERING_TIMESHIFT" )] |
19 | Timeshift, |
20 | #[doc (alias = "GST_BUFFERING_LIVE" )] |
21 | Live, |
22 | #[doc (hidden)] |
23 | __Unknown(i32), |
24 | } |
25 | |
26 | #[doc (hidden)] |
27 | impl IntoGlib for BufferingMode { |
28 | type GlibType = ffi::GstBufferingMode; |
29 | |
30 | #[inline ] |
31 | fn into_glib(self) -> ffi::GstBufferingMode { |
32 | match self { |
33 | Self::Stream => ffi::GST_BUFFERING_STREAM, |
34 | Self::Download => ffi::GST_BUFFERING_DOWNLOAD, |
35 | Self::Timeshift => ffi::GST_BUFFERING_TIMESHIFT, |
36 | Self::Live => ffi::GST_BUFFERING_LIVE, |
37 | Self::__Unknown(value: i32) => value, |
38 | } |
39 | } |
40 | } |
41 | |
42 | #[doc (hidden)] |
43 | impl FromGlib<ffi::GstBufferingMode> for BufferingMode { |
44 | #[inline ] |
45 | unsafe fn from_glib(value: ffi::GstBufferingMode) -> Self { |
46 | skip_assert_initialized!(); |
47 | |
48 | match value { |
49 | ffi::GST_BUFFERING_STREAM => Self::Stream, |
50 | ffi::GST_BUFFERING_DOWNLOAD => Self::Download, |
51 | ffi::GST_BUFFERING_TIMESHIFT => Self::Timeshift, |
52 | ffi::GST_BUFFERING_LIVE => Self::Live, |
53 | value: i32 => Self::__Unknown(value), |
54 | } |
55 | } |
56 | } |
57 | |
58 | impl StaticType for BufferingMode { |
59 | #[inline ] |
60 | #[doc (alias = "gst_buffering_mode_get_type" )] |
61 | fn static_type() -> glib::Type { |
62 | unsafe { from_glib(val:ffi::gst_buffering_mode_get_type()) } |
63 | } |
64 | } |
65 | |
66 | impl glib::HasParamSpec for BufferingMode { |
67 | type ParamSpec = glib::ParamSpecEnum; |
68 | type SetValue = Self; |
69 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
70 | |
71 | fn param_spec_builder() -> Self::BuilderFn { |
72 | Self::ParamSpec::builder_with_default |
73 | } |
74 | } |
75 | |
76 | impl glib::value::ValueType for BufferingMode { |
77 | type Type = Self; |
78 | } |
79 | |
80 | unsafe impl<'a> glib::value::FromValue<'a> for BufferingMode { |
81 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
82 | |
83 | #[inline ] |
84 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
85 | skip_assert_initialized!(); |
86 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
87 | } |
88 | } |
89 | |
90 | impl ToValue for BufferingMode { |
91 | #[inline ] |
92 | fn to_value(&self) -> glib::Value { |
93 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
94 | unsafe { |
95 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
96 | } |
97 | value |
98 | } |
99 | |
100 | #[inline ] |
101 | fn value_type(&self) -> glib::Type { |
102 | Self::static_type() |
103 | } |
104 | } |
105 | |
106 | impl From<BufferingMode> for glib::Value { |
107 | #[inline ] |
108 | fn from(v: BufferingMode) -> Self { |
109 | skip_assert_initialized!(); |
110 | ToValue::to_value(&v) |
111 | } |
112 | } |
113 | |
114 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
115 | #[repr (i32)] |
116 | #[doc (alias = "GstBusSyncReply" )] |
117 | pub enum BusSyncReply { |
118 | #[doc (alias = "GST_BUS_DROP" )] |
119 | Drop = ffi::GST_BUS_DROP, |
120 | #[doc (alias = "GST_BUS_PASS" )] |
121 | Pass = ffi::GST_BUS_PASS, |
122 | #[doc (alias = "GST_BUS_ASYNC" )] |
123 | Async = ffi::GST_BUS_ASYNC, |
124 | } |
125 | |
126 | #[doc (hidden)] |
127 | impl IntoGlib for BusSyncReply { |
128 | type GlibType = ffi::GstBusSyncReply; |
129 | |
130 | #[inline ] |
131 | fn into_glib(self) -> ffi::GstBusSyncReply { |
132 | self as ffi::GstBusSyncReply |
133 | } |
134 | } |
135 | |
136 | #[doc (hidden)] |
137 | impl FromGlib<ffi::GstBusSyncReply> for BusSyncReply { |
138 | #[inline ] |
139 | unsafe fn from_glib(value: ffi::GstBusSyncReply) -> Self { |
140 | skip_assert_initialized!(); |
141 | |
142 | debug_assert!([ffi::GST_BUS_DROP, ffi::GST_BUS_PASS, ffi::GST_BUS_ASYNC].contains(&value)); |
143 | std::mem::transmute(src:value) |
144 | } |
145 | } |
146 | |
147 | impl StaticType for BusSyncReply { |
148 | #[inline ] |
149 | #[doc (alias = "gst_bus_sync_reply_get_type" )] |
150 | fn static_type() -> glib::Type { |
151 | unsafe { from_glib(val:ffi::gst_bus_sync_reply_get_type()) } |
152 | } |
153 | } |
154 | |
155 | impl glib::HasParamSpec for BusSyncReply { |
156 | type ParamSpec = glib::ParamSpecEnum; |
157 | type SetValue = Self; |
158 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
159 | |
160 | fn param_spec_builder() -> Self::BuilderFn { |
161 | Self::ParamSpec::builder_with_default |
162 | } |
163 | } |
164 | |
165 | impl glib::value::ValueType for BusSyncReply { |
166 | type Type = Self; |
167 | } |
168 | |
169 | unsafe impl<'a> glib::value::FromValue<'a> for BusSyncReply { |
170 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
171 | |
172 | #[inline ] |
173 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
174 | skip_assert_initialized!(); |
175 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
176 | } |
177 | } |
178 | |
179 | impl ToValue for BusSyncReply { |
180 | #[inline ] |
181 | fn to_value(&self) -> glib::Value { |
182 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
183 | unsafe { |
184 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
185 | } |
186 | value |
187 | } |
188 | |
189 | #[inline ] |
190 | fn value_type(&self) -> glib::Type { |
191 | Self::static_type() |
192 | } |
193 | } |
194 | |
195 | impl From<BusSyncReply> for glib::Value { |
196 | #[inline ] |
197 | fn from(v: BusSyncReply) -> Self { |
198 | skip_assert_initialized!(); |
199 | ToValue::to_value(&v) |
200 | } |
201 | } |
202 | |
203 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
204 | #[non_exhaustive ] |
205 | #[doc (alias = "GstCapsIntersectMode" )] |
206 | pub enum CapsIntersectMode { |
207 | #[doc (alias = "GST_CAPS_INTERSECT_ZIG_ZAG" )] |
208 | ZigZag, |
209 | #[doc (alias = "GST_CAPS_INTERSECT_FIRST" )] |
210 | First, |
211 | #[doc (hidden)] |
212 | __Unknown(i32), |
213 | } |
214 | |
215 | #[doc (hidden)] |
216 | impl IntoGlib for CapsIntersectMode { |
217 | type GlibType = ffi::GstCapsIntersectMode; |
218 | |
219 | #[inline ] |
220 | fn into_glib(self) -> ffi::GstCapsIntersectMode { |
221 | match self { |
222 | Self::ZigZag => ffi::GST_CAPS_INTERSECT_ZIG_ZAG, |
223 | Self::First => ffi::GST_CAPS_INTERSECT_FIRST, |
224 | Self::__Unknown(value: i32) => value, |
225 | } |
226 | } |
227 | } |
228 | |
229 | #[doc (hidden)] |
230 | impl FromGlib<ffi::GstCapsIntersectMode> for CapsIntersectMode { |
231 | #[inline ] |
232 | unsafe fn from_glib(value: ffi::GstCapsIntersectMode) -> Self { |
233 | skip_assert_initialized!(); |
234 | |
235 | match value { |
236 | ffi::GST_CAPS_INTERSECT_ZIG_ZAG => Self::ZigZag, |
237 | ffi::GST_CAPS_INTERSECT_FIRST => Self::First, |
238 | value: i32 => Self::__Unknown(value), |
239 | } |
240 | } |
241 | } |
242 | |
243 | impl StaticType for CapsIntersectMode { |
244 | #[inline ] |
245 | #[doc (alias = "gst_caps_intersect_mode_get_type" )] |
246 | fn static_type() -> glib::Type { |
247 | unsafe { from_glib(val:ffi::gst_caps_intersect_mode_get_type()) } |
248 | } |
249 | } |
250 | |
251 | impl glib::HasParamSpec for CapsIntersectMode { |
252 | type ParamSpec = glib::ParamSpecEnum; |
253 | type SetValue = Self; |
254 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
255 | |
256 | fn param_spec_builder() -> Self::BuilderFn { |
257 | Self::ParamSpec::builder_with_default |
258 | } |
259 | } |
260 | |
261 | impl glib::value::ValueType for CapsIntersectMode { |
262 | type Type = Self; |
263 | } |
264 | |
265 | unsafe impl<'a> glib::value::FromValue<'a> for CapsIntersectMode { |
266 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
267 | |
268 | #[inline ] |
269 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
270 | skip_assert_initialized!(); |
271 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
272 | } |
273 | } |
274 | |
275 | impl ToValue for CapsIntersectMode { |
276 | #[inline ] |
277 | fn to_value(&self) -> glib::Value { |
278 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
279 | unsafe { |
280 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
281 | } |
282 | value |
283 | } |
284 | |
285 | #[inline ] |
286 | fn value_type(&self) -> glib::Type { |
287 | Self::static_type() |
288 | } |
289 | } |
290 | |
291 | impl From<CapsIntersectMode> for glib::Value { |
292 | #[inline ] |
293 | fn from(v: CapsIntersectMode) -> Self { |
294 | skip_assert_initialized!(); |
295 | ToValue::to_value(&v) |
296 | } |
297 | } |
298 | |
299 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
300 | #[non_exhaustive ] |
301 | #[doc (alias = "GstClockEntryType" )] |
302 | pub enum ClockEntryType { |
303 | #[doc (alias = "GST_CLOCK_ENTRY_SINGLE" )] |
304 | Single, |
305 | #[doc (alias = "GST_CLOCK_ENTRY_PERIODIC" )] |
306 | Periodic, |
307 | #[doc (hidden)] |
308 | __Unknown(i32), |
309 | } |
310 | |
311 | #[doc (hidden)] |
312 | impl IntoGlib for ClockEntryType { |
313 | type GlibType = ffi::GstClockEntryType; |
314 | |
315 | #[inline ] |
316 | fn into_glib(self) -> ffi::GstClockEntryType { |
317 | match self { |
318 | Self::Single => ffi::GST_CLOCK_ENTRY_SINGLE, |
319 | Self::Periodic => ffi::GST_CLOCK_ENTRY_PERIODIC, |
320 | Self::__Unknown(value: i32) => value, |
321 | } |
322 | } |
323 | } |
324 | |
325 | #[doc (hidden)] |
326 | impl FromGlib<ffi::GstClockEntryType> for ClockEntryType { |
327 | #[inline ] |
328 | unsafe fn from_glib(value: ffi::GstClockEntryType) -> Self { |
329 | skip_assert_initialized!(); |
330 | |
331 | match value { |
332 | ffi::GST_CLOCK_ENTRY_SINGLE => Self::Single, |
333 | ffi::GST_CLOCK_ENTRY_PERIODIC => Self::Periodic, |
334 | value: i32 => Self::__Unknown(value), |
335 | } |
336 | } |
337 | } |
338 | |
339 | impl StaticType for ClockEntryType { |
340 | #[inline ] |
341 | #[doc (alias = "gst_clock_entry_type_get_type" )] |
342 | fn static_type() -> glib::Type { |
343 | unsafe { from_glib(val:ffi::gst_clock_entry_type_get_type()) } |
344 | } |
345 | } |
346 | |
347 | impl glib::HasParamSpec for ClockEntryType { |
348 | type ParamSpec = glib::ParamSpecEnum; |
349 | type SetValue = Self; |
350 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
351 | |
352 | fn param_spec_builder() -> Self::BuilderFn { |
353 | Self::ParamSpec::builder_with_default |
354 | } |
355 | } |
356 | |
357 | impl glib::value::ValueType for ClockEntryType { |
358 | type Type = Self; |
359 | } |
360 | |
361 | unsafe impl<'a> glib::value::FromValue<'a> for ClockEntryType { |
362 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
363 | |
364 | #[inline ] |
365 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
366 | skip_assert_initialized!(); |
367 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
368 | } |
369 | } |
370 | |
371 | impl ToValue for ClockEntryType { |
372 | #[inline ] |
373 | fn to_value(&self) -> glib::Value { |
374 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
375 | unsafe { |
376 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
377 | } |
378 | value |
379 | } |
380 | |
381 | #[inline ] |
382 | fn value_type(&self) -> glib::Type { |
383 | Self::static_type() |
384 | } |
385 | } |
386 | |
387 | impl From<ClockEntryType> for glib::Value { |
388 | #[inline ] |
389 | fn from(v: ClockEntryType) -> Self { |
390 | skip_assert_initialized!(); |
391 | ToValue::to_value(&v) |
392 | } |
393 | } |
394 | |
395 | #[must_use ] |
396 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
397 | #[repr (i32)] |
398 | #[doc (alias = "GstClockReturn" )] |
399 | pub enum ClockReturn { |
400 | #[doc (alias = "GST_CLOCK_OK" )] |
401 | Ok = ffi::GST_CLOCK_OK, |
402 | #[doc (alias = "GST_CLOCK_EARLY" )] |
403 | Early = ffi::GST_CLOCK_EARLY, |
404 | #[doc (alias = "GST_CLOCK_UNSCHEDULED" )] |
405 | Unscheduled = ffi::GST_CLOCK_UNSCHEDULED, |
406 | #[doc (alias = "GST_CLOCK_BUSY" )] |
407 | Busy = ffi::GST_CLOCK_BUSY, |
408 | #[doc (alias = "GST_CLOCK_BADTIME" )] |
409 | Badtime = ffi::GST_CLOCK_BADTIME, |
410 | #[doc (alias = "GST_CLOCK_ERROR" )] |
411 | Error = ffi::GST_CLOCK_ERROR, |
412 | #[doc (alias = "GST_CLOCK_UNSUPPORTED" )] |
413 | Unsupported = ffi::GST_CLOCK_UNSUPPORTED, |
414 | #[doc (alias = "GST_CLOCK_DONE" )] |
415 | Done = ffi::GST_CLOCK_DONE, |
416 | } |
417 | |
418 | #[doc (hidden)] |
419 | impl IntoGlib for ClockReturn { |
420 | type GlibType = ffi::GstClockReturn; |
421 | |
422 | #[inline ] |
423 | fn into_glib(self) -> ffi::GstClockReturn { |
424 | self as ffi::GstClockReturn |
425 | } |
426 | } |
427 | |
428 | #[doc (hidden)] |
429 | impl FromGlib<ffi::GstClockReturn> for ClockReturn { |
430 | #[inline ] |
431 | unsafe fn from_glib(value: ffi::GstClockReturn) -> Self { |
432 | skip_assert_initialized!(); |
433 | |
434 | debug_assert!([ |
435 | ffi::GST_CLOCK_OK, |
436 | ffi::GST_CLOCK_EARLY, |
437 | ffi::GST_CLOCK_UNSCHEDULED, |
438 | ffi::GST_CLOCK_BUSY, |
439 | ffi::GST_CLOCK_BADTIME, |
440 | ffi::GST_CLOCK_ERROR, |
441 | ffi::GST_CLOCK_UNSUPPORTED, |
442 | ffi::GST_CLOCK_DONE |
443 | ] |
444 | .contains(&value)); |
445 | std::mem::transmute(src:value) |
446 | } |
447 | } |
448 | |
449 | impl StaticType for ClockReturn { |
450 | #[inline ] |
451 | #[doc (alias = "gst_clock_return_get_type" )] |
452 | fn static_type() -> glib::Type { |
453 | unsafe { from_glib(val:ffi::gst_clock_return_get_type()) } |
454 | } |
455 | } |
456 | |
457 | impl glib::HasParamSpec for ClockReturn { |
458 | type ParamSpec = glib::ParamSpecEnum; |
459 | type SetValue = Self; |
460 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
461 | |
462 | fn param_spec_builder() -> Self::BuilderFn { |
463 | Self::ParamSpec::builder_with_default |
464 | } |
465 | } |
466 | |
467 | impl glib::value::ValueType for ClockReturn { |
468 | type Type = Self; |
469 | } |
470 | |
471 | unsafe impl<'a> glib::value::FromValue<'a> for ClockReturn { |
472 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
473 | |
474 | #[inline ] |
475 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
476 | skip_assert_initialized!(); |
477 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
478 | } |
479 | } |
480 | |
481 | impl ToValue for ClockReturn { |
482 | #[inline ] |
483 | fn to_value(&self) -> glib::Value { |
484 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
485 | unsafe { |
486 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
487 | } |
488 | value |
489 | } |
490 | |
491 | #[inline ] |
492 | fn value_type(&self) -> glib::Type { |
493 | Self::static_type() |
494 | } |
495 | } |
496 | |
497 | impl From<ClockReturn> for glib::Value { |
498 | #[inline ] |
499 | fn from(v: ClockReturn) -> Self { |
500 | skip_assert_initialized!(); |
501 | ToValue::to_value(&v) |
502 | } |
503 | } |
504 | |
505 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
506 | #[non_exhaustive ] |
507 | #[doc (alias = "GstClockType" )] |
508 | pub enum ClockType { |
509 | #[doc (alias = "GST_CLOCK_TYPE_REALTIME" )] |
510 | Realtime, |
511 | #[doc (alias = "GST_CLOCK_TYPE_MONOTONIC" )] |
512 | Monotonic, |
513 | #[doc (alias = "GST_CLOCK_TYPE_OTHER" )] |
514 | Other, |
515 | #[cfg (feature = "v1_18" )] |
516 | #[cfg_attr (docsrs, doc(cfg(feature = "v1_18" )))] |
517 | #[doc (alias = "GST_CLOCK_TYPE_TAI" )] |
518 | Tai, |
519 | #[doc (hidden)] |
520 | __Unknown(i32), |
521 | } |
522 | |
523 | #[doc (hidden)] |
524 | impl IntoGlib for ClockType { |
525 | type GlibType = ffi::GstClockType; |
526 | |
527 | #[inline ] |
528 | fn into_glib(self) -> ffi::GstClockType { |
529 | match self { |
530 | Self::Realtime => ffi::GST_CLOCK_TYPE_REALTIME, |
531 | Self::Monotonic => ffi::GST_CLOCK_TYPE_MONOTONIC, |
532 | Self::Other => ffi::GST_CLOCK_TYPE_OTHER, |
533 | #[cfg (feature = "v1_18" )] |
534 | Self::Tai => ffi::GST_CLOCK_TYPE_TAI, |
535 | Self::__Unknown(value: i32) => value, |
536 | } |
537 | } |
538 | } |
539 | |
540 | #[doc (hidden)] |
541 | impl FromGlib<ffi::GstClockType> for ClockType { |
542 | #[inline ] |
543 | unsafe fn from_glib(value: ffi::GstClockType) -> Self { |
544 | skip_assert_initialized!(); |
545 | |
546 | match value { |
547 | ffi::GST_CLOCK_TYPE_REALTIME => Self::Realtime, |
548 | ffi::GST_CLOCK_TYPE_MONOTONIC => Self::Monotonic, |
549 | ffi::GST_CLOCK_TYPE_OTHER => Self::Other, |
550 | #[cfg (feature = "v1_18" )] |
551 | ffi::GST_CLOCK_TYPE_TAI => Self::Tai, |
552 | value: i32 => Self::__Unknown(value), |
553 | } |
554 | } |
555 | } |
556 | |
557 | impl StaticType for ClockType { |
558 | #[inline ] |
559 | #[doc (alias = "gst_clock_type_get_type" )] |
560 | fn static_type() -> glib::Type { |
561 | unsafe { from_glib(val:ffi::gst_clock_type_get_type()) } |
562 | } |
563 | } |
564 | |
565 | impl glib::HasParamSpec for ClockType { |
566 | type ParamSpec = glib::ParamSpecEnum; |
567 | type SetValue = Self; |
568 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
569 | |
570 | fn param_spec_builder() -> Self::BuilderFn { |
571 | Self::ParamSpec::builder_with_default |
572 | } |
573 | } |
574 | |
575 | impl glib::value::ValueType for ClockType { |
576 | type Type = Self; |
577 | } |
578 | |
579 | unsafe impl<'a> glib::value::FromValue<'a> for ClockType { |
580 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
581 | |
582 | #[inline ] |
583 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
584 | skip_assert_initialized!(); |
585 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
586 | } |
587 | } |
588 | |
589 | impl ToValue for ClockType { |
590 | #[inline ] |
591 | fn to_value(&self) -> glib::Value { |
592 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
593 | unsafe { |
594 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
595 | } |
596 | value |
597 | } |
598 | |
599 | #[inline ] |
600 | fn value_type(&self) -> glib::Type { |
601 | Self::static_type() |
602 | } |
603 | } |
604 | |
605 | impl From<ClockType> for glib::Value { |
606 | #[inline ] |
607 | fn from(v: ClockType) -> Self { |
608 | skip_assert_initialized!(); |
609 | ToValue::to_value(&v) |
610 | } |
611 | } |
612 | |
613 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
614 | #[non_exhaustive ] |
615 | #[doc (alias = "GstCoreError" )] |
616 | pub enum CoreError { |
617 | #[doc (alias = "GST_CORE_ERROR_FAILED" )] |
618 | Failed, |
619 | #[doc (alias = "GST_CORE_ERROR_TOO_LAZY" )] |
620 | TooLazy, |
621 | #[doc (alias = "GST_CORE_ERROR_NOT_IMPLEMENTED" )] |
622 | NotImplemented, |
623 | #[doc (alias = "GST_CORE_ERROR_STATE_CHANGE" )] |
624 | StateChange, |
625 | #[doc (alias = "GST_CORE_ERROR_PAD" )] |
626 | Pad, |
627 | #[doc (alias = "GST_CORE_ERROR_THREAD" )] |
628 | Thread, |
629 | #[doc (alias = "GST_CORE_ERROR_NEGOTIATION" )] |
630 | Negotiation, |
631 | #[doc (alias = "GST_CORE_ERROR_EVENT" )] |
632 | Event, |
633 | #[doc (alias = "GST_CORE_ERROR_SEEK" )] |
634 | Seek, |
635 | #[doc (alias = "GST_CORE_ERROR_CAPS" )] |
636 | Caps, |
637 | #[doc (alias = "GST_CORE_ERROR_TAG" )] |
638 | Tag, |
639 | #[doc (alias = "GST_CORE_ERROR_MISSING_PLUGIN" )] |
640 | MissingPlugin, |
641 | #[doc (alias = "GST_CORE_ERROR_CLOCK" )] |
642 | Clock, |
643 | #[doc (alias = "GST_CORE_ERROR_DISABLED" )] |
644 | Disabled, |
645 | #[doc (hidden)] |
646 | __Unknown(i32), |
647 | } |
648 | |
649 | #[doc (hidden)] |
650 | impl IntoGlib for CoreError { |
651 | type GlibType = ffi::GstCoreError; |
652 | |
653 | fn into_glib(self) -> ffi::GstCoreError { |
654 | match self { |
655 | Self::Failed => ffi::GST_CORE_ERROR_FAILED, |
656 | Self::TooLazy => ffi::GST_CORE_ERROR_TOO_LAZY, |
657 | Self::NotImplemented => ffi::GST_CORE_ERROR_NOT_IMPLEMENTED, |
658 | Self::StateChange => ffi::GST_CORE_ERROR_STATE_CHANGE, |
659 | Self::Pad => ffi::GST_CORE_ERROR_PAD, |
660 | Self::Thread => ffi::GST_CORE_ERROR_THREAD, |
661 | Self::Negotiation => ffi::GST_CORE_ERROR_NEGOTIATION, |
662 | Self::Event => ffi::GST_CORE_ERROR_EVENT, |
663 | Self::Seek => ffi::GST_CORE_ERROR_SEEK, |
664 | Self::Caps => ffi::GST_CORE_ERROR_CAPS, |
665 | Self::Tag => ffi::GST_CORE_ERROR_TAG, |
666 | Self::MissingPlugin => ffi::GST_CORE_ERROR_MISSING_PLUGIN, |
667 | Self::Clock => ffi::GST_CORE_ERROR_CLOCK, |
668 | Self::Disabled => ffi::GST_CORE_ERROR_DISABLED, |
669 | Self::__Unknown(value: i32) => value, |
670 | } |
671 | } |
672 | } |
673 | |
674 | #[doc (hidden)] |
675 | impl FromGlib<ffi::GstCoreError> for CoreError { |
676 | unsafe fn from_glib(value: ffi::GstCoreError) -> Self { |
677 | skip_assert_initialized!(); |
678 | |
679 | match value { |
680 | ffi::GST_CORE_ERROR_FAILED => Self::Failed, |
681 | ffi::GST_CORE_ERROR_TOO_LAZY => Self::TooLazy, |
682 | ffi::GST_CORE_ERROR_NOT_IMPLEMENTED => Self::NotImplemented, |
683 | ffi::GST_CORE_ERROR_STATE_CHANGE => Self::StateChange, |
684 | ffi::GST_CORE_ERROR_PAD => Self::Pad, |
685 | ffi::GST_CORE_ERROR_THREAD => Self::Thread, |
686 | ffi::GST_CORE_ERROR_NEGOTIATION => Self::Negotiation, |
687 | ffi::GST_CORE_ERROR_EVENT => Self::Event, |
688 | ffi::GST_CORE_ERROR_SEEK => Self::Seek, |
689 | ffi::GST_CORE_ERROR_CAPS => Self::Caps, |
690 | ffi::GST_CORE_ERROR_TAG => Self::Tag, |
691 | ffi::GST_CORE_ERROR_MISSING_PLUGIN => Self::MissingPlugin, |
692 | ffi::GST_CORE_ERROR_CLOCK => Self::Clock, |
693 | ffi::GST_CORE_ERROR_DISABLED => Self::Disabled, |
694 | value: i32 => Self::__Unknown(value), |
695 | } |
696 | } |
697 | } |
698 | |
699 | impl glib::error::ErrorDomain for CoreError { |
700 | #[inline ] |
701 | fn domain() -> glib::Quark { |
702 | skip_assert_initialized!(); |
703 | |
704 | unsafe { from_glib(val:ffi::gst_core_error_quark()) } |
705 | } |
706 | |
707 | #[inline ] |
708 | fn code(self) -> i32 { |
709 | self.into_glib() |
710 | } |
711 | |
712 | #[inline ] |
713 | #[allow (clippy::match_single_binding)] |
714 | fn from(code: i32) -> Option<Self> { |
715 | skip_assert_initialized!(); |
716 | match unsafe { from_glib(val:code) } { |
717 | Self::__Unknown(_) => Some(Self::Failed), |
718 | value: CoreError => Some(value), |
719 | } |
720 | } |
721 | } |
722 | |
723 | impl StaticType for CoreError { |
724 | #[inline ] |
725 | #[doc (alias = "gst_core_error_get_type" )] |
726 | fn static_type() -> glib::Type { |
727 | unsafe { from_glib(val:ffi::gst_core_error_get_type()) } |
728 | } |
729 | } |
730 | |
731 | impl glib::HasParamSpec for CoreError { |
732 | type ParamSpec = glib::ParamSpecEnum; |
733 | type SetValue = Self; |
734 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
735 | |
736 | fn param_spec_builder() -> Self::BuilderFn { |
737 | Self::ParamSpec::builder_with_default |
738 | } |
739 | } |
740 | |
741 | impl glib::value::ValueType for CoreError { |
742 | type Type = Self; |
743 | } |
744 | |
745 | unsafe impl<'a> glib::value::FromValue<'a> for CoreError { |
746 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
747 | |
748 | #[inline ] |
749 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
750 | skip_assert_initialized!(); |
751 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
752 | } |
753 | } |
754 | |
755 | impl ToValue for CoreError { |
756 | #[inline ] |
757 | fn to_value(&self) -> glib::Value { |
758 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
759 | unsafe { |
760 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
761 | } |
762 | value |
763 | } |
764 | |
765 | #[inline ] |
766 | fn value_type(&self) -> glib::Type { |
767 | Self::static_type() |
768 | } |
769 | } |
770 | |
771 | impl From<CoreError> for glib::Value { |
772 | #[inline ] |
773 | fn from(v: CoreError) -> Self { |
774 | skip_assert_initialized!(); |
775 | ToValue::to_value(&v) |
776 | } |
777 | } |
778 | |
779 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
780 | #[non_exhaustive ] |
781 | #[doc (alias = "GstDebugLevel" )] |
782 | pub enum DebugLevel { |
783 | #[doc (alias = "GST_LEVEL_NONE" )] |
784 | None, |
785 | #[doc (alias = "GST_LEVEL_ERROR" )] |
786 | Error, |
787 | #[doc (alias = "GST_LEVEL_WARNING" )] |
788 | Warning, |
789 | #[doc (alias = "GST_LEVEL_FIXME" )] |
790 | Fixme, |
791 | #[doc (alias = "GST_LEVEL_INFO" )] |
792 | Info, |
793 | #[doc (alias = "GST_LEVEL_DEBUG" )] |
794 | Debug, |
795 | #[doc (alias = "GST_LEVEL_LOG" )] |
796 | Log, |
797 | #[doc (alias = "GST_LEVEL_TRACE" )] |
798 | Trace, |
799 | #[doc (alias = "GST_LEVEL_MEMDUMP" )] |
800 | Memdump, |
801 | #[doc (hidden)] |
802 | __Unknown(i32), |
803 | } |
804 | |
805 | impl DebugLevel { |
806 | pub fn name<'a>(self) -> &'a GStr { |
807 | unsafe { |
808 | GStr::from_ptr( |
809 | ffi::gst_debug_level_get_name(self.into_glib()) |
810 | .as_ref() |
811 | .expect(msg:"gst_debug_level_get_name returned NULL" ), |
812 | ) |
813 | } |
814 | } |
815 | } |
816 | |
817 | impl fmt::Display for DebugLevel { |
818 | #[inline ] |
819 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
820 | f.write_str(&self.name()) |
821 | } |
822 | } |
823 | |
824 | #[doc (hidden)] |
825 | impl IntoGlib for DebugLevel { |
826 | type GlibType = ffi::GstDebugLevel; |
827 | |
828 | #[inline ] |
829 | fn into_glib(self) -> ffi::GstDebugLevel { |
830 | match self { |
831 | Self::None => ffi::GST_LEVEL_NONE, |
832 | Self::Error => ffi::GST_LEVEL_ERROR, |
833 | Self::Warning => ffi::GST_LEVEL_WARNING, |
834 | Self::Fixme => ffi::GST_LEVEL_FIXME, |
835 | Self::Info => ffi::GST_LEVEL_INFO, |
836 | Self::Debug => ffi::GST_LEVEL_DEBUG, |
837 | Self::Log => ffi::GST_LEVEL_LOG, |
838 | Self::Trace => ffi::GST_LEVEL_TRACE, |
839 | Self::Memdump => ffi::GST_LEVEL_MEMDUMP, |
840 | Self::__Unknown(value: i32) => value, |
841 | } |
842 | } |
843 | } |
844 | |
845 | #[doc (hidden)] |
846 | impl FromGlib<ffi::GstDebugLevel> for DebugLevel { |
847 | #[inline ] |
848 | unsafe fn from_glib(value: ffi::GstDebugLevel) -> Self { |
849 | skip_assert_initialized!(); |
850 | |
851 | match value { |
852 | ffi::GST_LEVEL_NONE => Self::None, |
853 | ffi::GST_LEVEL_ERROR => Self::Error, |
854 | ffi::GST_LEVEL_WARNING => Self::Warning, |
855 | ffi::GST_LEVEL_FIXME => Self::Fixme, |
856 | ffi::GST_LEVEL_INFO => Self::Info, |
857 | ffi::GST_LEVEL_DEBUG => Self::Debug, |
858 | ffi::GST_LEVEL_LOG => Self::Log, |
859 | ffi::GST_LEVEL_TRACE => Self::Trace, |
860 | ffi::GST_LEVEL_MEMDUMP => Self::Memdump, |
861 | value: i32 => Self::__Unknown(value), |
862 | } |
863 | } |
864 | } |
865 | |
866 | impl StaticType for DebugLevel { |
867 | #[inline ] |
868 | #[doc (alias = "gst_debug_level_get_type" )] |
869 | fn static_type() -> glib::Type { |
870 | unsafe { from_glib(val:ffi::gst_debug_level_get_type()) } |
871 | } |
872 | } |
873 | |
874 | impl glib::HasParamSpec for DebugLevel { |
875 | type ParamSpec = glib::ParamSpecEnum; |
876 | type SetValue = Self; |
877 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
878 | |
879 | fn param_spec_builder() -> Self::BuilderFn { |
880 | Self::ParamSpec::builder_with_default |
881 | } |
882 | } |
883 | |
884 | impl glib::value::ValueType for DebugLevel { |
885 | type Type = Self; |
886 | } |
887 | |
888 | unsafe impl<'a> glib::value::FromValue<'a> for DebugLevel { |
889 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
890 | |
891 | #[inline ] |
892 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
893 | skip_assert_initialized!(); |
894 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
895 | } |
896 | } |
897 | |
898 | impl ToValue for DebugLevel { |
899 | #[inline ] |
900 | fn to_value(&self) -> glib::Value { |
901 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
902 | unsafe { |
903 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
904 | } |
905 | value |
906 | } |
907 | |
908 | #[inline ] |
909 | fn value_type(&self) -> glib::Type { |
910 | Self::static_type() |
911 | } |
912 | } |
913 | |
914 | impl From<DebugLevel> for glib::Value { |
915 | #[inline ] |
916 | fn from(v: DebugLevel) -> Self { |
917 | skip_assert_initialized!(); |
918 | ToValue::to_value(&v) |
919 | } |
920 | } |
921 | |
922 | #[derive (Debug, PartialEq, Eq, Hash, Clone, Copy)] |
923 | #[non_exhaustive ] |
924 | #[doc (alias = "GstEventType" )] |
925 | pub enum EventType { |
926 | #[doc (alias = "GST_EVENT_UNKNOWN" )] |
927 | Unknown, |
928 | #[doc (alias = "GST_EVENT_FLUSH_START" )] |
929 | FlushStart, |
930 | #[doc (alias = "GST_EVENT_FLUSH_STOP" )] |
931 | FlushStop, |
932 | #[doc (alias = "GST_EVENT_STREAM_START" )] |
933 | StreamStart, |
934 | #[doc (alias = "GST_EVENT_CAPS" )] |
935 | Caps, |
936 | #[doc (alias = "GST_EVENT_SEGMENT" )] |
937 | Segment, |
938 | #[doc (alias = "GST_EVENT_STREAM_COLLECTION" )] |
939 | StreamCollection, |
940 | #[doc (alias = "GST_EVENT_TAG" )] |
941 | Tag, |
942 | #[doc (alias = "GST_EVENT_BUFFERSIZE" )] |
943 | Buffersize, |
944 | #[doc (alias = "GST_EVENT_SINK_MESSAGE" )] |
945 | SinkMessage, |
946 | #[doc (alias = "GST_EVENT_STREAM_GROUP_DONE" )] |
947 | StreamGroupDone, |
948 | #[doc (alias = "GST_EVENT_EOS" )] |
949 | Eos, |
950 | #[doc (alias = "GST_EVENT_TOC" )] |
951 | Toc, |
952 | #[doc (alias = "GST_EVENT_PROTECTION" )] |
953 | Protection, |
954 | #[doc (alias = "GST_EVENT_SEGMENT_DONE" )] |
955 | SegmentDone, |
956 | #[doc (alias = "GST_EVENT_GAP" )] |
957 | Gap, |
958 | #[cfg (feature = "v1_18" )] |
959 | #[cfg_attr (docsrs, doc(cfg(feature = "v1_18" )))] |
960 | #[doc (alias = "GST_EVENT_INSTANT_RATE_CHANGE" )] |
961 | InstantRateChange, |
962 | #[doc (alias = "GST_EVENT_QOS" )] |
963 | Qos, |
964 | #[doc (alias = "GST_EVENT_SEEK" )] |
965 | Seek, |
966 | #[doc (alias = "GST_EVENT_NAVIGATION" )] |
967 | Navigation, |
968 | #[doc (alias = "GST_EVENT_LATENCY" )] |
969 | Latency, |
970 | #[doc (alias = "GST_EVENT_STEP" )] |
971 | Step, |
972 | #[doc (alias = "GST_EVENT_RECONFIGURE" )] |
973 | Reconfigure, |
974 | #[doc (alias = "GST_EVENT_TOC_SELECT" )] |
975 | TocSelect, |
976 | #[doc (alias = "GST_EVENT_SELECT_STREAMS" )] |
977 | SelectStreams, |
978 | #[cfg (feature = "v1_18" )] |
979 | #[cfg_attr (docsrs, doc(cfg(feature = "v1_18" )))] |
980 | #[doc (alias = "GST_EVENT_INSTANT_RATE_SYNC_TIME" )] |
981 | InstantRateSyncTime, |
982 | #[doc (alias = "GST_EVENT_CUSTOM_UPSTREAM" )] |
983 | CustomUpstream, |
984 | #[doc (alias = "GST_EVENT_CUSTOM_DOWNSTREAM" )] |
985 | CustomDownstream, |
986 | #[doc (alias = "GST_EVENT_CUSTOM_DOWNSTREAM_OOB" )] |
987 | CustomDownstreamOob, |
988 | #[doc (alias = "GST_EVENT_CUSTOM_DOWNSTREAM_STICKY" )] |
989 | CustomDownstreamSticky, |
990 | #[doc (alias = "GST_EVENT_CUSTOM_BOTH" )] |
991 | CustomBoth, |
992 | #[doc (alias = "GST_EVENT_CUSTOM_BOTH_OOB" )] |
993 | CustomBothOob, |
994 | #[doc (hidden)] |
995 | __Unknown(i32), |
996 | } |
997 | |
998 | impl EventType { |
999 | #[doc (alias = "gst_event_type_get_flags" )] |
1000 | #[doc (alias = "get_flags" )] |
1001 | pub fn flags(self) -> EventTypeFlags { |
1002 | assert_initialized_main_thread!(); |
1003 | unsafe { from_glib(val:ffi::gst_event_type_get_flags(self.into_glib())) } |
1004 | } |
1005 | |
1006 | pub fn name<'a>(self) -> &'a GStr { |
1007 | unsafe { |
1008 | GStr::from_ptr( |
1009 | ffi::gst_event_type_get_name(self.into_glib()) |
1010 | .as_ref() |
1011 | .expect(msg:"gst_event_type_get_name returned NULL" ), |
1012 | ) |
1013 | } |
1014 | } |
1015 | |
1016 | #[doc (alias = "gst_event_type_to_quark" )] |
1017 | pub fn to_quark(self) -> glib::Quark { |
1018 | assert_initialized_main_thread!(); |
1019 | unsafe { from_glib(val:ffi::gst_event_type_to_quark(self.into_glib())) } |
1020 | } |
1021 | } |
1022 | |
1023 | impl fmt::Display for EventType { |
1024 | #[inline ] |
1025 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
1026 | f.write_str(&self.name()) |
1027 | } |
1028 | } |
1029 | |
1030 | #[doc (hidden)] |
1031 | impl IntoGlib for EventType { |
1032 | type GlibType = ffi::GstEventType; |
1033 | |
1034 | fn into_glib(self) -> ffi::GstEventType { |
1035 | match self { |
1036 | Self::Unknown => ffi::GST_EVENT_UNKNOWN, |
1037 | Self::FlushStart => ffi::GST_EVENT_FLUSH_START, |
1038 | Self::FlushStop => ffi::GST_EVENT_FLUSH_STOP, |
1039 | Self::StreamStart => ffi::GST_EVENT_STREAM_START, |
1040 | Self::Caps => ffi::GST_EVENT_CAPS, |
1041 | Self::Segment => ffi::GST_EVENT_SEGMENT, |
1042 | Self::StreamCollection => ffi::GST_EVENT_STREAM_COLLECTION, |
1043 | Self::Tag => ffi::GST_EVENT_TAG, |
1044 | Self::Buffersize => ffi::GST_EVENT_BUFFERSIZE, |
1045 | Self::SinkMessage => ffi::GST_EVENT_SINK_MESSAGE, |
1046 | Self::StreamGroupDone => ffi::GST_EVENT_STREAM_GROUP_DONE, |
1047 | Self::Eos => ffi::GST_EVENT_EOS, |
1048 | Self::Toc => ffi::GST_EVENT_TOC, |
1049 | Self::Protection => ffi::GST_EVENT_PROTECTION, |
1050 | Self::SegmentDone => ffi::GST_EVENT_SEGMENT_DONE, |
1051 | Self::Gap => ffi::GST_EVENT_GAP, |
1052 | #[cfg (feature = "v1_18" )] |
1053 | Self::InstantRateChange => ffi::GST_EVENT_INSTANT_RATE_CHANGE, |
1054 | Self::Qos => ffi::GST_EVENT_QOS, |
1055 | Self::Seek => ffi::GST_EVENT_SEEK, |
1056 | Self::Navigation => ffi::GST_EVENT_NAVIGATION, |
1057 | Self::Latency => ffi::GST_EVENT_LATENCY, |
1058 | Self::Step => ffi::GST_EVENT_STEP, |
1059 | Self::Reconfigure => ffi::GST_EVENT_RECONFIGURE, |
1060 | Self::TocSelect => ffi::GST_EVENT_TOC_SELECT, |
1061 | Self::SelectStreams => ffi::GST_EVENT_SELECT_STREAMS, |
1062 | #[cfg (feature = "v1_18" )] |
1063 | Self::InstantRateSyncTime => ffi::GST_EVENT_INSTANT_RATE_SYNC_TIME, |
1064 | Self::CustomUpstream => ffi::GST_EVENT_CUSTOM_UPSTREAM, |
1065 | Self::CustomDownstream => ffi::GST_EVENT_CUSTOM_DOWNSTREAM, |
1066 | Self::CustomDownstreamOob => ffi::GST_EVENT_CUSTOM_DOWNSTREAM_OOB, |
1067 | Self::CustomDownstreamSticky => ffi::GST_EVENT_CUSTOM_DOWNSTREAM_STICKY, |
1068 | Self::CustomBoth => ffi::GST_EVENT_CUSTOM_BOTH, |
1069 | Self::CustomBothOob => ffi::GST_EVENT_CUSTOM_BOTH_OOB, |
1070 | Self::__Unknown(value) => value, |
1071 | } |
1072 | } |
1073 | } |
1074 | |
1075 | #[doc (hidden)] |
1076 | impl FromGlib<ffi::GstEventType> for EventType { |
1077 | unsafe fn from_glib(value: ffi::GstEventType) -> Self { |
1078 | skip_assert_initialized!(); |
1079 | |
1080 | match value { |
1081 | ffi::GST_EVENT_UNKNOWN => Self::Unknown, |
1082 | ffi::GST_EVENT_FLUSH_START => Self::FlushStart, |
1083 | ffi::GST_EVENT_FLUSH_STOP => Self::FlushStop, |
1084 | ffi::GST_EVENT_STREAM_START => Self::StreamStart, |
1085 | ffi::GST_EVENT_CAPS => Self::Caps, |
1086 | ffi::GST_EVENT_SEGMENT => Self::Segment, |
1087 | ffi::GST_EVENT_STREAM_COLLECTION => Self::StreamCollection, |
1088 | ffi::GST_EVENT_TAG => Self::Tag, |
1089 | ffi::GST_EVENT_BUFFERSIZE => Self::Buffersize, |
1090 | ffi::GST_EVENT_SINK_MESSAGE => Self::SinkMessage, |
1091 | ffi::GST_EVENT_STREAM_GROUP_DONE => Self::StreamGroupDone, |
1092 | ffi::GST_EVENT_EOS => Self::Eos, |
1093 | ffi::GST_EVENT_TOC => Self::Toc, |
1094 | ffi::GST_EVENT_PROTECTION => Self::Protection, |
1095 | ffi::GST_EVENT_SEGMENT_DONE => Self::SegmentDone, |
1096 | ffi::GST_EVENT_GAP => Self::Gap, |
1097 | #[cfg (feature = "v1_18" )] |
1098 | ffi::GST_EVENT_INSTANT_RATE_CHANGE => Self::InstantRateChange, |
1099 | ffi::GST_EVENT_QOS => Self::Qos, |
1100 | ffi::GST_EVENT_SEEK => Self::Seek, |
1101 | ffi::GST_EVENT_NAVIGATION => Self::Navigation, |
1102 | ffi::GST_EVENT_LATENCY => Self::Latency, |
1103 | ffi::GST_EVENT_STEP => Self::Step, |
1104 | ffi::GST_EVENT_RECONFIGURE => Self::Reconfigure, |
1105 | ffi::GST_EVENT_TOC_SELECT => Self::TocSelect, |
1106 | ffi::GST_EVENT_SELECT_STREAMS => Self::SelectStreams, |
1107 | #[cfg (feature = "v1_18" )] |
1108 | ffi::GST_EVENT_INSTANT_RATE_SYNC_TIME => Self::InstantRateSyncTime, |
1109 | ffi::GST_EVENT_CUSTOM_UPSTREAM => Self::CustomUpstream, |
1110 | ffi::GST_EVENT_CUSTOM_DOWNSTREAM => Self::CustomDownstream, |
1111 | ffi::GST_EVENT_CUSTOM_DOWNSTREAM_OOB => Self::CustomDownstreamOob, |
1112 | ffi::GST_EVENT_CUSTOM_DOWNSTREAM_STICKY => Self::CustomDownstreamSticky, |
1113 | ffi::GST_EVENT_CUSTOM_BOTH => Self::CustomBoth, |
1114 | ffi::GST_EVENT_CUSTOM_BOTH_OOB => Self::CustomBothOob, |
1115 | value => Self::__Unknown(value), |
1116 | } |
1117 | } |
1118 | } |
1119 | |
1120 | impl StaticType for EventType { |
1121 | #[inline ] |
1122 | #[doc (alias = "gst_event_type_get_type" )] |
1123 | fn static_type() -> glib::Type { |
1124 | unsafe { from_glib(val:ffi::gst_event_type_get_type()) } |
1125 | } |
1126 | } |
1127 | |
1128 | impl glib::HasParamSpec for EventType { |
1129 | type ParamSpec = glib::ParamSpecEnum; |
1130 | type SetValue = Self; |
1131 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
1132 | |
1133 | fn param_spec_builder() -> Self::BuilderFn { |
1134 | Self::ParamSpec::builder_with_default |
1135 | } |
1136 | } |
1137 | |
1138 | impl glib::value::ValueType for EventType { |
1139 | type Type = Self; |
1140 | } |
1141 | |
1142 | unsafe impl<'a> glib::value::FromValue<'a> for EventType { |
1143 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
1144 | |
1145 | #[inline ] |
1146 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
1147 | skip_assert_initialized!(); |
1148 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
1149 | } |
1150 | } |
1151 | |
1152 | impl ToValue for EventType { |
1153 | #[inline ] |
1154 | fn to_value(&self) -> glib::Value { |
1155 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
1156 | unsafe { |
1157 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
1158 | } |
1159 | value |
1160 | } |
1161 | |
1162 | #[inline ] |
1163 | fn value_type(&self) -> glib::Type { |
1164 | Self::static_type() |
1165 | } |
1166 | } |
1167 | |
1168 | impl From<EventType> for glib::Value { |
1169 | #[inline ] |
1170 | fn from(v: EventType) -> Self { |
1171 | skip_assert_initialized!(); |
1172 | ToValue::to_value(&v) |
1173 | } |
1174 | } |
1175 | |
1176 | #[cfg_attr (feature = "serde" , derive(serde::Serialize, serde::Deserialize))] |
1177 | #[derive (Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)] |
1178 | #[non_exhaustive ] |
1179 | #[doc (alias = "GstFormat" )] |
1180 | pub enum Format { |
1181 | #[doc (alias = "GST_FORMAT_UNDEFINED" )] |
1182 | Undefined, |
1183 | #[doc (alias = "GST_FORMAT_DEFAULT" )] |
1184 | Default, |
1185 | #[doc (alias = "GST_FORMAT_BYTES" )] |
1186 | Bytes, |
1187 | #[doc (alias = "GST_FORMAT_TIME" )] |
1188 | Time, |
1189 | #[doc (alias = "GST_FORMAT_BUFFERS" )] |
1190 | Buffers, |
1191 | #[doc (alias = "GST_FORMAT_PERCENT" )] |
1192 | Percent, |
1193 | #[doc (hidden)] |
1194 | __Unknown(i32), |
1195 | } |
1196 | |
1197 | impl Format { |
1198 | #[doc (alias = "gst_format_get_by_nick" )] |
1199 | #[doc (alias = "get_by_nick" )] |
1200 | pub fn by_nick(nick: &str) -> Format { |
1201 | assert_initialized_main_thread!(); |
1202 | unsafe { from_glib(ffi::gst_format_get_by_nick(nick.to_glib_none().0)) } |
1203 | } |
1204 | |
1205 | //#[doc(alias = "gst_format_get_details")] |
1206 | //#[doc(alias = "get_details")] |
1207 | //pub fn details(self) -> /*Ignored*/Option<FormatDefinition> { |
1208 | // unsafe { TODO: call ffi:gst_format_get_details() } |
1209 | //} |
1210 | |
1211 | #[doc (alias = "gst_format_get_name" )] |
1212 | #[doc (alias = "get_name" )] |
1213 | pub fn name(self) -> Option<glib::GString> { |
1214 | assert_initialized_main_thread!(); |
1215 | unsafe { from_glib_none(ffi::gst_format_get_name(self.into_glib())) } |
1216 | } |
1217 | |
1218 | //#[doc(alias = "gst_format_iterate_definitions")] |
1219 | //pub fn iterate_definitions() -> /*Ignored*/Iterator { |
1220 | // unsafe { TODO: call ffi:gst_format_iterate_definitions() } |
1221 | //} |
1222 | |
1223 | #[doc (alias = "gst_format_to_quark" )] |
1224 | pub fn to_quark(self) -> glib::Quark { |
1225 | assert_initialized_main_thread!(); |
1226 | unsafe { from_glib(ffi::gst_format_to_quark(self.into_glib())) } |
1227 | } |
1228 | } |
1229 | |
1230 | #[doc (hidden)] |
1231 | impl IntoGlib for Format { |
1232 | type GlibType = ffi::GstFormat; |
1233 | |
1234 | #[inline ] |
1235 | fn into_glib(self) -> ffi::GstFormat { |
1236 | match self { |
1237 | Self::Undefined => ffi::GST_FORMAT_UNDEFINED, |
1238 | Self::Default => ffi::GST_FORMAT_DEFAULT, |
1239 | Self::Bytes => ffi::GST_FORMAT_BYTES, |
1240 | Self::Time => ffi::GST_FORMAT_TIME, |
1241 | Self::Buffers => ffi::GST_FORMAT_BUFFERS, |
1242 | Self::Percent => ffi::GST_FORMAT_PERCENT, |
1243 | Self::__Unknown(value: i32) => value, |
1244 | } |
1245 | } |
1246 | } |
1247 | |
1248 | #[doc (hidden)] |
1249 | impl FromGlib<ffi::GstFormat> for Format { |
1250 | #[inline ] |
1251 | unsafe fn from_glib(value: ffi::GstFormat) -> Self { |
1252 | skip_assert_initialized!(); |
1253 | |
1254 | match value { |
1255 | ffi::GST_FORMAT_UNDEFINED => Self::Undefined, |
1256 | ffi::GST_FORMAT_DEFAULT => Self::Default, |
1257 | ffi::GST_FORMAT_BYTES => Self::Bytes, |
1258 | ffi::GST_FORMAT_TIME => Self::Time, |
1259 | ffi::GST_FORMAT_BUFFERS => Self::Buffers, |
1260 | ffi::GST_FORMAT_PERCENT => Self::Percent, |
1261 | value: i32 => Self::__Unknown(value), |
1262 | } |
1263 | } |
1264 | } |
1265 | |
1266 | impl StaticType for Format { |
1267 | #[inline ] |
1268 | #[doc (alias = "gst_format_get_type" )] |
1269 | fn static_type() -> glib::Type { |
1270 | unsafe { from_glib(val:ffi::gst_format_get_type()) } |
1271 | } |
1272 | } |
1273 | |
1274 | impl glib::HasParamSpec for Format { |
1275 | type ParamSpec = glib::ParamSpecEnum; |
1276 | type SetValue = Self; |
1277 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
1278 | |
1279 | fn param_spec_builder() -> Self::BuilderFn { |
1280 | Self::ParamSpec::builder_with_default |
1281 | } |
1282 | } |
1283 | |
1284 | impl glib::value::ValueType for Format { |
1285 | type Type = Self; |
1286 | } |
1287 | |
1288 | unsafe impl<'a> glib::value::FromValue<'a> for Format { |
1289 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
1290 | |
1291 | #[inline ] |
1292 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
1293 | skip_assert_initialized!(); |
1294 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
1295 | } |
1296 | } |
1297 | |
1298 | impl ToValue for Format { |
1299 | #[inline ] |
1300 | fn to_value(&self) -> glib::Value { |
1301 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
1302 | unsafe { |
1303 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
1304 | } |
1305 | value |
1306 | } |
1307 | |
1308 | #[inline ] |
1309 | fn value_type(&self) -> glib::Type { |
1310 | Self::static_type() |
1311 | } |
1312 | } |
1313 | |
1314 | impl From<Format> for glib::Value { |
1315 | #[inline ] |
1316 | fn from(v: Format) -> Self { |
1317 | skip_assert_initialized!(); |
1318 | ToValue::to_value(&v) |
1319 | } |
1320 | } |
1321 | |
1322 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
1323 | #[non_exhaustive ] |
1324 | #[doc (alias = "GstLibraryError" )] |
1325 | pub enum LibraryError { |
1326 | #[doc (alias = "GST_LIBRARY_ERROR_FAILED" )] |
1327 | Failed, |
1328 | #[doc (alias = "GST_LIBRARY_ERROR_TOO_LAZY" )] |
1329 | TooLazy, |
1330 | #[doc (alias = "GST_LIBRARY_ERROR_INIT" )] |
1331 | Init, |
1332 | #[doc (alias = "GST_LIBRARY_ERROR_SHUTDOWN" )] |
1333 | Shutdown, |
1334 | #[doc (alias = "GST_LIBRARY_ERROR_SETTINGS" )] |
1335 | Settings, |
1336 | #[doc (alias = "GST_LIBRARY_ERROR_ENCODE" )] |
1337 | Encode, |
1338 | #[doc (hidden)] |
1339 | __Unknown(i32), |
1340 | } |
1341 | |
1342 | #[doc (hidden)] |
1343 | impl IntoGlib for LibraryError { |
1344 | type GlibType = ffi::GstLibraryError; |
1345 | |
1346 | #[inline ] |
1347 | fn into_glib(self) -> ffi::GstLibraryError { |
1348 | match self { |
1349 | Self::Failed => ffi::GST_LIBRARY_ERROR_FAILED, |
1350 | Self::TooLazy => ffi::GST_LIBRARY_ERROR_TOO_LAZY, |
1351 | Self::Init => ffi::GST_LIBRARY_ERROR_INIT, |
1352 | Self::Shutdown => ffi::GST_LIBRARY_ERROR_SHUTDOWN, |
1353 | Self::Settings => ffi::GST_LIBRARY_ERROR_SETTINGS, |
1354 | Self::Encode => ffi::GST_LIBRARY_ERROR_ENCODE, |
1355 | Self::__Unknown(value: i32) => value, |
1356 | } |
1357 | } |
1358 | } |
1359 | |
1360 | #[doc (hidden)] |
1361 | impl FromGlib<ffi::GstLibraryError> for LibraryError { |
1362 | #[inline ] |
1363 | unsafe fn from_glib(value: ffi::GstLibraryError) -> Self { |
1364 | skip_assert_initialized!(); |
1365 | |
1366 | match value { |
1367 | ffi::GST_LIBRARY_ERROR_FAILED => Self::Failed, |
1368 | ffi::GST_LIBRARY_ERROR_TOO_LAZY => Self::TooLazy, |
1369 | ffi::GST_LIBRARY_ERROR_INIT => Self::Init, |
1370 | ffi::GST_LIBRARY_ERROR_SHUTDOWN => Self::Shutdown, |
1371 | ffi::GST_LIBRARY_ERROR_SETTINGS => Self::Settings, |
1372 | ffi::GST_LIBRARY_ERROR_ENCODE => Self::Encode, |
1373 | value: i32 => Self::__Unknown(value), |
1374 | } |
1375 | } |
1376 | } |
1377 | |
1378 | impl glib::error::ErrorDomain for LibraryError { |
1379 | #[inline ] |
1380 | fn domain() -> glib::Quark { |
1381 | skip_assert_initialized!(); |
1382 | |
1383 | unsafe { from_glib(val:ffi::gst_library_error_quark()) } |
1384 | } |
1385 | |
1386 | #[inline ] |
1387 | fn code(self) -> i32 { |
1388 | self.into_glib() |
1389 | } |
1390 | |
1391 | #[inline ] |
1392 | #[allow (clippy::match_single_binding)] |
1393 | fn from(code: i32) -> Option<Self> { |
1394 | skip_assert_initialized!(); |
1395 | match unsafe { from_glib(val:code) } { |
1396 | Self::__Unknown(_) => Some(Self::Failed), |
1397 | value: LibraryError => Some(value), |
1398 | } |
1399 | } |
1400 | } |
1401 | |
1402 | impl StaticType for LibraryError { |
1403 | #[inline ] |
1404 | #[doc (alias = "gst_library_error_get_type" )] |
1405 | fn static_type() -> glib::Type { |
1406 | unsafe { from_glib(val:ffi::gst_library_error_get_type()) } |
1407 | } |
1408 | } |
1409 | |
1410 | impl glib::HasParamSpec for LibraryError { |
1411 | type ParamSpec = glib::ParamSpecEnum; |
1412 | type SetValue = Self; |
1413 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
1414 | |
1415 | fn param_spec_builder() -> Self::BuilderFn { |
1416 | Self::ParamSpec::builder_with_default |
1417 | } |
1418 | } |
1419 | |
1420 | impl glib::value::ValueType for LibraryError { |
1421 | type Type = Self; |
1422 | } |
1423 | |
1424 | unsafe impl<'a> glib::value::FromValue<'a> for LibraryError { |
1425 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
1426 | |
1427 | #[inline ] |
1428 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
1429 | skip_assert_initialized!(); |
1430 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
1431 | } |
1432 | } |
1433 | |
1434 | impl ToValue for LibraryError { |
1435 | #[inline ] |
1436 | fn to_value(&self) -> glib::Value { |
1437 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
1438 | unsafe { |
1439 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
1440 | } |
1441 | value |
1442 | } |
1443 | |
1444 | #[inline ] |
1445 | fn value_type(&self) -> glib::Type { |
1446 | Self::static_type() |
1447 | } |
1448 | } |
1449 | |
1450 | impl From<LibraryError> for glib::Value { |
1451 | #[inline ] |
1452 | fn from(v: LibraryError) -> Self { |
1453 | skip_assert_initialized!(); |
1454 | ToValue::to_value(&v) |
1455 | } |
1456 | } |
1457 | |
1458 | #[cfg_attr (feature = "serde" , derive(serde::Serialize, serde::Deserialize))] |
1459 | #[derive (Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)] |
1460 | #[repr (i32)] |
1461 | #[doc (alias = "GstPadDirection" )] |
1462 | pub enum PadDirection { |
1463 | #[doc (alias = "GST_PAD_UNKNOWN" )] |
1464 | Unknown = ffi::GST_PAD_UNKNOWN, |
1465 | #[doc (alias = "GST_PAD_SRC" )] |
1466 | Src = ffi::GST_PAD_SRC, |
1467 | #[doc (alias = "GST_PAD_SINK" )] |
1468 | Sink = ffi::GST_PAD_SINK, |
1469 | } |
1470 | |
1471 | #[doc (hidden)] |
1472 | impl IntoGlib for PadDirection { |
1473 | type GlibType = ffi::GstPadDirection; |
1474 | |
1475 | #[inline ] |
1476 | fn into_glib(self) -> ffi::GstPadDirection { |
1477 | self as ffi::GstPadDirection |
1478 | } |
1479 | } |
1480 | |
1481 | #[doc (hidden)] |
1482 | impl FromGlib<ffi::GstPadDirection> for PadDirection { |
1483 | #[inline ] |
1484 | unsafe fn from_glib(value: ffi::GstPadDirection) -> Self { |
1485 | skip_assert_initialized!(); |
1486 | |
1487 | debug_assert!([ffi::GST_PAD_UNKNOWN, ffi::GST_PAD_SRC, ffi::GST_PAD_SINK].contains(&value)); |
1488 | std::mem::transmute(src:value) |
1489 | } |
1490 | } |
1491 | |
1492 | impl StaticType for PadDirection { |
1493 | #[inline ] |
1494 | #[doc (alias = "gst_pad_direction_get_type" )] |
1495 | fn static_type() -> glib::Type { |
1496 | unsafe { from_glib(val:ffi::gst_pad_direction_get_type()) } |
1497 | } |
1498 | } |
1499 | |
1500 | impl glib::HasParamSpec for PadDirection { |
1501 | type ParamSpec = glib::ParamSpecEnum; |
1502 | type SetValue = Self; |
1503 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
1504 | |
1505 | fn param_spec_builder() -> Self::BuilderFn { |
1506 | Self::ParamSpec::builder_with_default |
1507 | } |
1508 | } |
1509 | |
1510 | impl glib::value::ValueType for PadDirection { |
1511 | type Type = Self; |
1512 | } |
1513 | |
1514 | unsafe impl<'a> glib::value::FromValue<'a> for PadDirection { |
1515 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
1516 | |
1517 | #[inline ] |
1518 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
1519 | skip_assert_initialized!(); |
1520 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
1521 | } |
1522 | } |
1523 | |
1524 | impl ToValue for PadDirection { |
1525 | #[inline ] |
1526 | fn to_value(&self) -> glib::Value { |
1527 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
1528 | unsafe { |
1529 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
1530 | } |
1531 | value |
1532 | } |
1533 | |
1534 | #[inline ] |
1535 | fn value_type(&self) -> glib::Type { |
1536 | Self::static_type() |
1537 | } |
1538 | } |
1539 | |
1540 | impl From<PadDirection> for glib::Value { |
1541 | #[inline ] |
1542 | fn from(v: PadDirection) -> Self { |
1543 | skip_assert_initialized!(); |
1544 | ToValue::to_value(&v) |
1545 | } |
1546 | } |
1547 | |
1548 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
1549 | #[repr (i32)] |
1550 | #[doc (alias = "GstPadMode" )] |
1551 | pub enum PadMode { |
1552 | #[doc (alias = "GST_PAD_MODE_NONE" )] |
1553 | None = ffi::GST_PAD_MODE_NONE, |
1554 | #[doc (alias = "GST_PAD_MODE_PUSH" )] |
1555 | Push = ffi::GST_PAD_MODE_PUSH, |
1556 | #[doc (alias = "GST_PAD_MODE_PULL" )] |
1557 | Pull = ffi::GST_PAD_MODE_PULL, |
1558 | } |
1559 | |
1560 | impl PadMode { |
1561 | pub fn name<'a>(self) -> &'a GStr { |
1562 | unsafe { |
1563 | GStr::from_ptr( |
1564 | ffi::gst_pad_mode_get_name(self.into_glib()) |
1565 | .as_ref() |
1566 | .expect(msg:"gst_pad_mode_get_name returned NULL" ), |
1567 | ) |
1568 | } |
1569 | } |
1570 | } |
1571 | |
1572 | impl fmt::Display for PadMode { |
1573 | #[inline ] |
1574 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
1575 | f.write_str(&self.name()) |
1576 | } |
1577 | } |
1578 | |
1579 | #[doc (hidden)] |
1580 | impl IntoGlib for PadMode { |
1581 | type GlibType = ffi::GstPadMode; |
1582 | |
1583 | #[inline ] |
1584 | fn into_glib(self) -> ffi::GstPadMode { |
1585 | self as ffi::GstPadMode |
1586 | } |
1587 | } |
1588 | |
1589 | #[doc (hidden)] |
1590 | impl FromGlib<ffi::GstPadMode> for PadMode { |
1591 | #[inline ] |
1592 | unsafe fn from_glib(value: ffi::GstPadMode) -> Self { |
1593 | skip_assert_initialized!(); |
1594 | |
1595 | debug_assert!([ |
1596 | ffi::GST_PAD_MODE_NONE, |
1597 | ffi::GST_PAD_MODE_PUSH, |
1598 | ffi::GST_PAD_MODE_PULL |
1599 | ] |
1600 | .contains(&value)); |
1601 | std::mem::transmute(src:value) |
1602 | } |
1603 | } |
1604 | |
1605 | impl StaticType for PadMode { |
1606 | #[inline ] |
1607 | #[doc (alias = "gst_pad_mode_get_type" )] |
1608 | fn static_type() -> glib::Type { |
1609 | unsafe { from_glib(val:ffi::gst_pad_mode_get_type()) } |
1610 | } |
1611 | } |
1612 | |
1613 | impl glib::HasParamSpec for PadMode { |
1614 | type ParamSpec = glib::ParamSpecEnum; |
1615 | type SetValue = Self; |
1616 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
1617 | |
1618 | fn param_spec_builder() -> Self::BuilderFn { |
1619 | Self::ParamSpec::builder_with_default |
1620 | } |
1621 | } |
1622 | |
1623 | impl glib::value::ValueType for PadMode { |
1624 | type Type = Self; |
1625 | } |
1626 | |
1627 | unsafe impl<'a> glib::value::FromValue<'a> for PadMode { |
1628 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
1629 | |
1630 | #[inline ] |
1631 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
1632 | skip_assert_initialized!(); |
1633 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
1634 | } |
1635 | } |
1636 | |
1637 | impl ToValue for PadMode { |
1638 | #[inline ] |
1639 | fn to_value(&self) -> glib::Value { |
1640 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
1641 | unsafe { |
1642 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
1643 | } |
1644 | value |
1645 | } |
1646 | |
1647 | #[inline ] |
1648 | fn value_type(&self) -> glib::Type { |
1649 | Self::static_type() |
1650 | } |
1651 | } |
1652 | |
1653 | impl From<PadMode> for glib::Value { |
1654 | #[inline ] |
1655 | fn from(v: PadMode) -> Self { |
1656 | skip_assert_initialized!(); |
1657 | ToValue::to_value(&v) |
1658 | } |
1659 | } |
1660 | |
1661 | #[cfg_attr (feature = "serde" , derive(serde::Serialize, serde::Deserialize))] |
1662 | #[derive (Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)] |
1663 | #[repr (i32)] |
1664 | #[doc (alias = "GstPadPresence" )] |
1665 | pub enum PadPresence { |
1666 | #[doc (alias = "GST_PAD_ALWAYS" )] |
1667 | Always = ffi::GST_PAD_ALWAYS, |
1668 | #[doc (alias = "GST_PAD_SOMETIMES" )] |
1669 | Sometimes = ffi::GST_PAD_SOMETIMES, |
1670 | #[doc (alias = "GST_PAD_REQUEST" )] |
1671 | Request = ffi::GST_PAD_REQUEST, |
1672 | } |
1673 | |
1674 | #[doc (hidden)] |
1675 | impl IntoGlib for PadPresence { |
1676 | type GlibType = ffi::GstPadPresence; |
1677 | |
1678 | #[inline ] |
1679 | fn into_glib(self) -> ffi::GstPadPresence { |
1680 | self as ffi::GstPadPresence |
1681 | } |
1682 | } |
1683 | |
1684 | #[doc (hidden)] |
1685 | impl FromGlib<ffi::GstPadPresence> for PadPresence { |
1686 | #[inline ] |
1687 | unsafe fn from_glib(value: ffi::GstPadPresence) -> Self { |
1688 | skip_assert_initialized!(); |
1689 | |
1690 | debug_assert!([ |
1691 | ffi::GST_PAD_ALWAYS, |
1692 | ffi::GST_PAD_SOMETIMES, |
1693 | ffi::GST_PAD_REQUEST |
1694 | ] |
1695 | .contains(&value)); |
1696 | std::mem::transmute(src:value) |
1697 | } |
1698 | } |
1699 | |
1700 | impl StaticType for PadPresence { |
1701 | #[inline ] |
1702 | #[doc (alias = "gst_pad_presence_get_type" )] |
1703 | fn static_type() -> glib::Type { |
1704 | unsafe { from_glib(val:ffi::gst_pad_presence_get_type()) } |
1705 | } |
1706 | } |
1707 | |
1708 | impl glib::HasParamSpec for PadPresence { |
1709 | type ParamSpec = glib::ParamSpecEnum; |
1710 | type SetValue = Self; |
1711 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
1712 | |
1713 | fn param_spec_builder() -> Self::BuilderFn { |
1714 | Self::ParamSpec::builder_with_default |
1715 | } |
1716 | } |
1717 | |
1718 | impl glib::value::ValueType for PadPresence { |
1719 | type Type = Self; |
1720 | } |
1721 | |
1722 | unsafe impl<'a> glib::value::FromValue<'a> for PadPresence { |
1723 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
1724 | |
1725 | #[inline ] |
1726 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
1727 | skip_assert_initialized!(); |
1728 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
1729 | } |
1730 | } |
1731 | |
1732 | impl ToValue for PadPresence { |
1733 | #[inline ] |
1734 | fn to_value(&self) -> glib::Value { |
1735 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
1736 | unsafe { |
1737 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
1738 | } |
1739 | value |
1740 | } |
1741 | |
1742 | #[inline ] |
1743 | fn value_type(&self) -> glib::Type { |
1744 | Self::static_type() |
1745 | } |
1746 | } |
1747 | |
1748 | impl From<PadPresence> for glib::Value { |
1749 | #[inline ] |
1750 | fn from(v: PadPresence) -> Self { |
1751 | skip_assert_initialized!(); |
1752 | ToValue::to_value(&v) |
1753 | } |
1754 | } |
1755 | |
1756 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
1757 | #[repr (i32)] |
1758 | #[doc (alias = "GstPadProbeReturn" )] |
1759 | pub enum PadProbeReturn { |
1760 | #[doc (alias = "GST_PAD_PROBE_DROP" )] |
1761 | Drop = ffi::GST_PAD_PROBE_DROP, |
1762 | #[doc (alias = "GST_PAD_PROBE_OK" )] |
1763 | Ok = ffi::GST_PAD_PROBE_OK, |
1764 | #[doc (alias = "GST_PAD_PROBE_REMOVE" )] |
1765 | Remove = ffi::GST_PAD_PROBE_REMOVE, |
1766 | #[doc (alias = "GST_PAD_PROBE_PASS" )] |
1767 | Pass = ffi::GST_PAD_PROBE_PASS, |
1768 | #[doc (alias = "GST_PAD_PROBE_HANDLED" )] |
1769 | Handled = ffi::GST_PAD_PROBE_HANDLED, |
1770 | } |
1771 | |
1772 | #[doc (hidden)] |
1773 | impl IntoGlib for PadProbeReturn { |
1774 | type GlibType = ffi::GstPadProbeReturn; |
1775 | |
1776 | #[inline ] |
1777 | fn into_glib(self) -> ffi::GstPadProbeReturn { |
1778 | self as ffi::GstPadProbeReturn |
1779 | } |
1780 | } |
1781 | |
1782 | #[doc (hidden)] |
1783 | impl FromGlib<ffi::GstPadProbeReturn> for PadProbeReturn { |
1784 | #[inline ] |
1785 | unsafe fn from_glib(value: ffi::GstPadProbeReturn) -> Self { |
1786 | skip_assert_initialized!(); |
1787 | |
1788 | debug_assert!([ |
1789 | ffi::GST_PAD_PROBE_DROP, |
1790 | ffi::GST_PAD_PROBE_OK, |
1791 | ffi::GST_PAD_PROBE_REMOVE, |
1792 | ffi::GST_PAD_PROBE_PASS, |
1793 | ffi::GST_PAD_PROBE_HANDLED |
1794 | ] |
1795 | .contains(&value)); |
1796 | std::mem::transmute(src:value) |
1797 | } |
1798 | } |
1799 | |
1800 | impl StaticType for PadProbeReturn { |
1801 | #[inline ] |
1802 | #[doc (alias = "gst_pad_probe_return_get_type" )] |
1803 | fn static_type() -> glib::Type { |
1804 | unsafe { from_glib(val:ffi::gst_pad_probe_return_get_type()) } |
1805 | } |
1806 | } |
1807 | |
1808 | impl glib::HasParamSpec for PadProbeReturn { |
1809 | type ParamSpec = glib::ParamSpecEnum; |
1810 | type SetValue = Self; |
1811 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
1812 | |
1813 | fn param_spec_builder() -> Self::BuilderFn { |
1814 | Self::ParamSpec::builder_with_default |
1815 | } |
1816 | } |
1817 | |
1818 | impl glib::value::ValueType for PadProbeReturn { |
1819 | type Type = Self; |
1820 | } |
1821 | |
1822 | unsafe impl<'a> glib::value::FromValue<'a> for PadProbeReturn { |
1823 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
1824 | |
1825 | #[inline ] |
1826 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
1827 | skip_assert_initialized!(); |
1828 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
1829 | } |
1830 | } |
1831 | |
1832 | impl ToValue for PadProbeReturn { |
1833 | #[inline ] |
1834 | fn to_value(&self) -> glib::Value { |
1835 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
1836 | unsafe { |
1837 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
1838 | } |
1839 | value |
1840 | } |
1841 | |
1842 | #[inline ] |
1843 | fn value_type(&self) -> glib::Type { |
1844 | Self::static_type() |
1845 | } |
1846 | } |
1847 | |
1848 | impl From<PadProbeReturn> for glib::Value { |
1849 | #[inline ] |
1850 | fn from(v: PadProbeReturn) -> Self { |
1851 | skip_assert_initialized!(); |
1852 | ToValue::to_value(&v) |
1853 | } |
1854 | } |
1855 | |
1856 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
1857 | #[non_exhaustive ] |
1858 | #[doc (alias = "GstParseError" )] |
1859 | pub enum ParseError { |
1860 | #[doc (alias = "GST_PARSE_ERROR_SYNTAX" )] |
1861 | Syntax, |
1862 | #[doc (alias = "GST_PARSE_ERROR_NO_SUCH_ELEMENT" )] |
1863 | NoSuchElement, |
1864 | #[doc (alias = "GST_PARSE_ERROR_NO_SUCH_PROPERTY" )] |
1865 | NoSuchProperty, |
1866 | #[doc (alias = "GST_PARSE_ERROR_LINK" )] |
1867 | Link, |
1868 | #[doc (alias = "GST_PARSE_ERROR_COULD_NOT_SET_PROPERTY" )] |
1869 | CouldNotSetProperty, |
1870 | #[doc (alias = "GST_PARSE_ERROR_EMPTY_BIN" )] |
1871 | EmptyBin, |
1872 | #[doc (alias = "GST_PARSE_ERROR_EMPTY" )] |
1873 | Empty, |
1874 | #[doc (alias = "GST_PARSE_ERROR_DELAYED_LINK" )] |
1875 | DelayedLink, |
1876 | #[doc (hidden)] |
1877 | __Unknown(i32), |
1878 | } |
1879 | |
1880 | #[doc (hidden)] |
1881 | impl IntoGlib for ParseError { |
1882 | type GlibType = ffi::GstParseError; |
1883 | |
1884 | #[inline ] |
1885 | fn into_glib(self) -> ffi::GstParseError { |
1886 | match self { |
1887 | Self::Syntax => ffi::GST_PARSE_ERROR_SYNTAX, |
1888 | Self::NoSuchElement => ffi::GST_PARSE_ERROR_NO_SUCH_ELEMENT, |
1889 | Self::NoSuchProperty => ffi::GST_PARSE_ERROR_NO_SUCH_PROPERTY, |
1890 | Self::Link => ffi::GST_PARSE_ERROR_LINK, |
1891 | Self::CouldNotSetProperty => ffi::GST_PARSE_ERROR_COULD_NOT_SET_PROPERTY, |
1892 | Self::EmptyBin => ffi::GST_PARSE_ERROR_EMPTY_BIN, |
1893 | Self::Empty => ffi::GST_PARSE_ERROR_EMPTY, |
1894 | Self::DelayedLink => ffi::GST_PARSE_ERROR_DELAYED_LINK, |
1895 | Self::__Unknown(value: i32) => value, |
1896 | } |
1897 | } |
1898 | } |
1899 | |
1900 | #[doc (hidden)] |
1901 | impl FromGlib<ffi::GstParseError> for ParseError { |
1902 | #[inline ] |
1903 | unsafe fn from_glib(value: ffi::GstParseError) -> Self { |
1904 | skip_assert_initialized!(); |
1905 | |
1906 | match value { |
1907 | ffi::GST_PARSE_ERROR_SYNTAX => Self::Syntax, |
1908 | ffi::GST_PARSE_ERROR_NO_SUCH_ELEMENT => Self::NoSuchElement, |
1909 | ffi::GST_PARSE_ERROR_NO_SUCH_PROPERTY => Self::NoSuchProperty, |
1910 | ffi::GST_PARSE_ERROR_LINK => Self::Link, |
1911 | ffi::GST_PARSE_ERROR_COULD_NOT_SET_PROPERTY => Self::CouldNotSetProperty, |
1912 | ffi::GST_PARSE_ERROR_EMPTY_BIN => Self::EmptyBin, |
1913 | ffi::GST_PARSE_ERROR_EMPTY => Self::Empty, |
1914 | ffi::GST_PARSE_ERROR_DELAYED_LINK => Self::DelayedLink, |
1915 | value: i32 => Self::__Unknown(value), |
1916 | } |
1917 | } |
1918 | } |
1919 | |
1920 | impl glib::error::ErrorDomain for ParseError { |
1921 | #[inline ] |
1922 | fn domain() -> glib::Quark { |
1923 | skip_assert_initialized!(); |
1924 | |
1925 | unsafe { from_glib(val:ffi::gst_parse_error_quark()) } |
1926 | } |
1927 | |
1928 | #[inline ] |
1929 | fn code(self) -> i32 { |
1930 | self.into_glib() |
1931 | } |
1932 | |
1933 | #[inline ] |
1934 | #[allow (clippy::match_single_binding)] |
1935 | fn from(code: i32) -> Option<Self> { |
1936 | skip_assert_initialized!(); |
1937 | match unsafe { from_glib(val:code) } { |
1938 | value: ParseError => Some(value), |
1939 | } |
1940 | } |
1941 | } |
1942 | |
1943 | impl StaticType for ParseError { |
1944 | #[inline ] |
1945 | #[doc (alias = "gst_parse_error_get_type" )] |
1946 | fn static_type() -> glib::Type { |
1947 | unsafe { from_glib(val:ffi::gst_parse_error_get_type()) } |
1948 | } |
1949 | } |
1950 | |
1951 | impl glib::HasParamSpec for ParseError { |
1952 | type ParamSpec = glib::ParamSpecEnum; |
1953 | type SetValue = Self; |
1954 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
1955 | |
1956 | fn param_spec_builder() -> Self::BuilderFn { |
1957 | Self::ParamSpec::builder_with_default |
1958 | } |
1959 | } |
1960 | |
1961 | impl glib::value::ValueType for ParseError { |
1962 | type Type = Self; |
1963 | } |
1964 | |
1965 | unsafe impl<'a> glib::value::FromValue<'a> for ParseError { |
1966 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
1967 | |
1968 | #[inline ] |
1969 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
1970 | skip_assert_initialized!(); |
1971 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
1972 | } |
1973 | } |
1974 | |
1975 | impl ToValue for ParseError { |
1976 | #[inline ] |
1977 | fn to_value(&self) -> glib::Value { |
1978 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
1979 | unsafe { |
1980 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
1981 | } |
1982 | value |
1983 | } |
1984 | |
1985 | #[inline ] |
1986 | fn value_type(&self) -> glib::Type { |
1987 | Self::static_type() |
1988 | } |
1989 | } |
1990 | |
1991 | impl From<ParseError> for glib::Value { |
1992 | #[inline ] |
1993 | fn from(v: ParseError) -> Self { |
1994 | skip_assert_initialized!(); |
1995 | ToValue::to_value(&v) |
1996 | } |
1997 | } |
1998 | |
1999 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
2000 | #[non_exhaustive ] |
2001 | #[doc (alias = "GstPluginError" )] |
2002 | pub enum PluginError { |
2003 | #[doc (alias = "GST_PLUGIN_ERROR_MODULE" )] |
2004 | Module, |
2005 | #[doc (alias = "GST_PLUGIN_ERROR_DEPENDENCIES" )] |
2006 | Dependencies, |
2007 | #[doc (alias = "GST_PLUGIN_ERROR_NAME_MISMATCH" )] |
2008 | NameMismatch, |
2009 | #[doc (hidden)] |
2010 | __Unknown(i32), |
2011 | } |
2012 | |
2013 | #[doc (hidden)] |
2014 | impl IntoGlib for PluginError { |
2015 | type GlibType = ffi::GstPluginError; |
2016 | |
2017 | #[inline ] |
2018 | fn into_glib(self) -> ffi::GstPluginError { |
2019 | match self { |
2020 | Self::Module => ffi::GST_PLUGIN_ERROR_MODULE, |
2021 | Self::Dependencies => ffi::GST_PLUGIN_ERROR_DEPENDENCIES, |
2022 | Self::NameMismatch => ffi::GST_PLUGIN_ERROR_NAME_MISMATCH, |
2023 | Self::__Unknown(value: i32) => value, |
2024 | } |
2025 | } |
2026 | } |
2027 | |
2028 | #[doc (hidden)] |
2029 | impl FromGlib<ffi::GstPluginError> for PluginError { |
2030 | #[inline ] |
2031 | unsafe fn from_glib(value: ffi::GstPluginError) -> Self { |
2032 | skip_assert_initialized!(); |
2033 | |
2034 | match value { |
2035 | ffi::GST_PLUGIN_ERROR_MODULE => Self::Module, |
2036 | ffi::GST_PLUGIN_ERROR_DEPENDENCIES => Self::Dependencies, |
2037 | ffi::GST_PLUGIN_ERROR_NAME_MISMATCH => Self::NameMismatch, |
2038 | value: i32 => Self::__Unknown(value), |
2039 | } |
2040 | } |
2041 | } |
2042 | |
2043 | impl glib::error::ErrorDomain for PluginError { |
2044 | #[inline ] |
2045 | fn domain() -> glib::Quark { |
2046 | skip_assert_initialized!(); |
2047 | |
2048 | unsafe { from_glib(val:ffi::gst_plugin_error_quark()) } |
2049 | } |
2050 | |
2051 | #[inline ] |
2052 | fn code(self) -> i32 { |
2053 | self.into_glib() |
2054 | } |
2055 | |
2056 | #[inline ] |
2057 | #[allow (clippy::match_single_binding)] |
2058 | fn from(code: i32) -> Option<Self> { |
2059 | skip_assert_initialized!(); |
2060 | match unsafe { from_glib(val:code) } { |
2061 | value: PluginError => Some(value), |
2062 | } |
2063 | } |
2064 | } |
2065 | |
2066 | impl StaticType for PluginError { |
2067 | #[inline ] |
2068 | #[doc (alias = "gst_plugin_error_get_type" )] |
2069 | fn static_type() -> glib::Type { |
2070 | unsafe { from_glib(val:ffi::gst_plugin_error_get_type()) } |
2071 | } |
2072 | } |
2073 | |
2074 | impl glib::HasParamSpec for PluginError { |
2075 | type ParamSpec = glib::ParamSpecEnum; |
2076 | type SetValue = Self; |
2077 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
2078 | |
2079 | fn param_spec_builder() -> Self::BuilderFn { |
2080 | Self::ParamSpec::builder_with_default |
2081 | } |
2082 | } |
2083 | |
2084 | impl glib::value::ValueType for PluginError { |
2085 | type Type = Self; |
2086 | } |
2087 | |
2088 | unsafe impl<'a> glib::value::FromValue<'a> for PluginError { |
2089 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
2090 | |
2091 | #[inline ] |
2092 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
2093 | skip_assert_initialized!(); |
2094 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
2095 | } |
2096 | } |
2097 | |
2098 | impl ToValue for PluginError { |
2099 | #[inline ] |
2100 | fn to_value(&self) -> glib::Value { |
2101 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
2102 | unsafe { |
2103 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
2104 | } |
2105 | value |
2106 | } |
2107 | |
2108 | #[inline ] |
2109 | fn value_type(&self) -> glib::Type { |
2110 | Self::static_type() |
2111 | } |
2112 | } |
2113 | |
2114 | impl From<PluginError> for glib::Value { |
2115 | #[inline ] |
2116 | fn from(v: PluginError) -> Self { |
2117 | skip_assert_initialized!(); |
2118 | ToValue::to_value(&v) |
2119 | } |
2120 | } |
2121 | |
2122 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
2123 | #[non_exhaustive ] |
2124 | #[doc (alias = "GstProgressType" )] |
2125 | pub enum ProgressType { |
2126 | #[doc (alias = "GST_PROGRESS_TYPE_START" )] |
2127 | Start, |
2128 | #[doc (alias = "GST_PROGRESS_TYPE_CONTINUE" )] |
2129 | Continue, |
2130 | #[doc (alias = "GST_PROGRESS_TYPE_COMPLETE" )] |
2131 | Complete, |
2132 | #[doc (alias = "GST_PROGRESS_TYPE_CANCELED" )] |
2133 | Canceled, |
2134 | #[doc (alias = "GST_PROGRESS_TYPE_ERROR" )] |
2135 | Error, |
2136 | #[doc (hidden)] |
2137 | __Unknown(i32), |
2138 | } |
2139 | |
2140 | #[doc (hidden)] |
2141 | impl IntoGlib for ProgressType { |
2142 | type GlibType = ffi::GstProgressType; |
2143 | |
2144 | #[inline ] |
2145 | fn into_glib(self) -> ffi::GstProgressType { |
2146 | match self { |
2147 | Self::Start => ffi::GST_PROGRESS_TYPE_START, |
2148 | Self::Continue => ffi::GST_PROGRESS_TYPE_CONTINUE, |
2149 | Self::Complete => ffi::GST_PROGRESS_TYPE_COMPLETE, |
2150 | Self::Canceled => ffi::GST_PROGRESS_TYPE_CANCELED, |
2151 | Self::Error => ffi::GST_PROGRESS_TYPE_ERROR, |
2152 | Self::__Unknown(value: i32) => value, |
2153 | } |
2154 | } |
2155 | } |
2156 | |
2157 | #[doc (hidden)] |
2158 | impl FromGlib<ffi::GstProgressType> for ProgressType { |
2159 | #[inline ] |
2160 | unsafe fn from_glib(value: ffi::GstProgressType) -> Self { |
2161 | skip_assert_initialized!(); |
2162 | |
2163 | match value { |
2164 | ffi::GST_PROGRESS_TYPE_START => Self::Start, |
2165 | ffi::GST_PROGRESS_TYPE_CONTINUE => Self::Continue, |
2166 | ffi::GST_PROGRESS_TYPE_COMPLETE => Self::Complete, |
2167 | ffi::GST_PROGRESS_TYPE_CANCELED => Self::Canceled, |
2168 | ffi::GST_PROGRESS_TYPE_ERROR => Self::Error, |
2169 | value: i32 => Self::__Unknown(value), |
2170 | } |
2171 | } |
2172 | } |
2173 | |
2174 | impl StaticType for ProgressType { |
2175 | #[inline ] |
2176 | #[doc (alias = "gst_progress_type_get_type" )] |
2177 | fn static_type() -> glib::Type { |
2178 | unsafe { from_glib(val:ffi::gst_progress_type_get_type()) } |
2179 | } |
2180 | } |
2181 | |
2182 | impl glib::HasParamSpec for ProgressType { |
2183 | type ParamSpec = glib::ParamSpecEnum; |
2184 | type SetValue = Self; |
2185 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
2186 | |
2187 | fn param_spec_builder() -> Self::BuilderFn { |
2188 | Self::ParamSpec::builder_with_default |
2189 | } |
2190 | } |
2191 | |
2192 | impl glib::value::ValueType for ProgressType { |
2193 | type Type = Self; |
2194 | } |
2195 | |
2196 | unsafe impl<'a> glib::value::FromValue<'a> for ProgressType { |
2197 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
2198 | |
2199 | #[inline ] |
2200 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
2201 | skip_assert_initialized!(); |
2202 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
2203 | } |
2204 | } |
2205 | |
2206 | impl ToValue for ProgressType { |
2207 | #[inline ] |
2208 | fn to_value(&self) -> glib::Value { |
2209 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
2210 | unsafe { |
2211 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
2212 | } |
2213 | value |
2214 | } |
2215 | |
2216 | #[inline ] |
2217 | fn value_type(&self) -> glib::Type { |
2218 | Self::static_type() |
2219 | } |
2220 | } |
2221 | |
2222 | impl From<ProgressType> for glib::Value { |
2223 | #[inline ] |
2224 | fn from(v: ProgressType) -> Self { |
2225 | skip_assert_initialized!(); |
2226 | ToValue::to_value(&v) |
2227 | } |
2228 | } |
2229 | |
2230 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
2231 | #[non_exhaustive ] |
2232 | #[doc (alias = "GstPromiseResult" )] |
2233 | pub enum PromiseResult { |
2234 | #[doc (alias = "GST_PROMISE_RESULT_PENDING" )] |
2235 | Pending, |
2236 | #[doc (alias = "GST_PROMISE_RESULT_INTERRUPTED" )] |
2237 | Interrupted, |
2238 | #[doc (alias = "GST_PROMISE_RESULT_REPLIED" )] |
2239 | Replied, |
2240 | #[doc (alias = "GST_PROMISE_RESULT_EXPIRED" )] |
2241 | Expired, |
2242 | #[doc (hidden)] |
2243 | __Unknown(i32), |
2244 | } |
2245 | |
2246 | #[doc (hidden)] |
2247 | impl IntoGlib for PromiseResult { |
2248 | type GlibType = ffi::GstPromiseResult; |
2249 | |
2250 | #[inline ] |
2251 | fn into_glib(self) -> ffi::GstPromiseResult { |
2252 | match self { |
2253 | Self::Pending => ffi::GST_PROMISE_RESULT_PENDING, |
2254 | Self::Interrupted => ffi::GST_PROMISE_RESULT_INTERRUPTED, |
2255 | Self::Replied => ffi::GST_PROMISE_RESULT_REPLIED, |
2256 | Self::Expired => ffi::GST_PROMISE_RESULT_EXPIRED, |
2257 | Self::__Unknown(value: i32) => value, |
2258 | } |
2259 | } |
2260 | } |
2261 | |
2262 | #[doc (hidden)] |
2263 | impl FromGlib<ffi::GstPromiseResult> for PromiseResult { |
2264 | #[inline ] |
2265 | unsafe fn from_glib(value: ffi::GstPromiseResult) -> Self { |
2266 | skip_assert_initialized!(); |
2267 | |
2268 | match value { |
2269 | ffi::GST_PROMISE_RESULT_PENDING => Self::Pending, |
2270 | ffi::GST_PROMISE_RESULT_INTERRUPTED => Self::Interrupted, |
2271 | ffi::GST_PROMISE_RESULT_REPLIED => Self::Replied, |
2272 | ffi::GST_PROMISE_RESULT_EXPIRED => Self::Expired, |
2273 | value: i32 => Self::__Unknown(value), |
2274 | } |
2275 | } |
2276 | } |
2277 | |
2278 | impl StaticType for PromiseResult { |
2279 | #[inline ] |
2280 | #[doc (alias = "gst_promise_result_get_type" )] |
2281 | fn static_type() -> glib::Type { |
2282 | unsafe { from_glib(val:ffi::gst_promise_result_get_type()) } |
2283 | } |
2284 | } |
2285 | |
2286 | impl glib::HasParamSpec for PromiseResult { |
2287 | type ParamSpec = glib::ParamSpecEnum; |
2288 | type SetValue = Self; |
2289 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
2290 | |
2291 | fn param_spec_builder() -> Self::BuilderFn { |
2292 | Self::ParamSpec::builder_with_default |
2293 | } |
2294 | } |
2295 | |
2296 | impl glib::value::ValueType for PromiseResult { |
2297 | type Type = Self; |
2298 | } |
2299 | |
2300 | unsafe impl<'a> glib::value::FromValue<'a> for PromiseResult { |
2301 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
2302 | |
2303 | #[inline ] |
2304 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
2305 | skip_assert_initialized!(); |
2306 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
2307 | } |
2308 | } |
2309 | |
2310 | impl ToValue for PromiseResult { |
2311 | #[inline ] |
2312 | fn to_value(&self) -> glib::Value { |
2313 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
2314 | unsafe { |
2315 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
2316 | } |
2317 | value |
2318 | } |
2319 | |
2320 | #[inline ] |
2321 | fn value_type(&self) -> glib::Type { |
2322 | Self::static_type() |
2323 | } |
2324 | } |
2325 | |
2326 | impl From<PromiseResult> for glib::Value { |
2327 | #[inline ] |
2328 | fn from(v: PromiseResult) -> Self { |
2329 | skip_assert_initialized!(); |
2330 | ToValue::to_value(&v) |
2331 | } |
2332 | } |
2333 | |
2334 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
2335 | #[non_exhaustive ] |
2336 | #[doc (alias = "GstQOSType" )] |
2337 | pub enum QOSType { |
2338 | #[doc (alias = "GST_QOS_TYPE_OVERFLOW" )] |
2339 | Overflow, |
2340 | #[doc (alias = "GST_QOS_TYPE_UNDERFLOW" )] |
2341 | Underflow, |
2342 | #[doc (alias = "GST_QOS_TYPE_THROTTLE" )] |
2343 | Throttle, |
2344 | #[doc (hidden)] |
2345 | __Unknown(i32), |
2346 | } |
2347 | |
2348 | #[doc (hidden)] |
2349 | impl IntoGlib for QOSType { |
2350 | type GlibType = ffi::GstQOSType; |
2351 | |
2352 | #[inline ] |
2353 | fn into_glib(self) -> ffi::GstQOSType { |
2354 | match self { |
2355 | Self::Overflow => ffi::GST_QOS_TYPE_OVERFLOW, |
2356 | Self::Underflow => ffi::GST_QOS_TYPE_UNDERFLOW, |
2357 | Self::Throttle => ffi::GST_QOS_TYPE_THROTTLE, |
2358 | Self::__Unknown(value: i32) => value, |
2359 | } |
2360 | } |
2361 | } |
2362 | |
2363 | #[doc (hidden)] |
2364 | impl FromGlib<ffi::GstQOSType> for QOSType { |
2365 | #[inline ] |
2366 | unsafe fn from_glib(value: ffi::GstQOSType) -> Self { |
2367 | skip_assert_initialized!(); |
2368 | |
2369 | match value { |
2370 | ffi::GST_QOS_TYPE_OVERFLOW => Self::Overflow, |
2371 | ffi::GST_QOS_TYPE_UNDERFLOW => Self::Underflow, |
2372 | ffi::GST_QOS_TYPE_THROTTLE => Self::Throttle, |
2373 | value: i32 => Self::__Unknown(value), |
2374 | } |
2375 | } |
2376 | } |
2377 | |
2378 | impl StaticType for QOSType { |
2379 | #[inline ] |
2380 | #[doc (alias = "gst_qos_type_get_type" )] |
2381 | fn static_type() -> glib::Type { |
2382 | unsafe { from_glib(val:ffi::gst_qos_type_get_type()) } |
2383 | } |
2384 | } |
2385 | |
2386 | impl glib::HasParamSpec for QOSType { |
2387 | type ParamSpec = glib::ParamSpecEnum; |
2388 | type SetValue = Self; |
2389 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
2390 | |
2391 | fn param_spec_builder() -> Self::BuilderFn { |
2392 | Self::ParamSpec::builder_with_default |
2393 | } |
2394 | } |
2395 | |
2396 | impl glib::value::ValueType for QOSType { |
2397 | type Type = Self; |
2398 | } |
2399 | |
2400 | unsafe impl<'a> glib::value::FromValue<'a> for QOSType { |
2401 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
2402 | |
2403 | #[inline ] |
2404 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
2405 | skip_assert_initialized!(); |
2406 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
2407 | } |
2408 | } |
2409 | |
2410 | impl ToValue for QOSType { |
2411 | #[inline ] |
2412 | fn to_value(&self) -> glib::Value { |
2413 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
2414 | unsafe { |
2415 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
2416 | } |
2417 | value |
2418 | } |
2419 | |
2420 | #[inline ] |
2421 | fn value_type(&self) -> glib::Type { |
2422 | Self::static_type() |
2423 | } |
2424 | } |
2425 | |
2426 | impl From<QOSType> for glib::Value { |
2427 | #[inline ] |
2428 | fn from(v: QOSType) -> Self { |
2429 | skip_assert_initialized!(); |
2430 | ToValue::to_value(&v) |
2431 | } |
2432 | } |
2433 | |
2434 | #[cfg_attr (feature = "serde" , derive(serde::Serialize, serde::Deserialize))] |
2435 | #[derive (Debug, Clone, Copy)] |
2436 | #[non_exhaustive ] |
2437 | #[doc (alias = "GstRank" )] |
2438 | pub enum Rank { |
2439 | #[doc (alias = "GST_RANK_NONE" )] |
2440 | None, |
2441 | #[doc (alias = "GST_RANK_MARGINAL" )] |
2442 | Marginal, |
2443 | #[doc (alias = "GST_RANK_SECONDARY" )] |
2444 | Secondary, |
2445 | #[doc (alias = "GST_RANK_PRIMARY" )] |
2446 | Primary, |
2447 | #[doc (hidden)] |
2448 | __Unknown(i32), |
2449 | } |
2450 | |
2451 | #[doc (hidden)] |
2452 | impl IntoGlib for Rank { |
2453 | type GlibType = ffi::GstRank; |
2454 | |
2455 | #[inline ] |
2456 | fn into_glib(self) -> ffi::GstRank { |
2457 | match self { |
2458 | Self::None => ffi::GST_RANK_NONE, |
2459 | Self::Marginal => ffi::GST_RANK_MARGINAL, |
2460 | Self::Secondary => ffi::GST_RANK_SECONDARY, |
2461 | Self::Primary => ffi::GST_RANK_PRIMARY, |
2462 | Self::__Unknown(value: i32) => value, |
2463 | } |
2464 | } |
2465 | } |
2466 | |
2467 | #[doc (hidden)] |
2468 | impl FromGlib<ffi::GstRank> for Rank { |
2469 | #[inline ] |
2470 | unsafe fn from_glib(value: ffi::GstRank) -> Self { |
2471 | skip_assert_initialized!(); |
2472 | |
2473 | match value { |
2474 | ffi::GST_RANK_NONE => Self::None, |
2475 | ffi::GST_RANK_MARGINAL => Self::Marginal, |
2476 | ffi::GST_RANK_SECONDARY => Self::Secondary, |
2477 | ffi::GST_RANK_PRIMARY => Self::Primary, |
2478 | value: i32 => Self::__Unknown(value), |
2479 | } |
2480 | } |
2481 | } |
2482 | |
2483 | impl StaticType for Rank { |
2484 | #[inline ] |
2485 | #[doc (alias = "gst_rank_get_type" )] |
2486 | fn static_type() -> glib::Type { |
2487 | unsafe { from_glib(val:ffi::gst_rank_get_type()) } |
2488 | } |
2489 | } |
2490 | |
2491 | impl glib::HasParamSpec for Rank { |
2492 | type ParamSpec = glib::ParamSpecEnum; |
2493 | type SetValue = Self; |
2494 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
2495 | |
2496 | fn param_spec_builder() -> Self::BuilderFn { |
2497 | Self::ParamSpec::builder_with_default |
2498 | } |
2499 | } |
2500 | |
2501 | impl glib::value::ValueType for Rank { |
2502 | type Type = Self; |
2503 | } |
2504 | |
2505 | unsafe impl<'a> glib::value::FromValue<'a> for Rank { |
2506 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
2507 | |
2508 | #[inline ] |
2509 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
2510 | skip_assert_initialized!(); |
2511 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
2512 | } |
2513 | } |
2514 | |
2515 | impl ToValue for Rank { |
2516 | #[inline ] |
2517 | fn to_value(&self) -> glib::Value { |
2518 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
2519 | unsafe { |
2520 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
2521 | } |
2522 | value |
2523 | } |
2524 | |
2525 | #[inline ] |
2526 | fn value_type(&self) -> glib::Type { |
2527 | Self::static_type() |
2528 | } |
2529 | } |
2530 | |
2531 | impl From<Rank> for glib::Value { |
2532 | #[inline ] |
2533 | fn from(v: Rank) -> Self { |
2534 | skip_assert_initialized!(); |
2535 | ToValue::to_value(&v) |
2536 | } |
2537 | } |
2538 | |
2539 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
2540 | #[non_exhaustive ] |
2541 | #[doc (alias = "GstResourceError" )] |
2542 | pub enum ResourceError { |
2543 | #[doc (alias = "GST_RESOURCE_ERROR_FAILED" )] |
2544 | Failed, |
2545 | #[doc (alias = "GST_RESOURCE_ERROR_TOO_LAZY" )] |
2546 | TooLazy, |
2547 | #[doc (alias = "GST_RESOURCE_ERROR_NOT_FOUND" )] |
2548 | NotFound, |
2549 | #[doc (alias = "GST_RESOURCE_ERROR_BUSY" )] |
2550 | Busy, |
2551 | #[doc (alias = "GST_RESOURCE_ERROR_OPEN_READ" )] |
2552 | OpenRead, |
2553 | #[doc (alias = "GST_RESOURCE_ERROR_OPEN_WRITE" )] |
2554 | OpenWrite, |
2555 | #[doc (alias = "GST_RESOURCE_ERROR_OPEN_READ_WRITE" )] |
2556 | OpenReadWrite, |
2557 | #[doc (alias = "GST_RESOURCE_ERROR_CLOSE" )] |
2558 | Close, |
2559 | #[doc (alias = "GST_RESOURCE_ERROR_READ" )] |
2560 | Read, |
2561 | #[doc (alias = "GST_RESOURCE_ERROR_WRITE" )] |
2562 | Write, |
2563 | #[doc (alias = "GST_RESOURCE_ERROR_SEEK" )] |
2564 | Seek, |
2565 | #[doc (alias = "GST_RESOURCE_ERROR_SYNC" )] |
2566 | Sync, |
2567 | #[doc (alias = "GST_RESOURCE_ERROR_SETTINGS" )] |
2568 | Settings, |
2569 | #[doc (alias = "GST_RESOURCE_ERROR_NO_SPACE_LEFT" )] |
2570 | NoSpaceLeft, |
2571 | #[doc (alias = "GST_RESOURCE_ERROR_NOT_AUTHORIZED" )] |
2572 | NotAuthorized, |
2573 | #[doc (hidden)] |
2574 | __Unknown(i32), |
2575 | } |
2576 | |
2577 | #[doc (hidden)] |
2578 | impl IntoGlib for ResourceError { |
2579 | type GlibType = ffi::GstResourceError; |
2580 | |
2581 | fn into_glib(self) -> ffi::GstResourceError { |
2582 | match self { |
2583 | Self::Failed => ffi::GST_RESOURCE_ERROR_FAILED, |
2584 | Self::TooLazy => ffi::GST_RESOURCE_ERROR_TOO_LAZY, |
2585 | Self::NotFound => ffi::GST_RESOURCE_ERROR_NOT_FOUND, |
2586 | Self::Busy => ffi::GST_RESOURCE_ERROR_BUSY, |
2587 | Self::OpenRead => ffi::GST_RESOURCE_ERROR_OPEN_READ, |
2588 | Self::OpenWrite => ffi::GST_RESOURCE_ERROR_OPEN_WRITE, |
2589 | Self::OpenReadWrite => ffi::GST_RESOURCE_ERROR_OPEN_READ_WRITE, |
2590 | Self::Close => ffi::GST_RESOURCE_ERROR_CLOSE, |
2591 | Self::Read => ffi::GST_RESOURCE_ERROR_READ, |
2592 | Self::Write => ffi::GST_RESOURCE_ERROR_WRITE, |
2593 | Self::Seek => ffi::GST_RESOURCE_ERROR_SEEK, |
2594 | Self::Sync => ffi::GST_RESOURCE_ERROR_SYNC, |
2595 | Self::Settings => ffi::GST_RESOURCE_ERROR_SETTINGS, |
2596 | Self::NoSpaceLeft => ffi::GST_RESOURCE_ERROR_NO_SPACE_LEFT, |
2597 | Self::NotAuthorized => ffi::GST_RESOURCE_ERROR_NOT_AUTHORIZED, |
2598 | Self::__Unknown(value: i32) => value, |
2599 | } |
2600 | } |
2601 | } |
2602 | |
2603 | #[doc (hidden)] |
2604 | impl FromGlib<ffi::GstResourceError> for ResourceError { |
2605 | unsafe fn from_glib(value: ffi::GstResourceError) -> Self { |
2606 | skip_assert_initialized!(); |
2607 | |
2608 | match value { |
2609 | ffi::GST_RESOURCE_ERROR_FAILED => Self::Failed, |
2610 | ffi::GST_RESOURCE_ERROR_TOO_LAZY => Self::TooLazy, |
2611 | ffi::GST_RESOURCE_ERROR_NOT_FOUND => Self::NotFound, |
2612 | ffi::GST_RESOURCE_ERROR_BUSY => Self::Busy, |
2613 | ffi::GST_RESOURCE_ERROR_OPEN_READ => Self::OpenRead, |
2614 | ffi::GST_RESOURCE_ERROR_OPEN_WRITE => Self::OpenWrite, |
2615 | ffi::GST_RESOURCE_ERROR_OPEN_READ_WRITE => Self::OpenReadWrite, |
2616 | ffi::GST_RESOURCE_ERROR_CLOSE => Self::Close, |
2617 | ffi::GST_RESOURCE_ERROR_READ => Self::Read, |
2618 | ffi::GST_RESOURCE_ERROR_WRITE => Self::Write, |
2619 | ffi::GST_RESOURCE_ERROR_SEEK => Self::Seek, |
2620 | ffi::GST_RESOURCE_ERROR_SYNC => Self::Sync, |
2621 | ffi::GST_RESOURCE_ERROR_SETTINGS => Self::Settings, |
2622 | ffi::GST_RESOURCE_ERROR_NO_SPACE_LEFT => Self::NoSpaceLeft, |
2623 | ffi::GST_RESOURCE_ERROR_NOT_AUTHORIZED => Self::NotAuthorized, |
2624 | value: i32 => Self::__Unknown(value), |
2625 | } |
2626 | } |
2627 | } |
2628 | |
2629 | impl glib::error::ErrorDomain for ResourceError { |
2630 | #[inline ] |
2631 | fn domain() -> glib::Quark { |
2632 | skip_assert_initialized!(); |
2633 | |
2634 | unsafe { from_glib(val:ffi::gst_resource_error_quark()) } |
2635 | } |
2636 | |
2637 | #[inline ] |
2638 | fn code(self) -> i32 { |
2639 | self.into_glib() |
2640 | } |
2641 | |
2642 | #[inline ] |
2643 | #[allow (clippy::match_single_binding)] |
2644 | fn from(code: i32) -> Option<Self> { |
2645 | skip_assert_initialized!(); |
2646 | match unsafe { from_glib(val:code) } { |
2647 | Self::__Unknown(_) => Some(Self::Failed), |
2648 | value: ResourceError => Some(value), |
2649 | } |
2650 | } |
2651 | } |
2652 | |
2653 | impl StaticType for ResourceError { |
2654 | #[inline ] |
2655 | #[doc (alias = "gst_resource_error_get_type" )] |
2656 | fn static_type() -> glib::Type { |
2657 | unsafe { from_glib(val:ffi::gst_resource_error_get_type()) } |
2658 | } |
2659 | } |
2660 | |
2661 | impl glib::HasParamSpec for ResourceError { |
2662 | type ParamSpec = glib::ParamSpecEnum; |
2663 | type SetValue = Self; |
2664 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
2665 | |
2666 | fn param_spec_builder() -> Self::BuilderFn { |
2667 | Self::ParamSpec::builder_with_default |
2668 | } |
2669 | } |
2670 | |
2671 | impl glib::value::ValueType for ResourceError { |
2672 | type Type = Self; |
2673 | } |
2674 | |
2675 | unsafe impl<'a> glib::value::FromValue<'a> for ResourceError { |
2676 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
2677 | |
2678 | #[inline ] |
2679 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
2680 | skip_assert_initialized!(); |
2681 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
2682 | } |
2683 | } |
2684 | |
2685 | impl ToValue for ResourceError { |
2686 | #[inline ] |
2687 | fn to_value(&self) -> glib::Value { |
2688 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
2689 | unsafe { |
2690 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
2691 | } |
2692 | value |
2693 | } |
2694 | |
2695 | #[inline ] |
2696 | fn value_type(&self) -> glib::Type { |
2697 | Self::static_type() |
2698 | } |
2699 | } |
2700 | |
2701 | impl From<ResourceError> for glib::Value { |
2702 | #[inline ] |
2703 | fn from(v: ResourceError) -> Self { |
2704 | skip_assert_initialized!(); |
2705 | ToValue::to_value(&v) |
2706 | } |
2707 | } |
2708 | |
2709 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
2710 | #[repr (i32)] |
2711 | #[doc (alias = "GstSeekType" )] |
2712 | pub enum SeekType { |
2713 | #[doc (alias = "GST_SEEK_TYPE_NONE" )] |
2714 | None = ffi::GST_SEEK_TYPE_NONE, |
2715 | #[doc (alias = "GST_SEEK_TYPE_SET" )] |
2716 | Set = ffi::GST_SEEK_TYPE_SET, |
2717 | #[doc (alias = "GST_SEEK_TYPE_END" )] |
2718 | End = ffi::GST_SEEK_TYPE_END, |
2719 | } |
2720 | |
2721 | #[doc (hidden)] |
2722 | impl IntoGlib for SeekType { |
2723 | type GlibType = ffi::GstSeekType; |
2724 | |
2725 | #[inline ] |
2726 | fn into_glib(self) -> ffi::GstSeekType { |
2727 | self as ffi::GstSeekType |
2728 | } |
2729 | } |
2730 | |
2731 | #[doc (hidden)] |
2732 | impl FromGlib<ffi::GstSeekType> for SeekType { |
2733 | #[inline ] |
2734 | unsafe fn from_glib(value: ffi::GstSeekType) -> Self { |
2735 | skip_assert_initialized!(); |
2736 | |
2737 | debug_assert!([ |
2738 | ffi::GST_SEEK_TYPE_NONE, |
2739 | ffi::GST_SEEK_TYPE_SET, |
2740 | ffi::GST_SEEK_TYPE_END |
2741 | ] |
2742 | .contains(&value)); |
2743 | std::mem::transmute(src:value) |
2744 | } |
2745 | } |
2746 | |
2747 | impl StaticType for SeekType { |
2748 | #[inline ] |
2749 | #[doc (alias = "gst_seek_type_get_type" )] |
2750 | fn static_type() -> glib::Type { |
2751 | unsafe { from_glib(val:ffi::gst_seek_type_get_type()) } |
2752 | } |
2753 | } |
2754 | |
2755 | impl glib::HasParamSpec for SeekType { |
2756 | type ParamSpec = glib::ParamSpecEnum; |
2757 | type SetValue = Self; |
2758 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
2759 | |
2760 | fn param_spec_builder() -> Self::BuilderFn { |
2761 | Self::ParamSpec::builder_with_default |
2762 | } |
2763 | } |
2764 | |
2765 | impl glib::value::ValueType for SeekType { |
2766 | type Type = Self; |
2767 | } |
2768 | |
2769 | unsafe impl<'a> glib::value::FromValue<'a> for SeekType { |
2770 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
2771 | |
2772 | #[inline ] |
2773 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
2774 | skip_assert_initialized!(); |
2775 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
2776 | } |
2777 | } |
2778 | |
2779 | impl ToValue for SeekType { |
2780 | #[inline ] |
2781 | fn to_value(&self) -> glib::Value { |
2782 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
2783 | unsafe { |
2784 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
2785 | } |
2786 | value |
2787 | } |
2788 | |
2789 | #[inline ] |
2790 | fn value_type(&self) -> glib::Type { |
2791 | Self::static_type() |
2792 | } |
2793 | } |
2794 | |
2795 | impl From<SeekType> for glib::Value { |
2796 | #[inline ] |
2797 | fn from(v: SeekType) -> Self { |
2798 | skip_assert_initialized!(); |
2799 | ToValue::to_value(&v) |
2800 | } |
2801 | } |
2802 | |
2803 | #[cfg_attr (feature = "serde" , derive(serde::Serialize, serde::Deserialize))] |
2804 | #[derive (Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)] |
2805 | #[repr (i32)] |
2806 | #[doc (alias = "GstState" )] |
2807 | pub enum State { |
2808 | #[doc (alias = "GST_STATE_VOID_PENDING" )] |
2809 | VoidPending = ffi::GST_STATE_VOID_PENDING, |
2810 | #[doc (alias = "GST_STATE_NULL" )] |
2811 | Null = ffi::GST_STATE_NULL, |
2812 | #[doc (alias = "GST_STATE_READY" )] |
2813 | Ready = ffi::GST_STATE_READY, |
2814 | #[doc (alias = "GST_STATE_PAUSED" )] |
2815 | Paused = ffi::GST_STATE_PAUSED, |
2816 | #[doc (alias = "GST_STATE_PLAYING" )] |
2817 | Playing = ffi::GST_STATE_PLAYING, |
2818 | } |
2819 | |
2820 | #[doc (hidden)] |
2821 | impl IntoGlib for State { |
2822 | type GlibType = ffi::GstState; |
2823 | |
2824 | #[inline ] |
2825 | fn into_glib(self) -> ffi::GstState { |
2826 | self as ffi::GstState |
2827 | } |
2828 | } |
2829 | |
2830 | #[doc (hidden)] |
2831 | impl FromGlib<ffi::GstState> for State { |
2832 | #[inline ] |
2833 | unsafe fn from_glib(value: ffi::GstState) -> Self { |
2834 | skip_assert_initialized!(); |
2835 | |
2836 | debug_assert!([ |
2837 | ffi::GST_STATE_VOID_PENDING, |
2838 | ffi::GST_STATE_NULL, |
2839 | ffi::GST_STATE_READY, |
2840 | ffi::GST_STATE_PAUSED, |
2841 | ffi::GST_STATE_PLAYING |
2842 | ] |
2843 | .contains(&value)); |
2844 | std::mem::transmute(src:value) |
2845 | } |
2846 | } |
2847 | |
2848 | impl StaticType for State { |
2849 | #[inline ] |
2850 | #[doc (alias = "gst_state_get_type" )] |
2851 | fn static_type() -> glib::Type { |
2852 | unsafe { from_glib(val:ffi::gst_state_get_type()) } |
2853 | } |
2854 | } |
2855 | |
2856 | impl glib::HasParamSpec for State { |
2857 | type ParamSpec = glib::ParamSpecEnum; |
2858 | type SetValue = Self; |
2859 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
2860 | |
2861 | fn param_spec_builder() -> Self::BuilderFn { |
2862 | Self::ParamSpec::builder_with_default |
2863 | } |
2864 | } |
2865 | |
2866 | impl glib::value::ValueType for State { |
2867 | type Type = Self; |
2868 | } |
2869 | |
2870 | unsafe impl<'a> glib::value::FromValue<'a> for State { |
2871 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
2872 | |
2873 | #[inline ] |
2874 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
2875 | skip_assert_initialized!(); |
2876 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
2877 | } |
2878 | } |
2879 | |
2880 | impl ToValue for State { |
2881 | #[inline ] |
2882 | fn to_value(&self) -> glib::Value { |
2883 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
2884 | unsafe { |
2885 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
2886 | } |
2887 | value |
2888 | } |
2889 | |
2890 | #[inline ] |
2891 | fn value_type(&self) -> glib::Type { |
2892 | Self::static_type() |
2893 | } |
2894 | } |
2895 | |
2896 | impl From<State> for glib::Value { |
2897 | #[inline ] |
2898 | fn from(v: State) -> Self { |
2899 | skip_assert_initialized!(); |
2900 | ToValue::to_value(&v) |
2901 | } |
2902 | } |
2903 | |
2904 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
2905 | #[repr (i32)] |
2906 | #[doc (alias = "GstStateChange" )] |
2907 | pub enum StateChange { |
2908 | #[doc (alias = "GST_STATE_CHANGE_NULL_TO_READY" )] |
2909 | NullToReady = ffi::GST_STATE_CHANGE_NULL_TO_READY, |
2910 | #[doc (alias = "GST_STATE_CHANGE_READY_TO_PAUSED" )] |
2911 | ReadyToPaused = ffi::GST_STATE_CHANGE_READY_TO_PAUSED, |
2912 | #[doc (alias = "GST_STATE_CHANGE_PAUSED_TO_PLAYING" )] |
2913 | PausedToPlaying = ffi::GST_STATE_CHANGE_PAUSED_TO_PLAYING, |
2914 | #[doc (alias = "GST_STATE_CHANGE_PLAYING_TO_PAUSED" )] |
2915 | PlayingToPaused = ffi::GST_STATE_CHANGE_PLAYING_TO_PAUSED, |
2916 | #[doc (alias = "GST_STATE_CHANGE_PAUSED_TO_READY" )] |
2917 | PausedToReady = ffi::GST_STATE_CHANGE_PAUSED_TO_READY, |
2918 | #[doc (alias = "GST_STATE_CHANGE_READY_TO_NULL" )] |
2919 | ReadyToNull = ffi::GST_STATE_CHANGE_READY_TO_NULL, |
2920 | #[doc (alias = "GST_STATE_CHANGE_NULL_TO_NULL" )] |
2921 | NullToNull = ffi::GST_STATE_CHANGE_NULL_TO_NULL, |
2922 | #[doc (alias = "GST_STATE_CHANGE_READY_TO_READY" )] |
2923 | ReadyToReady = ffi::GST_STATE_CHANGE_READY_TO_READY, |
2924 | #[doc (alias = "GST_STATE_CHANGE_PAUSED_TO_PAUSED" )] |
2925 | PausedToPaused = ffi::GST_STATE_CHANGE_PAUSED_TO_PAUSED, |
2926 | #[doc (alias = "GST_STATE_CHANGE_PLAYING_TO_PLAYING" )] |
2927 | PlayingToPlaying = ffi::GST_STATE_CHANGE_PLAYING_TO_PLAYING, |
2928 | } |
2929 | |
2930 | impl StateChange { |
2931 | pub fn name<'a>(self) -> &'a GStr { |
2932 | unsafe { |
2933 | GStr::from_ptr( |
2934 | ffi::gst_state_change_get_name(self.into_glib()) |
2935 | .as_ref() |
2936 | .expect(msg:"gst_state_change_get_name returned NULL" ), |
2937 | ) |
2938 | } |
2939 | } |
2940 | } |
2941 | |
2942 | impl fmt::Display for StateChange { |
2943 | #[inline ] |
2944 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
2945 | f.write_str(&self.name()) |
2946 | } |
2947 | } |
2948 | |
2949 | #[doc (hidden)] |
2950 | impl IntoGlib for StateChange { |
2951 | type GlibType = ffi::GstStateChange; |
2952 | |
2953 | #[inline ] |
2954 | fn into_glib(self) -> ffi::GstStateChange { |
2955 | self as ffi::GstStateChange |
2956 | } |
2957 | } |
2958 | |
2959 | #[doc (hidden)] |
2960 | impl FromGlib<ffi::GstStateChange> for StateChange { |
2961 | #[inline ] |
2962 | unsafe fn from_glib(value: ffi::GstStateChange) -> Self { |
2963 | skip_assert_initialized!(); |
2964 | |
2965 | debug_assert!([ |
2966 | ffi::GST_STATE_CHANGE_NULL_TO_READY, |
2967 | ffi::GST_STATE_CHANGE_READY_TO_PAUSED, |
2968 | ffi::GST_STATE_CHANGE_PAUSED_TO_PLAYING, |
2969 | ffi::GST_STATE_CHANGE_PLAYING_TO_PAUSED, |
2970 | ffi::GST_STATE_CHANGE_PAUSED_TO_READY, |
2971 | ffi::GST_STATE_CHANGE_READY_TO_NULL, |
2972 | ffi::GST_STATE_CHANGE_NULL_TO_NULL, |
2973 | ffi::GST_STATE_CHANGE_READY_TO_READY, |
2974 | ffi::GST_STATE_CHANGE_PAUSED_TO_PAUSED, |
2975 | ffi::GST_STATE_CHANGE_PLAYING_TO_PLAYING |
2976 | ] |
2977 | .contains(&value)); |
2978 | std::mem::transmute(src:value) |
2979 | } |
2980 | } |
2981 | |
2982 | impl StaticType for StateChange { |
2983 | #[inline ] |
2984 | #[doc (alias = "gst_state_change_get_type" )] |
2985 | fn static_type() -> glib::Type { |
2986 | unsafe { from_glib(val:ffi::gst_state_change_get_type()) } |
2987 | } |
2988 | } |
2989 | |
2990 | impl glib::HasParamSpec for StateChange { |
2991 | type ParamSpec = glib::ParamSpecEnum; |
2992 | type SetValue = Self; |
2993 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
2994 | |
2995 | fn param_spec_builder() -> Self::BuilderFn { |
2996 | Self::ParamSpec::builder_with_default |
2997 | } |
2998 | } |
2999 | |
3000 | impl glib::value::ValueType for StateChange { |
3001 | type Type = Self; |
3002 | } |
3003 | |
3004 | unsafe impl<'a> glib::value::FromValue<'a> for StateChange { |
3005 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
3006 | |
3007 | #[inline ] |
3008 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
3009 | skip_assert_initialized!(); |
3010 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
3011 | } |
3012 | } |
3013 | |
3014 | impl ToValue for StateChange { |
3015 | #[inline ] |
3016 | fn to_value(&self) -> glib::Value { |
3017 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
3018 | unsafe { |
3019 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
3020 | } |
3021 | value |
3022 | } |
3023 | |
3024 | #[inline ] |
3025 | fn value_type(&self) -> glib::Type { |
3026 | Self::static_type() |
3027 | } |
3028 | } |
3029 | |
3030 | impl From<StateChange> for glib::Value { |
3031 | #[inline ] |
3032 | fn from(v: StateChange) -> Self { |
3033 | skip_assert_initialized!(); |
3034 | ToValue::to_value(&v) |
3035 | } |
3036 | } |
3037 | |
3038 | #[must_use ] |
3039 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
3040 | #[repr (i32)] |
3041 | #[doc (alias = "GstStateChangeReturn" )] |
3042 | pub enum StateChangeReturn { |
3043 | #[doc (alias = "GST_STATE_CHANGE_FAILURE" )] |
3044 | Failure = ffi::GST_STATE_CHANGE_FAILURE, |
3045 | #[doc (alias = "GST_STATE_CHANGE_SUCCESS" )] |
3046 | Success = ffi::GST_STATE_CHANGE_SUCCESS, |
3047 | #[doc (alias = "GST_STATE_CHANGE_ASYNC" )] |
3048 | Async = ffi::GST_STATE_CHANGE_ASYNC, |
3049 | #[doc (alias = "GST_STATE_CHANGE_NO_PREROLL" )] |
3050 | NoPreroll = ffi::GST_STATE_CHANGE_NO_PREROLL, |
3051 | } |
3052 | |
3053 | #[doc (hidden)] |
3054 | impl IntoGlib for StateChangeReturn { |
3055 | type GlibType = ffi::GstStateChangeReturn; |
3056 | |
3057 | #[inline ] |
3058 | fn into_glib(self) -> ffi::GstStateChangeReturn { |
3059 | self as ffi::GstStateChangeReturn |
3060 | } |
3061 | } |
3062 | |
3063 | #[doc (hidden)] |
3064 | impl FromGlib<ffi::GstStateChangeReturn> for StateChangeReturn { |
3065 | #[inline ] |
3066 | unsafe fn from_glib(value: ffi::GstStateChangeReturn) -> Self { |
3067 | skip_assert_initialized!(); |
3068 | |
3069 | debug_assert!([ |
3070 | ffi::GST_STATE_CHANGE_FAILURE, |
3071 | ffi::GST_STATE_CHANGE_SUCCESS, |
3072 | ffi::GST_STATE_CHANGE_ASYNC, |
3073 | ffi::GST_STATE_CHANGE_NO_PREROLL |
3074 | ] |
3075 | .contains(&value)); |
3076 | std::mem::transmute(src:value) |
3077 | } |
3078 | } |
3079 | |
3080 | impl StaticType for StateChangeReturn { |
3081 | #[inline ] |
3082 | #[doc (alias = "gst_state_change_return_get_type" )] |
3083 | fn static_type() -> glib::Type { |
3084 | unsafe { from_glib(val:ffi::gst_state_change_return_get_type()) } |
3085 | } |
3086 | } |
3087 | |
3088 | impl glib::HasParamSpec for StateChangeReturn { |
3089 | type ParamSpec = glib::ParamSpecEnum; |
3090 | type SetValue = Self; |
3091 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
3092 | |
3093 | fn param_spec_builder() -> Self::BuilderFn { |
3094 | Self::ParamSpec::builder_with_default |
3095 | } |
3096 | } |
3097 | |
3098 | impl glib::value::ValueType for StateChangeReturn { |
3099 | type Type = Self; |
3100 | } |
3101 | |
3102 | unsafe impl<'a> glib::value::FromValue<'a> for StateChangeReturn { |
3103 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
3104 | |
3105 | #[inline ] |
3106 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
3107 | skip_assert_initialized!(); |
3108 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
3109 | } |
3110 | } |
3111 | |
3112 | impl ToValue for StateChangeReturn { |
3113 | #[inline ] |
3114 | fn to_value(&self) -> glib::Value { |
3115 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
3116 | unsafe { |
3117 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
3118 | } |
3119 | value |
3120 | } |
3121 | |
3122 | #[inline ] |
3123 | fn value_type(&self) -> glib::Type { |
3124 | Self::static_type() |
3125 | } |
3126 | } |
3127 | |
3128 | impl From<StateChangeReturn> for glib::Value { |
3129 | #[inline ] |
3130 | fn from(v: StateChangeReturn) -> Self { |
3131 | skip_assert_initialized!(); |
3132 | ToValue::to_value(&v) |
3133 | } |
3134 | } |
3135 | |
3136 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
3137 | #[non_exhaustive ] |
3138 | #[doc (alias = "GstStreamError" )] |
3139 | pub enum StreamError { |
3140 | #[doc (alias = "GST_STREAM_ERROR_FAILED" )] |
3141 | Failed, |
3142 | #[doc (alias = "GST_STREAM_ERROR_TOO_LAZY" )] |
3143 | TooLazy, |
3144 | #[doc (alias = "GST_STREAM_ERROR_NOT_IMPLEMENTED" )] |
3145 | NotImplemented, |
3146 | #[doc (alias = "GST_STREAM_ERROR_TYPE_NOT_FOUND" )] |
3147 | TypeNotFound, |
3148 | #[doc (alias = "GST_STREAM_ERROR_WRONG_TYPE" )] |
3149 | WrongType, |
3150 | #[doc (alias = "GST_STREAM_ERROR_CODEC_NOT_FOUND" )] |
3151 | CodecNotFound, |
3152 | #[doc (alias = "GST_STREAM_ERROR_DECODE" )] |
3153 | Decode, |
3154 | #[doc (alias = "GST_STREAM_ERROR_ENCODE" )] |
3155 | Encode, |
3156 | #[doc (alias = "GST_STREAM_ERROR_DEMUX" )] |
3157 | Demux, |
3158 | #[doc (alias = "GST_STREAM_ERROR_MUX" )] |
3159 | Mux, |
3160 | #[doc (alias = "GST_STREAM_ERROR_FORMAT" )] |
3161 | Format, |
3162 | #[doc (alias = "GST_STREAM_ERROR_DECRYPT" )] |
3163 | Decrypt, |
3164 | #[doc (alias = "GST_STREAM_ERROR_DECRYPT_NOKEY" )] |
3165 | DecryptNokey, |
3166 | #[doc (hidden)] |
3167 | __Unknown(i32), |
3168 | } |
3169 | |
3170 | #[doc (hidden)] |
3171 | impl IntoGlib for StreamError { |
3172 | type GlibType = ffi::GstStreamError; |
3173 | |
3174 | fn into_glib(self) -> ffi::GstStreamError { |
3175 | match self { |
3176 | Self::Failed => ffi::GST_STREAM_ERROR_FAILED, |
3177 | Self::TooLazy => ffi::GST_STREAM_ERROR_TOO_LAZY, |
3178 | Self::NotImplemented => ffi::GST_STREAM_ERROR_NOT_IMPLEMENTED, |
3179 | Self::TypeNotFound => ffi::GST_STREAM_ERROR_TYPE_NOT_FOUND, |
3180 | Self::WrongType => ffi::GST_STREAM_ERROR_WRONG_TYPE, |
3181 | Self::CodecNotFound => ffi::GST_STREAM_ERROR_CODEC_NOT_FOUND, |
3182 | Self::Decode => ffi::GST_STREAM_ERROR_DECODE, |
3183 | Self::Encode => ffi::GST_STREAM_ERROR_ENCODE, |
3184 | Self::Demux => ffi::GST_STREAM_ERROR_DEMUX, |
3185 | Self::Mux => ffi::GST_STREAM_ERROR_MUX, |
3186 | Self::Format => ffi::GST_STREAM_ERROR_FORMAT, |
3187 | Self::Decrypt => ffi::GST_STREAM_ERROR_DECRYPT, |
3188 | Self::DecryptNokey => ffi::GST_STREAM_ERROR_DECRYPT_NOKEY, |
3189 | Self::__Unknown(value: i32) => value, |
3190 | } |
3191 | } |
3192 | } |
3193 | |
3194 | #[doc (hidden)] |
3195 | impl FromGlib<ffi::GstStreamError> for StreamError { |
3196 | unsafe fn from_glib(value: ffi::GstStreamError) -> Self { |
3197 | skip_assert_initialized!(); |
3198 | |
3199 | match value { |
3200 | ffi::GST_STREAM_ERROR_FAILED => Self::Failed, |
3201 | ffi::GST_STREAM_ERROR_TOO_LAZY => Self::TooLazy, |
3202 | ffi::GST_STREAM_ERROR_NOT_IMPLEMENTED => Self::NotImplemented, |
3203 | ffi::GST_STREAM_ERROR_TYPE_NOT_FOUND => Self::TypeNotFound, |
3204 | ffi::GST_STREAM_ERROR_WRONG_TYPE => Self::WrongType, |
3205 | ffi::GST_STREAM_ERROR_CODEC_NOT_FOUND => Self::CodecNotFound, |
3206 | ffi::GST_STREAM_ERROR_DECODE => Self::Decode, |
3207 | ffi::GST_STREAM_ERROR_ENCODE => Self::Encode, |
3208 | ffi::GST_STREAM_ERROR_DEMUX => Self::Demux, |
3209 | ffi::GST_STREAM_ERROR_MUX => Self::Mux, |
3210 | ffi::GST_STREAM_ERROR_FORMAT => Self::Format, |
3211 | ffi::GST_STREAM_ERROR_DECRYPT => Self::Decrypt, |
3212 | ffi::GST_STREAM_ERROR_DECRYPT_NOKEY => Self::DecryptNokey, |
3213 | value: i32 => Self::__Unknown(value), |
3214 | } |
3215 | } |
3216 | } |
3217 | |
3218 | impl glib::error::ErrorDomain for StreamError { |
3219 | #[inline ] |
3220 | fn domain() -> glib::Quark { |
3221 | skip_assert_initialized!(); |
3222 | |
3223 | unsafe { from_glib(val:ffi::gst_stream_error_quark()) } |
3224 | } |
3225 | |
3226 | #[inline ] |
3227 | fn code(self) -> i32 { |
3228 | self.into_glib() |
3229 | } |
3230 | |
3231 | #[inline ] |
3232 | #[allow (clippy::match_single_binding)] |
3233 | fn from(code: i32) -> Option<Self> { |
3234 | skip_assert_initialized!(); |
3235 | match unsafe { from_glib(val:code) } { |
3236 | Self::__Unknown(_) => Some(Self::Failed), |
3237 | value: StreamError => Some(value), |
3238 | } |
3239 | } |
3240 | } |
3241 | |
3242 | impl StaticType for StreamError { |
3243 | #[inline ] |
3244 | #[doc (alias = "gst_stream_error_get_type" )] |
3245 | fn static_type() -> glib::Type { |
3246 | unsafe { from_glib(val:ffi::gst_stream_error_get_type()) } |
3247 | } |
3248 | } |
3249 | |
3250 | impl glib::HasParamSpec for StreamError { |
3251 | type ParamSpec = glib::ParamSpecEnum; |
3252 | type SetValue = Self; |
3253 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
3254 | |
3255 | fn param_spec_builder() -> Self::BuilderFn { |
3256 | Self::ParamSpec::builder_with_default |
3257 | } |
3258 | } |
3259 | |
3260 | impl glib::value::ValueType for StreamError { |
3261 | type Type = Self; |
3262 | } |
3263 | |
3264 | unsafe impl<'a> glib::value::FromValue<'a> for StreamError { |
3265 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
3266 | |
3267 | #[inline ] |
3268 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
3269 | skip_assert_initialized!(); |
3270 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
3271 | } |
3272 | } |
3273 | |
3274 | impl ToValue for StreamError { |
3275 | #[inline ] |
3276 | fn to_value(&self) -> glib::Value { |
3277 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
3278 | unsafe { |
3279 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
3280 | } |
3281 | value |
3282 | } |
3283 | |
3284 | #[inline ] |
3285 | fn value_type(&self) -> glib::Type { |
3286 | Self::static_type() |
3287 | } |
3288 | } |
3289 | |
3290 | impl From<StreamError> for glib::Value { |
3291 | #[inline ] |
3292 | fn from(v: StreamError) -> Self { |
3293 | skip_assert_initialized!(); |
3294 | ToValue::to_value(&v) |
3295 | } |
3296 | } |
3297 | |
3298 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
3299 | #[non_exhaustive ] |
3300 | #[doc (alias = "GstStreamStatusType" )] |
3301 | pub enum StreamStatusType { |
3302 | #[doc (alias = "GST_STREAM_STATUS_TYPE_CREATE" )] |
3303 | Create, |
3304 | #[doc (alias = "GST_STREAM_STATUS_TYPE_ENTER" )] |
3305 | Enter, |
3306 | #[doc (alias = "GST_STREAM_STATUS_TYPE_LEAVE" )] |
3307 | Leave, |
3308 | #[doc (alias = "GST_STREAM_STATUS_TYPE_DESTROY" )] |
3309 | Destroy, |
3310 | #[doc (alias = "GST_STREAM_STATUS_TYPE_START" )] |
3311 | Start, |
3312 | #[doc (alias = "GST_STREAM_STATUS_TYPE_PAUSE" )] |
3313 | Pause, |
3314 | #[doc (alias = "GST_STREAM_STATUS_TYPE_STOP" )] |
3315 | Stop, |
3316 | #[doc (hidden)] |
3317 | __Unknown(i32), |
3318 | } |
3319 | |
3320 | #[doc (hidden)] |
3321 | impl IntoGlib for StreamStatusType { |
3322 | type GlibType = ffi::GstStreamStatusType; |
3323 | |
3324 | #[inline ] |
3325 | fn into_glib(self) -> ffi::GstStreamStatusType { |
3326 | match self { |
3327 | Self::Create => ffi::GST_STREAM_STATUS_TYPE_CREATE, |
3328 | Self::Enter => ffi::GST_STREAM_STATUS_TYPE_ENTER, |
3329 | Self::Leave => ffi::GST_STREAM_STATUS_TYPE_LEAVE, |
3330 | Self::Destroy => ffi::GST_STREAM_STATUS_TYPE_DESTROY, |
3331 | Self::Start => ffi::GST_STREAM_STATUS_TYPE_START, |
3332 | Self::Pause => ffi::GST_STREAM_STATUS_TYPE_PAUSE, |
3333 | Self::Stop => ffi::GST_STREAM_STATUS_TYPE_STOP, |
3334 | Self::__Unknown(value: i32) => value, |
3335 | } |
3336 | } |
3337 | } |
3338 | |
3339 | #[doc (hidden)] |
3340 | impl FromGlib<ffi::GstStreamStatusType> for StreamStatusType { |
3341 | #[inline ] |
3342 | unsafe fn from_glib(value: ffi::GstStreamStatusType) -> Self { |
3343 | skip_assert_initialized!(); |
3344 | |
3345 | match value { |
3346 | ffi::GST_STREAM_STATUS_TYPE_CREATE => Self::Create, |
3347 | ffi::GST_STREAM_STATUS_TYPE_ENTER => Self::Enter, |
3348 | ffi::GST_STREAM_STATUS_TYPE_LEAVE => Self::Leave, |
3349 | ffi::GST_STREAM_STATUS_TYPE_DESTROY => Self::Destroy, |
3350 | ffi::GST_STREAM_STATUS_TYPE_START => Self::Start, |
3351 | ffi::GST_STREAM_STATUS_TYPE_PAUSE => Self::Pause, |
3352 | ffi::GST_STREAM_STATUS_TYPE_STOP => Self::Stop, |
3353 | value: i32 => Self::__Unknown(value), |
3354 | } |
3355 | } |
3356 | } |
3357 | |
3358 | impl StaticType for StreamStatusType { |
3359 | #[inline ] |
3360 | #[doc (alias = "gst_stream_status_type_get_type" )] |
3361 | fn static_type() -> glib::Type { |
3362 | unsafe { from_glib(val:ffi::gst_stream_status_type_get_type()) } |
3363 | } |
3364 | } |
3365 | |
3366 | impl glib::HasParamSpec for StreamStatusType { |
3367 | type ParamSpec = glib::ParamSpecEnum; |
3368 | type SetValue = Self; |
3369 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
3370 | |
3371 | fn param_spec_builder() -> Self::BuilderFn { |
3372 | Self::ParamSpec::builder_with_default |
3373 | } |
3374 | } |
3375 | |
3376 | impl glib::value::ValueType for StreamStatusType { |
3377 | type Type = Self; |
3378 | } |
3379 | |
3380 | unsafe impl<'a> glib::value::FromValue<'a> for StreamStatusType { |
3381 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
3382 | |
3383 | #[inline ] |
3384 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
3385 | skip_assert_initialized!(); |
3386 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
3387 | } |
3388 | } |
3389 | |
3390 | impl ToValue for StreamStatusType { |
3391 | #[inline ] |
3392 | fn to_value(&self) -> glib::Value { |
3393 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
3394 | unsafe { |
3395 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
3396 | } |
3397 | value |
3398 | } |
3399 | |
3400 | #[inline ] |
3401 | fn value_type(&self) -> glib::Type { |
3402 | Self::static_type() |
3403 | } |
3404 | } |
3405 | |
3406 | impl From<StreamStatusType> for glib::Value { |
3407 | #[inline ] |
3408 | fn from(v: StreamStatusType) -> Self { |
3409 | skip_assert_initialized!(); |
3410 | ToValue::to_value(&v) |
3411 | } |
3412 | } |
3413 | |
3414 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
3415 | #[non_exhaustive ] |
3416 | #[doc (alias = "GstStructureChangeType" )] |
3417 | pub enum StructureChangeType { |
3418 | #[doc (alias = "GST_STRUCTURE_CHANGE_TYPE_PAD_LINK" )] |
3419 | Link, |
3420 | #[doc (alias = "GST_STRUCTURE_CHANGE_TYPE_PAD_UNLINK" )] |
3421 | Unlink, |
3422 | #[doc (hidden)] |
3423 | __Unknown(i32), |
3424 | } |
3425 | |
3426 | #[doc (hidden)] |
3427 | impl IntoGlib for StructureChangeType { |
3428 | type GlibType = ffi::GstStructureChangeType; |
3429 | |
3430 | #[inline ] |
3431 | fn into_glib(self) -> ffi::GstStructureChangeType { |
3432 | match self { |
3433 | Self::Link => ffi::GST_STRUCTURE_CHANGE_TYPE_PAD_LINK, |
3434 | Self::Unlink => ffi::GST_STRUCTURE_CHANGE_TYPE_PAD_UNLINK, |
3435 | Self::__Unknown(value: i32) => value, |
3436 | } |
3437 | } |
3438 | } |
3439 | |
3440 | #[doc (hidden)] |
3441 | impl FromGlib<ffi::GstStructureChangeType> for StructureChangeType { |
3442 | #[inline ] |
3443 | unsafe fn from_glib(value: ffi::GstStructureChangeType) -> Self { |
3444 | skip_assert_initialized!(); |
3445 | |
3446 | match value { |
3447 | ffi::GST_STRUCTURE_CHANGE_TYPE_PAD_LINK => Self::Link, |
3448 | ffi::GST_STRUCTURE_CHANGE_TYPE_PAD_UNLINK => Self::Unlink, |
3449 | value: i32 => Self::__Unknown(value), |
3450 | } |
3451 | } |
3452 | } |
3453 | |
3454 | impl StaticType for StructureChangeType { |
3455 | #[inline ] |
3456 | #[doc (alias = "gst_structure_change_type_get_type" )] |
3457 | fn static_type() -> glib::Type { |
3458 | unsafe { from_glib(val:ffi::gst_structure_change_type_get_type()) } |
3459 | } |
3460 | } |
3461 | |
3462 | impl glib::HasParamSpec for StructureChangeType { |
3463 | type ParamSpec = glib::ParamSpecEnum; |
3464 | type SetValue = Self; |
3465 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
3466 | |
3467 | fn param_spec_builder() -> Self::BuilderFn { |
3468 | Self::ParamSpec::builder_with_default |
3469 | } |
3470 | } |
3471 | |
3472 | impl glib::value::ValueType for StructureChangeType { |
3473 | type Type = Self; |
3474 | } |
3475 | |
3476 | unsafe impl<'a> glib::value::FromValue<'a> for StructureChangeType { |
3477 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
3478 | |
3479 | #[inline ] |
3480 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
3481 | skip_assert_initialized!(); |
3482 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
3483 | } |
3484 | } |
3485 | |
3486 | impl ToValue for StructureChangeType { |
3487 | #[inline ] |
3488 | fn to_value(&self) -> glib::Value { |
3489 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
3490 | unsafe { |
3491 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
3492 | } |
3493 | value |
3494 | } |
3495 | |
3496 | #[inline ] |
3497 | fn value_type(&self) -> glib::Type { |
3498 | Self::static_type() |
3499 | } |
3500 | } |
3501 | |
3502 | impl From<StructureChangeType> for glib::Value { |
3503 | #[inline ] |
3504 | fn from(v: StructureChangeType) -> Self { |
3505 | skip_assert_initialized!(); |
3506 | ToValue::to_value(&v) |
3507 | } |
3508 | } |
3509 | |
3510 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
3511 | #[non_exhaustive ] |
3512 | #[doc (alias = "GstTagFlag" )] |
3513 | pub enum TagFlag { |
3514 | #[doc (alias = "GST_TAG_FLAG_UNDEFINED" )] |
3515 | Undefined, |
3516 | #[doc (alias = "GST_TAG_FLAG_META" )] |
3517 | Meta, |
3518 | #[doc (alias = "GST_TAG_FLAG_ENCODED" )] |
3519 | Encoded, |
3520 | #[doc (alias = "GST_TAG_FLAG_DECODED" )] |
3521 | Decoded, |
3522 | #[doc (hidden)] |
3523 | __Unknown(i32), |
3524 | } |
3525 | |
3526 | #[doc (hidden)] |
3527 | impl IntoGlib for TagFlag { |
3528 | type GlibType = ffi::GstTagFlag; |
3529 | |
3530 | #[inline ] |
3531 | fn into_glib(self) -> ffi::GstTagFlag { |
3532 | match self { |
3533 | Self::Undefined => ffi::GST_TAG_FLAG_UNDEFINED, |
3534 | Self::Meta => ffi::GST_TAG_FLAG_META, |
3535 | Self::Encoded => ffi::GST_TAG_FLAG_ENCODED, |
3536 | Self::Decoded => ffi::GST_TAG_FLAG_DECODED, |
3537 | Self::__Unknown(value: i32) => value, |
3538 | } |
3539 | } |
3540 | } |
3541 | |
3542 | #[doc (hidden)] |
3543 | impl FromGlib<ffi::GstTagFlag> for TagFlag { |
3544 | #[inline ] |
3545 | unsafe fn from_glib(value: ffi::GstTagFlag) -> Self { |
3546 | skip_assert_initialized!(); |
3547 | |
3548 | match value { |
3549 | ffi::GST_TAG_FLAG_UNDEFINED => Self::Undefined, |
3550 | ffi::GST_TAG_FLAG_META => Self::Meta, |
3551 | ffi::GST_TAG_FLAG_ENCODED => Self::Encoded, |
3552 | ffi::GST_TAG_FLAG_DECODED => Self::Decoded, |
3553 | value: i32 => Self::__Unknown(value), |
3554 | } |
3555 | } |
3556 | } |
3557 | |
3558 | impl StaticType for TagFlag { |
3559 | #[inline ] |
3560 | #[doc (alias = "gst_tag_flag_get_type" )] |
3561 | fn static_type() -> glib::Type { |
3562 | unsafe { from_glib(val:ffi::gst_tag_flag_get_type()) } |
3563 | } |
3564 | } |
3565 | |
3566 | impl glib::HasParamSpec for TagFlag { |
3567 | type ParamSpec = glib::ParamSpecEnum; |
3568 | type SetValue = Self; |
3569 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
3570 | |
3571 | fn param_spec_builder() -> Self::BuilderFn { |
3572 | Self::ParamSpec::builder_with_default |
3573 | } |
3574 | } |
3575 | |
3576 | impl glib::value::ValueType for TagFlag { |
3577 | type Type = Self; |
3578 | } |
3579 | |
3580 | unsafe impl<'a> glib::value::FromValue<'a> for TagFlag { |
3581 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
3582 | |
3583 | #[inline ] |
3584 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
3585 | skip_assert_initialized!(); |
3586 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
3587 | } |
3588 | } |
3589 | |
3590 | impl ToValue for TagFlag { |
3591 | #[inline ] |
3592 | fn to_value(&self) -> glib::Value { |
3593 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
3594 | unsafe { |
3595 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
3596 | } |
3597 | value |
3598 | } |
3599 | |
3600 | #[inline ] |
3601 | fn value_type(&self) -> glib::Type { |
3602 | Self::static_type() |
3603 | } |
3604 | } |
3605 | |
3606 | impl From<TagFlag> for glib::Value { |
3607 | #[inline ] |
3608 | fn from(v: TagFlag) -> Self { |
3609 | skip_assert_initialized!(); |
3610 | ToValue::to_value(&v) |
3611 | } |
3612 | } |
3613 | |
3614 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
3615 | #[non_exhaustive ] |
3616 | #[doc (alias = "GstTagMergeMode" )] |
3617 | pub enum TagMergeMode { |
3618 | #[doc (alias = "GST_TAG_MERGE_UNDEFINED" )] |
3619 | Undefined, |
3620 | #[doc (alias = "GST_TAG_MERGE_REPLACE_ALL" )] |
3621 | ReplaceAll, |
3622 | #[doc (alias = "GST_TAG_MERGE_REPLACE" )] |
3623 | Replace, |
3624 | #[doc (alias = "GST_TAG_MERGE_APPEND" )] |
3625 | Append, |
3626 | #[doc (alias = "GST_TAG_MERGE_PREPEND" )] |
3627 | Prepend, |
3628 | #[doc (alias = "GST_TAG_MERGE_KEEP" )] |
3629 | Keep, |
3630 | #[doc (alias = "GST_TAG_MERGE_KEEP_ALL" )] |
3631 | KeepAll, |
3632 | #[doc (hidden)] |
3633 | __Unknown(i32), |
3634 | } |
3635 | |
3636 | #[doc (hidden)] |
3637 | impl IntoGlib for TagMergeMode { |
3638 | type GlibType = ffi::GstTagMergeMode; |
3639 | |
3640 | #[inline ] |
3641 | fn into_glib(self) -> ffi::GstTagMergeMode { |
3642 | match self { |
3643 | Self::Undefined => ffi::GST_TAG_MERGE_UNDEFINED, |
3644 | Self::ReplaceAll => ffi::GST_TAG_MERGE_REPLACE_ALL, |
3645 | Self::Replace => ffi::GST_TAG_MERGE_REPLACE, |
3646 | Self::Append => ffi::GST_TAG_MERGE_APPEND, |
3647 | Self::Prepend => ffi::GST_TAG_MERGE_PREPEND, |
3648 | Self::Keep => ffi::GST_TAG_MERGE_KEEP, |
3649 | Self::KeepAll => ffi::GST_TAG_MERGE_KEEP_ALL, |
3650 | Self::__Unknown(value: i32) => value, |
3651 | } |
3652 | } |
3653 | } |
3654 | |
3655 | #[doc (hidden)] |
3656 | impl FromGlib<ffi::GstTagMergeMode> for TagMergeMode { |
3657 | #[inline ] |
3658 | unsafe fn from_glib(value: ffi::GstTagMergeMode) -> Self { |
3659 | skip_assert_initialized!(); |
3660 | |
3661 | match value { |
3662 | ffi::GST_TAG_MERGE_UNDEFINED => Self::Undefined, |
3663 | ffi::GST_TAG_MERGE_REPLACE_ALL => Self::ReplaceAll, |
3664 | ffi::GST_TAG_MERGE_REPLACE => Self::Replace, |
3665 | ffi::GST_TAG_MERGE_APPEND => Self::Append, |
3666 | ffi::GST_TAG_MERGE_PREPEND => Self::Prepend, |
3667 | ffi::GST_TAG_MERGE_KEEP => Self::Keep, |
3668 | ffi::GST_TAG_MERGE_KEEP_ALL => Self::KeepAll, |
3669 | value: i32 => Self::__Unknown(value), |
3670 | } |
3671 | } |
3672 | } |
3673 | |
3674 | impl StaticType for TagMergeMode { |
3675 | #[inline ] |
3676 | #[doc (alias = "gst_tag_merge_mode_get_type" )] |
3677 | fn static_type() -> glib::Type { |
3678 | unsafe { from_glib(val:ffi::gst_tag_merge_mode_get_type()) } |
3679 | } |
3680 | } |
3681 | |
3682 | impl glib::HasParamSpec for TagMergeMode { |
3683 | type ParamSpec = glib::ParamSpecEnum; |
3684 | type SetValue = Self; |
3685 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
3686 | |
3687 | fn param_spec_builder() -> Self::BuilderFn { |
3688 | Self::ParamSpec::builder_with_default |
3689 | } |
3690 | } |
3691 | |
3692 | impl glib::value::ValueType for TagMergeMode { |
3693 | type Type = Self; |
3694 | } |
3695 | |
3696 | unsafe impl<'a> glib::value::FromValue<'a> for TagMergeMode { |
3697 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
3698 | |
3699 | #[inline ] |
3700 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
3701 | skip_assert_initialized!(); |
3702 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
3703 | } |
3704 | } |
3705 | |
3706 | impl ToValue for TagMergeMode { |
3707 | #[inline ] |
3708 | fn to_value(&self) -> glib::Value { |
3709 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
3710 | unsafe { |
3711 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
3712 | } |
3713 | value |
3714 | } |
3715 | |
3716 | #[inline ] |
3717 | fn value_type(&self) -> glib::Type { |
3718 | Self::static_type() |
3719 | } |
3720 | } |
3721 | |
3722 | impl From<TagMergeMode> for glib::Value { |
3723 | #[inline ] |
3724 | fn from(v: TagMergeMode) -> Self { |
3725 | skip_assert_initialized!(); |
3726 | ToValue::to_value(&v) |
3727 | } |
3728 | } |
3729 | |
3730 | #[cfg_attr (feature = "serde" , derive(serde::Serialize, serde::Deserialize))] |
3731 | #[derive (Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)] |
3732 | #[non_exhaustive ] |
3733 | #[doc (alias = "GstTagScope" )] |
3734 | pub enum TagScope { |
3735 | #[doc (alias = "GST_TAG_SCOPE_STREAM" )] |
3736 | Stream, |
3737 | #[doc (alias = "GST_TAG_SCOPE_GLOBAL" )] |
3738 | Global, |
3739 | #[doc (hidden)] |
3740 | __Unknown(i32), |
3741 | } |
3742 | |
3743 | #[doc (hidden)] |
3744 | impl IntoGlib for TagScope { |
3745 | type GlibType = ffi::GstTagScope; |
3746 | |
3747 | #[inline ] |
3748 | fn into_glib(self) -> ffi::GstTagScope { |
3749 | match self { |
3750 | Self::Stream => ffi::GST_TAG_SCOPE_STREAM, |
3751 | Self::Global => ffi::GST_TAG_SCOPE_GLOBAL, |
3752 | Self::__Unknown(value: i32) => value, |
3753 | } |
3754 | } |
3755 | } |
3756 | |
3757 | #[doc (hidden)] |
3758 | impl FromGlib<ffi::GstTagScope> for TagScope { |
3759 | #[inline ] |
3760 | unsafe fn from_glib(value: ffi::GstTagScope) -> Self { |
3761 | skip_assert_initialized!(); |
3762 | |
3763 | match value { |
3764 | ffi::GST_TAG_SCOPE_STREAM => Self::Stream, |
3765 | ffi::GST_TAG_SCOPE_GLOBAL => Self::Global, |
3766 | value: i32 => Self::__Unknown(value), |
3767 | } |
3768 | } |
3769 | } |
3770 | |
3771 | impl StaticType for TagScope { |
3772 | #[inline ] |
3773 | #[doc (alias = "gst_tag_scope_get_type" )] |
3774 | fn static_type() -> glib::Type { |
3775 | unsafe { from_glib(val:ffi::gst_tag_scope_get_type()) } |
3776 | } |
3777 | } |
3778 | |
3779 | impl glib::HasParamSpec for TagScope { |
3780 | type ParamSpec = glib::ParamSpecEnum; |
3781 | type SetValue = Self; |
3782 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
3783 | |
3784 | fn param_spec_builder() -> Self::BuilderFn { |
3785 | Self::ParamSpec::builder_with_default |
3786 | } |
3787 | } |
3788 | |
3789 | impl glib::value::ValueType for TagScope { |
3790 | type Type = Self; |
3791 | } |
3792 | |
3793 | unsafe impl<'a> glib::value::FromValue<'a> for TagScope { |
3794 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
3795 | |
3796 | #[inline ] |
3797 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
3798 | skip_assert_initialized!(); |
3799 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
3800 | } |
3801 | } |
3802 | |
3803 | impl ToValue for TagScope { |
3804 | #[inline ] |
3805 | fn to_value(&self) -> glib::Value { |
3806 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
3807 | unsafe { |
3808 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
3809 | } |
3810 | value |
3811 | } |
3812 | |
3813 | #[inline ] |
3814 | fn value_type(&self) -> glib::Type { |
3815 | Self::static_type() |
3816 | } |
3817 | } |
3818 | |
3819 | impl From<TagScope> for glib::Value { |
3820 | #[inline ] |
3821 | fn from(v: TagScope) -> Self { |
3822 | skip_assert_initialized!(); |
3823 | ToValue::to_value(&v) |
3824 | } |
3825 | } |
3826 | |
3827 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
3828 | #[non_exhaustive ] |
3829 | #[doc (alias = "GstTaskState" )] |
3830 | pub enum TaskState { |
3831 | #[doc (alias = "GST_TASK_STARTED" )] |
3832 | Started, |
3833 | #[doc (alias = "GST_TASK_STOPPED" )] |
3834 | Stopped, |
3835 | #[doc (alias = "GST_TASK_PAUSED" )] |
3836 | Paused, |
3837 | #[doc (hidden)] |
3838 | __Unknown(i32), |
3839 | } |
3840 | |
3841 | #[doc (hidden)] |
3842 | impl IntoGlib for TaskState { |
3843 | type GlibType = ffi::GstTaskState; |
3844 | |
3845 | #[inline ] |
3846 | fn into_glib(self) -> ffi::GstTaskState { |
3847 | match self { |
3848 | Self::Started => ffi::GST_TASK_STARTED, |
3849 | Self::Stopped => ffi::GST_TASK_STOPPED, |
3850 | Self::Paused => ffi::GST_TASK_PAUSED, |
3851 | Self::__Unknown(value: i32) => value, |
3852 | } |
3853 | } |
3854 | } |
3855 | |
3856 | #[doc (hidden)] |
3857 | impl FromGlib<ffi::GstTaskState> for TaskState { |
3858 | #[inline ] |
3859 | unsafe fn from_glib(value: ffi::GstTaskState) -> Self { |
3860 | skip_assert_initialized!(); |
3861 | |
3862 | match value { |
3863 | ffi::GST_TASK_STARTED => Self::Started, |
3864 | ffi::GST_TASK_STOPPED => Self::Stopped, |
3865 | ffi::GST_TASK_PAUSED => Self::Paused, |
3866 | value: i32 => Self::__Unknown(value), |
3867 | } |
3868 | } |
3869 | } |
3870 | |
3871 | impl StaticType for TaskState { |
3872 | #[inline ] |
3873 | #[doc (alias = "gst_task_state_get_type" )] |
3874 | fn static_type() -> glib::Type { |
3875 | unsafe { from_glib(val:ffi::gst_task_state_get_type()) } |
3876 | } |
3877 | } |
3878 | |
3879 | impl glib::HasParamSpec for TaskState { |
3880 | type ParamSpec = glib::ParamSpecEnum; |
3881 | type SetValue = Self; |
3882 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
3883 | |
3884 | fn param_spec_builder() -> Self::BuilderFn { |
3885 | Self::ParamSpec::builder_with_default |
3886 | } |
3887 | } |
3888 | |
3889 | impl glib::value::ValueType for TaskState { |
3890 | type Type = Self; |
3891 | } |
3892 | |
3893 | unsafe impl<'a> glib::value::FromValue<'a> for TaskState { |
3894 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
3895 | |
3896 | #[inline ] |
3897 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
3898 | skip_assert_initialized!(); |
3899 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
3900 | } |
3901 | } |
3902 | |
3903 | impl ToValue for TaskState { |
3904 | #[inline ] |
3905 | fn to_value(&self) -> glib::Value { |
3906 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
3907 | unsafe { |
3908 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
3909 | } |
3910 | value |
3911 | } |
3912 | |
3913 | #[inline ] |
3914 | fn value_type(&self) -> glib::Type { |
3915 | Self::static_type() |
3916 | } |
3917 | } |
3918 | |
3919 | impl From<TaskState> for glib::Value { |
3920 | #[inline ] |
3921 | fn from(v: TaskState) -> Self { |
3922 | skip_assert_initialized!(); |
3923 | ToValue::to_value(&v) |
3924 | } |
3925 | } |
3926 | |
3927 | #[cfg_attr (feature = "serde" , derive(serde::Serialize, serde::Deserialize))] |
3928 | #[derive (Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)] |
3929 | #[non_exhaustive ] |
3930 | #[doc (alias = "GstTocEntryType" )] |
3931 | pub enum TocEntryType { |
3932 | #[doc (alias = "GST_TOC_ENTRY_TYPE_ANGLE" )] |
3933 | Angle, |
3934 | #[doc (alias = "GST_TOC_ENTRY_TYPE_VERSION" )] |
3935 | Version, |
3936 | #[doc (alias = "GST_TOC_ENTRY_TYPE_EDITION" )] |
3937 | Edition, |
3938 | #[doc (alias = "GST_TOC_ENTRY_TYPE_INVALID" )] |
3939 | Invalid, |
3940 | #[doc (alias = "GST_TOC_ENTRY_TYPE_TITLE" )] |
3941 | Title, |
3942 | #[doc (alias = "GST_TOC_ENTRY_TYPE_TRACK" )] |
3943 | Track, |
3944 | #[doc (alias = "GST_TOC_ENTRY_TYPE_CHAPTER" )] |
3945 | Chapter, |
3946 | #[doc (hidden)] |
3947 | __Unknown(i32), |
3948 | } |
3949 | |
3950 | impl TocEntryType { |
3951 | pub fn nick<'a>(self) -> &'a GStr { |
3952 | unsafe { |
3953 | GStr::from_ptr( |
3954 | ffi::gst_toc_entry_type_get_nick(self.into_glib()) |
3955 | .as_ref() |
3956 | .expect(msg:"gst_toc_entry_type_get_nick returned NULL" ), |
3957 | ) |
3958 | } |
3959 | } |
3960 | } |
3961 | |
3962 | #[doc (hidden)] |
3963 | impl IntoGlib for TocEntryType { |
3964 | type GlibType = ffi::GstTocEntryType; |
3965 | |
3966 | #[inline ] |
3967 | fn into_glib(self) -> ffi::GstTocEntryType { |
3968 | match self { |
3969 | Self::Angle => ffi::GST_TOC_ENTRY_TYPE_ANGLE, |
3970 | Self::Version => ffi::GST_TOC_ENTRY_TYPE_VERSION, |
3971 | Self::Edition => ffi::GST_TOC_ENTRY_TYPE_EDITION, |
3972 | Self::Invalid => ffi::GST_TOC_ENTRY_TYPE_INVALID, |
3973 | Self::Title => ffi::GST_TOC_ENTRY_TYPE_TITLE, |
3974 | Self::Track => ffi::GST_TOC_ENTRY_TYPE_TRACK, |
3975 | Self::Chapter => ffi::GST_TOC_ENTRY_TYPE_CHAPTER, |
3976 | Self::__Unknown(value: i32) => value, |
3977 | } |
3978 | } |
3979 | } |
3980 | |
3981 | #[doc (hidden)] |
3982 | impl FromGlib<ffi::GstTocEntryType> for TocEntryType { |
3983 | #[inline ] |
3984 | unsafe fn from_glib(value: ffi::GstTocEntryType) -> Self { |
3985 | skip_assert_initialized!(); |
3986 | |
3987 | match value { |
3988 | ffi::GST_TOC_ENTRY_TYPE_ANGLE => Self::Angle, |
3989 | ffi::GST_TOC_ENTRY_TYPE_VERSION => Self::Version, |
3990 | ffi::GST_TOC_ENTRY_TYPE_EDITION => Self::Edition, |
3991 | ffi::GST_TOC_ENTRY_TYPE_INVALID => Self::Invalid, |
3992 | ffi::GST_TOC_ENTRY_TYPE_TITLE => Self::Title, |
3993 | ffi::GST_TOC_ENTRY_TYPE_TRACK => Self::Track, |
3994 | ffi::GST_TOC_ENTRY_TYPE_CHAPTER => Self::Chapter, |
3995 | value: i32 => Self::__Unknown(value), |
3996 | } |
3997 | } |
3998 | } |
3999 | |
4000 | impl StaticType for TocEntryType { |
4001 | #[inline ] |
4002 | #[doc (alias = "gst_toc_entry_type_get_type" )] |
4003 | fn static_type() -> glib::Type { |
4004 | unsafe { from_glib(val:ffi::gst_toc_entry_type_get_type()) } |
4005 | } |
4006 | } |
4007 | |
4008 | impl glib::HasParamSpec for TocEntryType { |
4009 | type ParamSpec = glib::ParamSpecEnum; |
4010 | type SetValue = Self; |
4011 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
4012 | |
4013 | fn param_spec_builder() -> Self::BuilderFn { |
4014 | Self::ParamSpec::builder_with_default |
4015 | } |
4016 | } |
4017 | |
4018 | impl glib::value::ValueType for TocEntryType { |
4019 | type Type = Self; |
4020 | } |
4021 | |
4022 | unsafe impl<'a> glib::value::FromValue<'a> for TocEntryType { |
4023 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
4024 | |
4025 | #[inline ] |
4026 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
4027 | skip_assert_initialized!(); |
4028 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
4029 | } |
4030 | } |
4031 | |
4032 | impl ToValue for TocEntryType { |
4033 | #[inline ] |
4034 | fn to_value(&self) -> glib::Value { |
4035 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
4036 | unsafe { |
4037 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
4038 | } |
4039 | value |
4040 | } |
4041 | |
4042 | #[inline ] |
4043 | fn value_type(&self) -> glib::Type { |
4044 | Self::static_type() |
4045 | } |
4046 | } |
4047 | |
4048 | impl From<TocEntryType> for glib::Value { |
4049 | #[inline ] |
4050 | fn from(v: TocEntryType) -> Self { |
4051 | skip_assert_initialized!(); |
4052 | ToValue::to_value(&v) |
4053 | } |
4054 | } |
4055 | |
4056 | #[cfg_attr (feature = "serde" , derive(serde::Serialize, serde::Deserialize))] |
4057 | #[derive (Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)] |
4058 | #[non_exhaustive ] |
4059 | #[doc (alias = "GstTocLoopType" )] |
4060 | pub enum TocLoopType { |
4061 | #[doc (alias = "GST_TOC_LOOP_NONE" )] |
4062 | None, |
4063 | #[doc (alias = "GST_TOC_LOOP_FORWARD" )] |
4064 | Forward, |
4065 | #[doc (alias = "GST_TOC_LOOP_REVERSE" )] |
4066 | Reverse, |
4067 | #[doc (alias = "GST_TOC_LOOP_PING_PONG" )] |
4068 | PingPong, |
4069 | #[doc (hidden)] |
4070 | __Unknown(i32), |
4071 | } |
4072 | |
4073 | #[doc (hidden)] |
4074 | impl IntoGlib for TocLoopType { |
4075 | type GlibType = ffi::GstTocLoopType; |
4076 | |
4077 | #[inline ] |
4078 | fn into_glib(self) -> ffi::GstTocLoopType { |
4079 | match self { |
4080 | Self::None => ffi::GST_TOC_LOOP_NONE, |
4081 | Self::Forward => ffi::GST_TOC_LOOP_FORWARD, |
4082 | Self::Reverse => ffi::GST_TOC_LOOP_REVERSE, |
4083 | Self::PingPong => ffi::GST_TOC_LOOP_PING_PONG, |
4084 | Self::__Unknown(value: i32) => value, |
4085 | } |
4086 | } |
4087 | } |
4088 | |
4089 | #[doc (hidden)] |
4090 | impl FromGlib<ffi::GstTocLoopType> for TocLoopType { |
4091 | #[inline ] |
4092 | unsafe fn from_glib(value: ffi::GstTocLoopType) -> Self { |
4093 | skip_assert_initialized!(); |
4094 | |
4095 | match value { |
4096 | ffi::GST_TOC_LOOP_NONE => Self::None, |
4097 | ffi::GST_TOC_LOOP_FORWARD => Self::Forward, |
4098 | ffi::GST_TOC_LOOP_REVERSE => Self::Reverse, |
4099 | ffi::GST_TOC_LOOP_PING_PONG => Self::PingPong, |
4100 | value: i32 => Self::__Unknown(value), |
4101 | } |
4102 | } |
4103 | } |
4104 | |
4105 | impl StaticType for TocLoopType { |
4106 | #[inline ] |
4107 | #[doc (alias = "gst_toc_loop_type_get_type" )] |
4108 | fn static_type() -> glib::Type { |
4109 | unsafe { from_glib(val:ffi::gst_toc_loop_type_get_type()) } |
4110 | } |
4111 | } |
4112 | |
4113 | impl glib::HasParamSpec for TocLoopType { |
4114 | type ParamSpec = glib::ParamSpecEnum; |
4115 | type SetValue = Self; |
4116 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
4117 | |
4118 | fn param_spec_builder() -> Self::BuilderFn { |
4119 | Self::ParamSpec::builder_with_default |
4120 | } |
4121 | } |
4122 | |
4123 | impl glib::value::ValueType for TocLoopType { |
4124 | type Type = Self; |
4125 | } |
4126 | |
4127 | unsafe impl<'a> glib::value::FromValue<'a> for TocLoopType { |
4128 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
4129 | |
4130 | #[inline ] |
4131 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
4132 | skip_assert_initialized!(); |
4133 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
4134 | } |
4135 | } |
4136 | |
4137 | impl ToValue for TocLoopType { |
4138 | #[inline ] |
4139 | fn to_value(&self) -> glib::Value { |
4140 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
4141 | unsafe { |
4142 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
4143 | } |
4144 | value |
4145 | } |
4146 | |
4147 | #[inline ] |
4148 | fn value_type(&self) -> glib::Type { |
4149 | Self::static_type() |
4150 | } |
4151 | } |
4152 | |
4153 | impl From<TocLoopType> for glib::Value { |
4154 | #[inline ] |
4155 | fn from(v: TocLoopType) -> Self { |
4156 | skip_assert_initialized!(); |
4157 | ToValue::to_value(&v) |
4158 | } |
4159 | } |
4160 | |
4161 | #[cfg_attr (feature = "serde" , derive(serde::Serialize, serde::Deserialize))] |
4162 | #[derive (Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)] |
4163 | #[non_exhaustive ] |
4164 | #[doc (alias = "GstTocScope" )] |
4165 | pub enum TocScope { |
4166 | #[doc (alias = "GST_TOC_SCOPE_GLOBAL" )] |
4167 | Global, |
4168 | #[doc (alias = "GST_TOC_SCOPE_CURRENT" )] |
4169 | Current, |
4170 | #[doc (hidden)] |
4171 | __Unknown(i32), |
4172 | } |
4173 | |
4174 | #[doc (hidden)] |
4175 | impl IntoGlib for TocScope { |
4176 | type GlibType = ffi::GstTocScope; |
4177 | |
4178 | #[inline ] |
4179 | fn into_glib(self) -> ffi::GstTocScope { |
4180 | match self { |
4181 | Self::Global => ffi::GST_TOC_SCOPE_GLOBAL, |
4182 | Self::Current => ffi::GST_TOC_SCOPE_CURRENT, |
4183 | Self::__Unknown(value: i32) => value, |
4184 | } |
4185 | } |
4186 | } |
4187 | |
4188 | #[doc (hidden)] |
4189 | impl FromGlib<ffi::GstTocScope> for TocScope { |
4190 | #[inline ] |
4191 | unsafe fn from_glib(value: ffi::GstTocScope) -> Self { |
4192 | skip_assert_initialized!(); |
4193 | |
4194 | match value { |
4195 | ffi::GST_TOC_SCOPE_GLOBAL => Self::Global, |
4196 | ffi::GST_TOC_SCOPE_CURRENT => Self::Current, |
4197 | value: i32 => Self::__Unknown(value), |
4198 | } |
4199 | } |
4200 | } |
4201 | |
4202 | impl StaticType for TocScope { |
4203 | #[inline ] |
4204 | #[doc (alias = "gst_toc_scope_get_type" )] |
4205 | fn static_type() -> glib::Type { |
4206 | unsafe { from_glib(val:ffi::gst_toc_scope_get_type()) } |
4207 | } |
4208 | } |
4209 | |
4210 | impl glib::HasParamSpec for TocScope { |
4211 | type ParamSpec = glib::ParamSpecEnum; |
4212 | type SetValue = Self; |
4213 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
4214 | |
4215 | fn param_spec_builder() -> Self::BuilderFn { |
4216 | Self::ParamSpec::builder_with_default |
4217 | } |
4218 | } |
4219 | |
4220 | impl glib::value::ValueType for TocScope { |
4221 | type Type = Self; |
4222 | } |
4223 | |
4224 | unsafe impl<'a> glib::value::FromValue<'a> for TocScope { |
4225 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
4226 | |
4227 | #[inline ] |
4228 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
4229 | skip_assert_initialized!(); |
4230 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
4231 | } |
4232 | } |
4233 | |
4234 | impl ToValue for TocScope { |
4235 | #[inline ] |
4236 | fn to_value(&self) -> glib::Value { |
4237 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
4238 | unsafe { |
4239 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
4240 | } |
4241 | value |
4242 | } |
4243 | |
4244 | #[inline ] |
4245 | fn value_type(&self) -> glib::Type { |
4246 | Self::static_type() |
4247 | } |
4248 | } |
4249 | |
4250 | impl From<TocScope> for glib::Value { |
4251 | #[inline ] |
4252 | fn from(v: TocScope) -> Self { |
4253 | skip_assert_initialized!(); |
4254 | ToValue::to_value(&v) |
4255 | } |
4256 | } |
4257 | |
4258 | #[derive (Debug, Clone, Copy)] |
4259 | #[non_exhaustive ] |
4260 | #[doc (alias = "GstTypeFindProbability" )] |
4261 | pub enum TypeFindProbability { |
4262 | #[doc (alias = "GST_TYPE_FIND_NONE" )] |
4263 | None, |
4264 | #[doc (alias = "GST_TYPE_FIND_MINIMUM" )] |
4265 | Minimum, |
4266 | #[doc (alias = "GST_TYPE_FIND_POSSIBLE" )] |
4267 | Possible, |
4268 | #[doc (alias = "GST_TYPE_FIND_LIKELY" )] |
4269 | Likely, |
4270 | #[doc (alias = "GST_TYPE_FIND_NEARLY_CERTAIN" )] |
4271 | NearlyCertain, |
4272 | #[doc (alias = "GST_TYPE_FIND_MAXIMUM" )] |
4273 | Maximum, |
4274 | #[doc (hidden)] |
4275 | __Unknown(i32), |
4276 | } |
4277 | |
4278 | #[doc (hidden)] |
4279 | impl IntoGlib for TypeFindProbability { |
4280 | type GlibType = ffi::GstTypeFindProbability; |
4281 | |
4282 | #[inline ] |
4283 | fn into_glib(self) -> ffi::GstTypeFindProbability { |
4284 | match self { |
4285 | Self::None => ffi::GST_TYPE_FIND_NONE, |
4286 | Self::Minimum => ffi::GST_TYPE_FIND_MINIMUM, |
4287 | Self::Possible => ffi::GST_TYPE_FIND_POSSIBLE, |
4288 | Self::Likely => ffi::GST_TYPE_FIND_LIKELY, |
4289 | Self::NearlyCertain => ffi::GST_TYPE_FIND_NEARLY_CERTAIN, |
4290 | Self::Maximum => ffi::GST_TYPE_FIND_MAXIMUM, |
4291 | Self::__Unknown(value: i32) => value, |
4292 | } |
4293 | } |
4294 | } |
4295 | |
4296 | #[doc (hidden)] |
4297 | impl FromGlib<ffi::GstTypeFindProbability> for TypeFindProbability { |
4298 | #[inline ] |
4299 | unsafe fn from_glib(value: ffi::GstTypeFindProbability) -> Self { |
4300 | skip_assert_initialized!(); |
4301 | |
4302 | match value { |
4303 | ffi::GST_TYPE_FIND_NONE => Self::None, |
4304 | ffi::GST_TYPE_FIND_MINIMUM => Self::Minimum, |
4305 | ffi::GST_TYPE_FIND_POSSIBLE => Self::Possible, |
4306 | ffi::GST_TYPE_FIND_LIKELY => Self::Likely, |
4307 | ffi::GST_TYPE_FIND_NEARLY_CERTAIN => Self::NearlyCertain, |
4308 | ffi::GST_TYPE_FIND_MAXIMUM => Self::Maximum, |
4309 | value: i32 => Self::__Unknown(value), |
4310 | } |
4311 | } |
4312 | } |
4313 | |
4314 | impl StaticType for TypeFindProbability { |
4315 | #[inline ] |
4316 | #[doc (alias = "gst_type_find_probability_get_type" )] |
4317 | fn static_type() -> glib::Type { |
4318 | unsafe { from_glib(val:ffi::gst_type_find_probability_get_type()) } |
4319 | } |
4320 | } |
4321 | |
4322 | impl glib::HasParamSpec for TypeFindProbability { |
4323 | type ParamSpec = glib::ParamSpecEnum; |
4324 | type SetValue = Self; |
4325 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
4326 | |
4327 | fn param_spec_builder() -> Self::BuilderFn { |
4328 | Self::ParamSpec::builder_with_default |
4329 | } |
4330 | } |
4331 | |
4332 | impl glib::value::ValueType for TypeFindProbability { |
4333 | type Type = Self; |
4334 | } |
4335 | |
4336 | unsafe impl<'a> glib::value::FromValue<'a> for TypeFindProbability { |
4337 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
4338 | |
4339 | #[inline ] |
4340 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
4341 | skip_assert_initialized!(); |
4342 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
4343 | } |
4344 | } |
4345 | |
4346 | impl ToValue for TypeFindProbability { |
4347 | #[inline ] |
4348 | fn to_value(&self) -> glib::Value { |
4349 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
4350 | unsafe { |
4351 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
4352 | } |
4353 | value |
4354 | } |
4355 | |
4356 | #[inline ] |
4357 | fn value_type(&self) -> glib::Type { |
4358 | Self::static_type() |
4359 | } |
4360 | } |
4361 | |
4362 | impl From<TypeFindProbability> for glib::Value { |
4363 | #[inline ] |
4364 | fn from(v: TypeFindProbability) -> Self { |
4365 | skip_assert_initialized!(); |
4366 | ToValue::to_value(&v) |
4367 | } |
4368 | } |
4369 | |
4370 | #[derive (Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] |
4371 | #[non_exhaustive ] |
4372 | #[doc (alias = "GstURIError" )] |
4373 | pub enum URIError { |
4374 | #[doc (alias = "GST_URI_ERROR_UNSUPPORTED_PROTOCOL" )] |
4375 | UnsupportedProtocol, |
4376 | #[doc (alias = "GST_URI_ERROR_BAD_URI" )] |
4377 | BadUri, |
4378 | #[doc (alias = "GST_URI_ERROR_BAD_STATE" )] |
4379 | BadState, |
4380 | #[doc (alias = "GST_URI_ERROR_BAD_REFERENCE" )] |
4381 | BadReference, |
4382 | #[doc (hidden)] |
4383 | __Unknown(i32), |
4384 | } |
4385 | |
4386 | #[doc (hidden)] |
4387 | impl IntoGlib for URIError { |
4388 | type GlibType = ffi::GstURIError; |
4389 | |
4390 | #[inline ] |
4391 | fn into_glib(self) -> ffi::GstURIError { |
4392 | match self { |
4393 | Self::UnsupportedProtocol => ffi::GST_URI_ERROR_UNSUPPORTED_PROTOCOL, |
4394 | Self::BadUri => ffi::GST_URI_ERROR_BAD_URI, |
4395 | Self::BadState => ffi::GST_URI_ERROR_BAD_STATE, |
4396 | Self::BadReference => ffi::GST_URI_ERROR_BAD_REFERENCE, |
4397 | Self::__Unknown(value: i32) => value, |
4398 | } |
4399 | } |
4400 | } |
4401 | |
4402 | #[doc (hidden)] |
4403 | impl FromGlib<ffi::GstURIError> for URIError { |
4404 | #[inline ] |
4405 | unsafe fn from_glib(value: ffi::GstURIError) -> Self { |
4406 | skip_assert_initialized!(); |
4407 | |
4408 | match value { |
4409 | ffi::GST_URI_ERROR_UNSUPPORTED_PROTOCOL => Self::UnsupportedProtocol, |
4410 | ffi::GST_URI_ERROR_BAD_URI => Self::BadUri, |
4411 | ffi::GST_URI_ERROR_BAD_STATE => Self::BadState, |
4412 | ffi::GST_URI_ERROR_BAD_REFERENCE => Self::BadReference, |
4413 | value: i32 => Self::__Unknown(value), |
4414 | } |
4415 | } |
4416 | } |
4417 | |
4418 | impl glib::error::ErrorDomain for URIError { |
4419 | #[inline ] |
4420 | fn domain() -> glib::Quark { |
4421 | skip_assert_initialized!(); |
4422 | |
4423 | unsafe { from_glib(val:ffi::gst_uri_error_quark()) } |
4424 | } |
4425 | |
4426 | #[inline ] |
4427 | fn code(self) -> i32 { |
4428 | self.into_glib() |
4429 | } |
4430 | |
4431 | #[inline ] |
4432 | #[allow (clippy::match_single_binding)] |
4433 | fn from(code: i32) -> Option<Self> { |
4434 | skip_assert_initialized!(); |
4435 | match unsafe { from_glib(val:code) } { |
4436 | value: URIError => Some(value), |
4437 | } |
4438 | } |
4439 | } |
4440 | |
4441 | impl StaticType for URIError { |
4442 | #[inline ] |
4443 | #[doc (alias = "gst_uri_error_get_type" )] |
4444 | fn static_type() -> glib::Type { |
4445 | unsafe { from_glib(val:ffi::gst_uri_error_get_type()) } |
4446 | } |
4447 | } |
4448 | |
4449 | impl glib::HasParamSpec for URIError { |
4450 | type ParamSpec = glib::ParamSpecEnum; |
4451 | type SetValue = Self; |
4452 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
4453 | |
4454 | fn param_spec_builder() -> Self::BuilderFn { |
4455 | Self::ParamSpec::builder_with_default |
4456 | } |
4457 | } |
4458 | |
4459 | impl glib::value::ValueType for URIError { |
4460 | type Type = Self; |
4461 | } |
4462 | |
4463 | unsafe impl<'a> glib::value::FromValue<'a> for URIError { |
4464 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
4465 | |
4466 | #[inline ] |
4467 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
4468 | skip_assert_initialized!(); |
4469 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
4470 | } |
4471 | } |
4472 | |
4473 | impl ToValue for URIError { |
4474 | #[inline ] |
4475 | fn to_value(&self) -> glib::Value { |
4476 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
4477 | unsafe { |
4478 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
4479 | } |
4480 | value |
4481 | } |
4482 | |
4483 | #[inline ] |
4484 | fn value_type(&self) -> glib::Type { |
4485 | Self::static_type() |
4486 | } |
4487 | } |
4488 | |
4489 | impl From<URIError> for glib::Value { |
4490 | #[inline ] |
4491 | fn from(v: URIError) -> Self { |
4492 | skip_assert_initialized!(); |
4493 | ToValue::to_value(&v) |
4494 | } |
4495 | } |
4496 | |
4497 | #[cfg_attr (feature = "serde" , derive(serde::Serialize, serde::Deserialize))] |
4498 | #[derive (Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)] |
4499 | #[repr (i32)] |
4500 | #[doc (alias = "GstURIType" )] |
4501 | pub enum URIType { |
4502 | #[doc (alias = "GST_URI_UNKNOWN" )] |
4503 | Unknown = ffi::GST_URI_UNKNOWN, |
4504 | #[doc (alias = "GST_URI_SINK" )] |
4505 | Sink = ffi::GST_URI_SINK, |
4506 | #[doc (alias = "GST_URI_SRC" )] |
4507 | Src = ffi::GST_URI_SRC, |
4508 | } |
4509 | |
4510 | #[doc (hidden)] |
4511 | impl IntoGlib for URIType { |
4512 | type GlibType = ffi::GstURIType; |
4513 | |
4514 | #[inline ] |
4515 | fn into_glib(self) -> ffi::GstURIType { |
4516 | self as ffi::GstURIType |
4517 | } |
4518 | } |
4519 | |
4520 | #[doc (hidden)] |
4521 | impl FromGlib<ffi::GstURIType> for URIType { |
4522 | #[inline ] |
4523 | unsafe fn from_glib(value: ffi::GstURIType) -> Self { |
4524 | skip_assert_initialized!(); |
4525 | |
4526 | debug_assert!([ffi::GST_URI_UNKNOWN, ffi::GST_URI_SINK, ffi::GST_URI_SRC].contains(&value)); |
4527 | std::mem::transmute(src:value) |
4528 | } |
4529 | } |
4530 | |
4531 | impl StaticType for URIType { |
4532 | #[inline ] |
4533 | #[doc (alias = "gst_uri_type_get_type" )] |
4534 | fn static_type() -> glib::Type { |
4535 | unsafe { from_glib(val:ffi::gst_uri_type_get_type()) } |
4536 | } |
4537 | } |
4538 | |
4539 | impl glib::HasParamSpec for URIType { |
4540 | type ParamSpec = glib::ParamSpecEnum; |
4541 | type SetValue = Self; |
4542 | type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>; |
4543 | |
4544 | fn param_spec_builder() -> Self::BuilderFn { |
4545 | Self::ParamSpec::builder_with_default |
4546 | } |
4547 | } |
4548 | |
4549 | impl glib::value::ValueType for URIType { |
4550 | type Type = Self; |
4551 | } |
4552 | |
4553 | unsafe impl<'a> glib::value::FromValue<'a> for URIType { |
4554 | type Checker = glib::value::GenericValueTypeChecker<Self>; |
4555 | |
4556 | #[inline ] |
4557 | unsafe fn from_value(value: &'a glib::Value) -> Self { |
4558 | skip_assert_initialized!(); |
4559 | from_glib(val:glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) |
4560 | } |
4561 | } |
4562 | |
4563 | impl ToValue for URIType { |
4564 | #[inline ] |
4565 | fn to_value(&self) -> glib::Value { |
4566 | let mut value: Value = glib::Value::for_value_type::<Self>(); |
4567 | unsafe { |
4568 | glib::gobject_ffi::g_value_set_enum(value:value.to_glib_none_mut().0, self.into_glib()); |
4569 | } |
4570 | value |
4571 | } |
4572 | |
4573 | #[inline ] |
4574 | fn value_type(&self) -> glib::Type { |
4575 | Self::static_type() |
4576 | } |
4577 | } |
4578 | |
4579 | impl From<URIType> for glib::Value { |
4580 | #[inline ] |
4581 | fn from(v: URIType) -> Self { |
4582 | skip_assert_initialized!(); |
4583 | ToValue::to_value(&v) |
4584 | } |
4585 | } |
4586 | |