1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use ffi;
use glib::StaticType;
use glib::Type;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
use glib::value::SetValue;
use glib::value::Value;
use gobject_ffi;

bitflags! {
    pub struct BufferCopyFlags: u32 {
        const NONE = 0;
        const FLAGS = 1;
        const TIMESTAMPS = 2;
        const META = 4;
        const MEMORY = 8;
        const MERGE = 16;
        const DEEP = 32;
    }
}

#[doc(hidden)]
impl ToGlib for BufferCopyFlags {
    type GlibType = ffi::GstBufferCopyFlags;

    fn to_glib(&self) -> ffi::GstBufferCopyFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstBufferCopyFlags> for BufferCopyFlags {
    fn from_glib(value: ffi::GstBufferCopyFlags) -> BufferCopyFlags {
        skip_assert_initialized!();
        BufferCopyFlags::from_bits_truncate(value)
    }
}

impl StaticType for BufferCopyFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gst_buffer_copy_flags_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for BufferCopyFlags {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for BufferCopyFlags {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for BufferCopyFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
    }
}

bitflags! {
    #[cfg_attr(feature = "ser_de", derive(Serialize, Deserialize))]
    pub struct BufferFlags: u32 {
        const LIVE = 16;
        const DECODE_ONLY = 32;
        const DISCONT = 64;
        const RESYNC = 128;
        const CORRUPTED = 256;
        const MARKER = 512;
        const HEADER = 1024;
        const GAP = 2048;
        const DROPPABLE = 4096;
        const DELTA_UNIT = 8192;
        const TAG_MEMORY = 16384;
        const SYNC_AFTER = 32768;
        const NON_DROPPABLE = 65536;
        const LAST = 1048576;
    }
}

#[doc(hidden)]
impl ToGlib for BufferFlags {
    type GlibType = ffi::GstBufferFlags;

    fn to_glib(&self) -> ffi::GstBufferFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstBufferFlags> for BufferFlags {
    fn from_glib(value: ffi::GstBufferFlags) -> BufferFlags {
        skip_assert_initialized!();
        BufferFlags::from_bits_truncate(value)
    }
}

impl StaticType for BufferFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gst_buffer_flags_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for BufferFlags {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for BufferFlags {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for BufferFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
    }
}

bitflags! {
    pub struct BufferPoolAcquireFlags: u32 {
        const NONE = 0;
        const KEY_UNIT = 1;
        const DONTWAIT = 2;
        const DISCONT = 4;
        const LAST = 65536;
    }
}

#[doc(hidden)]
impl ToGlib for BufferPoolAcquireFlags {
    type GlibType = ffi::GstBufferPoolAcquireFlags;

    fn to_glib(&self) -> ffi::GstBufferPoolAcquireFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstBufferPoolAcquireFlags> for BufferPoolAcquireFlags {
    fn from_glib(value: ffi::GstBufferPoolAcquireFlags) -> BufferPoolAcquireFlags {
        skip_assert_initialized!();
        BufferPoolAcquireFlags::from_bits_truncate(value)
    }
}

impl StaticType for BufferPoolAcquireFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gst_buffer_pool_acquire_flags_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for BufferPoolAcquireFlags {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for BufferPoolAcquireFlags {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for BufferPoolAcquireFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
    }
}

bitflags! {
    pub struct DebugColorFlags: u32 {
        const FG_BLACK = 0;
        const FG_RED = 1;
        const FG_GREEN = 2;
        const FG_YELLOW = 3;
        const FG_BLUE = 4;
        const FG_MAGENTA = 5;
        const FG_CYAN = 6;
        const FG_WHITE = 7;
        const BG_BLACK = 0;
        const BG_RED = 16;
        const BG_GREEN = 32;
        const BG_YELLOW = 48;
        const BG_BLUE = 64;
        const BG_MAGENTA = 80;
        const BG_CYAN = 96;
        const BG_WHITE = 112;
        const BOLD = 256;
        const UNDERLINE = 512;
    }
}

#[doc(hidden)]
impl ToGlib for DebugColorFlags {
    type GlibType = ffi::GstDebugColorFlags;

    fn to_glib(&self) -> ffi::GstDebugColorFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstDebugColorFlags> for DebugColorFlags {
    fn from_glib(value: ffi::GstDebugColorFlags) -> DebugColorFlags {
        skip_assert_initialized!();
        DebugColorFlags::from_bits_truncate(value)
    }
}

impl StaticType for DebugColorFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gst_debug_color_flags_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for DebugColorFlags {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for DebugColorFlags {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for DebugColorFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
    }
}

bitflags! {
    pub struct DebugGraphDetails: u32 {
        const MEDIA_TYPE = 1;
        const CAPS_DETAILS = 2;
        const NON_DEFAULT_PARAMS = 4;
        const STATES = 8;
        const FULL_PARAMS = 16;
        const ALL = 15;
        const VERBOSE = 4294967295;
    }
}

#[doc(hidden)]
impl ToGlib for DebugGraphDetails {
    type GlibType = ffi::GstDebugGraphDetails;

    fn to_glib(&self) -> ffi::GstDebugGraphDetails {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstDebugGraphDetails> for DebugGraphDetails {
    fn from_glib(value: ffi::GstDebugGraphDetails) -> DebugGraphDetails {
        skip_assert_initialized!();
        DebugGraphDetails::from_bits_truncate(value)
    }
}

impl StaticType for DebugGraphDetails {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gst_debug_graph_details_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for DebugGraphDetails {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for DebugGraphDetails {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for DebugGraphDetails {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
    }
}

bitflags! {
    pub struct ElementFlags: u32 {
        const LOCKED_STATE = 16;
        const SINK = 32;
        const SOURCE = 64;
        const PROVIDE_CLOCK = 128;
        const REQUIRE_CLOCK = 256;
        const INDEXABLE = 512;
        const LAST = 16384;
    }
}

#[doc(hidden)]
impl ToGlib for ElementFlags {
    type GlibType = ffi::GstElementFlags;

    fn to_glib(&self) -> ffi::GstElementFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstElementFlags> for ElementFlags {
    fn from_glib(value: ffi::GstElementFlags) -> ElementFlags {
        skip_assert_initialized!();
        ElementFlags::from_bits_truncate(value)
    }
}

impl StaticType for ElementFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gst_element_flags_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for ElementFlags {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for ElementFlags {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for ElementFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
    }
}

bitflags! {
    pub struct PadLinkCheck: u32 {
        const NOTHING = 0;
        const HIERARCHY = 1;
        const TEMPLATE_CAPS = 2;
        const CAPS = 4;
        const NO_RECONFIGURE = 8;
        const DEFAULT = 5;
    }
}

#[doc(hidden)]
impl ToGlib for PadLinkCheck {
    type GlibType = ffi::GstPadLinkCheck;

    fn to_glib(&self) -> ffi::GstPadLinkCheck {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstPadLinkCheck> for PadLinkCheck {
    fn from_glib(value: ffi::GstPadLinkCheck) -> PadLinkCheck {
        skip_assert_initialized!();
        PadLinkCheck::from_bits_truncate(value)
    }
}

impl StaticType for PadLinkCheck {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gst_pad_link_check_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for PadLinkCheck {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for PadLinkCheck {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for PadLinkCheck {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
    }
}

bitflags! {
    pub struct PadProbeType: u32 {
        const INVALID = 0;
        const IDLE = 1;
        const BLOCK = 2;
        const BUFFER = 16;
        const BUFFER_LIST = 32;
        const EVENT_DOWNSTREAM = 64;
        const EVENT_UPSTREAM = 128;
        const EVENT_FLUSH = 256;
        const QUERY_DOWNSTREAM = 512;
        const QUERY_UPSTREAM = 1024;
        const PUSH = 4096;
        const PULL = 8192;
        const BLOCKING = 3;
        const DATA_DOWNSTREAM = 112;
        const DATA_UPSTREAM = 128;
        const DATA_BOTH = 240;
        const BLOCK_DOWNSTREAM = 114;
        const BLOCK_UPSTREAM = 130;
        const EVENT_BOTH = 192;
        const QUERY_BOTH = 1536;
        const ALL_BOTH = 1776;
        const SCHEDULING = 12288;
    }
}

#[doc(hidden)]
impl ToGlib for PadProbeType {
    type GlibType = ffi::GstPadProbeType;

    fn to_glib(&self) -> ffi::GstPadProbeType {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstPadProbeType> for PadProbeType {
    fn from_glib(value: ffi::GstPadProbeType) -> PadProbeType {
        skip_assert_initialized!();
        PadProbeType::from_bits_truncate(value)
    }
}

impl StaticType for PadProbeType {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gst_pad_probe_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for PadProbeType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for PadProbeType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for PadProbeType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
    }
}

bitflags! {
    pub struct ParseFlags: u32 {
        const NONE = 0;
        const FATAL_ERRORS = 1;
        const NO_SINGLE_ELEMENT_BINS = 2;
        const PLACE_IN_BIN = 4;
    }
}

#[doc(hidden)]
impl ToGlib for ParseFlags {
    type GlibType = ffi::GstParseFlags;

    fn to_glib(&self) -> ffi::GstParseFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstParseFlags> for ParseFlags {
    fn from_glib(value: ffi::GstParseFlags) -> ParseFlags {
        skip_assert_initialized!();
        ParseFlags::from_bits_truncate(value)
    }
}

impl StaticType for ParseFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gst_parse_flags_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for ParseFlags {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for ParseFlags {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for ParseFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
    }
}

bitflags! {
    pub struct PluginDependencyFlags: u32 {
        const NONE = 0;
        const RECURSE = 1;
        const PATHS_ARE_DEFAULT_ONLY = 2;
        const FILE_NAME_IS_SUFFIX = 4;
        const FILE_NAME_IS_PREFIX = 8;
        const PATHS_ARE_RELATIVE_TO_EXE = 16;
    }
}

#[doc(hidden)]
impl ToGlib for PluginDependencyFlags {
    type GlibType = ffi::GstPluginDependencyFlags;

    fn to_glib(&self) -> ffi::GstPluginDependencyFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstPluginDependencyFlags> for PluginDependencyFlags {
    fn from_glib(value: ffi::GstPluginDependencyFlags) -> PluginDependencyFlags {
        skip_assert_initialized!();
        PluginDependencyFlags::from_bits_truncate(value)
    }
}

impl StaticType for PluginDependencyFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gst_plugin_dependency_flags_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for PluginDependencyFlags {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for PluginDependencyFlags {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for PluginDependencyFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
    }
}

bitflags! {
    pub struct SchedulingFlags: u32 {
        const SEEKABLE = 1;
        const SEQUENTIAL = 2;
        const BANDWIDTH_LIMITED = 4;
    }
}

#[doc(hidden)]
impl ToGlib for SchedulingFlags {
    type GlibType = ffi::GstSchedulingFlags;

    fn to_glib(&self) -> ffi::GstSchedulingFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstSchedulingFlags> for SchedulingFlags {
    fn from_glib(value: ffi::GstSchedulingFlags) -> SchedulingFlags {
        skip_assert_initialized!();
        SchedulingFlags::from_bits_truncate(value)
    }
}

impl StaticType for SchedulingFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gst_scheduling_flags_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for SchedulingFlags {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for SchedulingFlags {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for SchedulingFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
    }
}

bitflags! {
    pub struct SeekFlags: u32 {
        const NONE = 0;
        const FLUSH = 1;
        const ACCURATE = 2;
        const KEY_UNIT = 4;
        const SEGMENT = 8;
        const TRICKMODE = 16;
        const SKIP = 16;
        const SNAP_BEFORE = 32;
        const SNAP_AFTER = 64;
        const SNAP_NEAREST = 96;
        const TRICKMODE_KEY_UNITS = 128;
        const TRICKMODE_NO_AUDIO = 256;
    }
}

#[doc(hidden)]
impl ToGlib for SeekFlags {
    type GlibType = ffi::GstSeekFlags;

    fn to_glib(&self) -> ffi::GstSeekFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstSeekFlags> for SeekFlags {
    fn from_glib(value: ffi::GstSeekFlags) -> SeekFlags {
        skip_assert_initialized!();
        SeekFlags::from_bits_truncate(value)
    }
}

impl StaticType for SeekFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gst_seek_flags_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for SeekFlags {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for SeekFlags {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for SeekFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
    }
}

bitflags! {
    #[cfg_attr(feature = "ser_de", derive(Serialize, Deserialize))]
    pub struct SegmentFlags: u32 {
        const NONE = 0;
        const RESET = 1;
        const TRICKMODE = 16;
        const SKIP = 16;
        const SEGMENT = 8;
        const TRICKMODE_KEY_UNITS = 128;
        const TRICKMODE_NO_AUDIO = 256;
    }
}

#[doc(hidden)]
impl ToGlib for SegmentFlags {
    type GlibType = ffi::GstSegmentFlags;

    fn to_glib(&self) -> ffi::GstSegmentFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstSegmentFlags> for SegmentFlags {
    fn from_glib(value: ffi::GstSegmentFlags) -> SegmentFlags {
        skip_assert_initialized!();
        SegmentFlags::from_bits_truncate(value)
    }
}

impl StaticType for SegmentFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gst_segment_flags_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for SegmentFlags {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for SegmentFlags {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for SegmentFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[cfg(any(feature = "v1_12", feature = "dox"))]
bitflags! {
    pub struct StackTraceFlags: u32 {
        const FULL = 1;
    }
}

#[cfg(any(feature = "v1_12", feature = "dox"))]
#[doc(hidden)]
impl ToGlib for StackTraceFlags {
    type GlibType = ffi::GstStackTraceFlags;

    fn to_glib(&self) -> ffi::GstStackTraceFlags {
        self.bits()
    }
}

#[cfg(any(feature = "v1_12", feature = "dox"))]
#[doc(hidden)]
impl FromGlib<ffi::GstStackTraceFlags> for StackTraceFlags {
    fn from_glib(value: ffi::GstStackTraceFlags) -> StackTraceFlags {
        skip_assert_initialized!();
        StackTraceFlags::from_bits_truncate(value)
    }
}

#[cfg(any(feature = "v1_12", feature = "dox"))]
impl StaticType for StackTraceFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gst_stack_trace_flags_get_type()) }
    }
}

#[cfg(any(feature = "v1_12", feature = "dox"))]
impl<'a> FromValueOptional<'a> for StackTraceFlags {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

#[cfg(any(feature = "v1_12", feature = "dox"))]
impl<'a> FromValue<'a> for StackTraceFlags {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(any(feature = "v1_12", feature = "dox"))]
impl SetValue for StackTraceFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
    }
}

bitflags! {
    pub struct StreamFlags: u32 {
        const NONE = 0;
        const SPARSE = 1;
        const SELECT = 2;
        const UNSELECT = 4;
    }
}

#[doc(hidden)]
impl ToGlib for StreamFlags {
    type GlibType = ffi::GstStreamFlags;

    fn to_glib(&self) -> ffi::GstStreamFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstStreamFlags> for StreamFlags {
    fn from_glib(value: ffi::GstStreamFlags) -> StreamFlags {
        skip_assert_initialized!();
        StreamFlags::from_bits_truncate(value)
    }
}

impl StaticType for StreamFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gst_stream_flags_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for StreamFlags {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for StreamFlags {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for StreamFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[cfg(any(feature = "v1_10", feature = "dox"))]
bitflags! {
    pub struct StreamType: u32 {
        const UNKNOWN = 1;
        const AUDIO = 2;
        const VIDEO = 4;
        const CONTAINER = 8;
        const TEXT = 16;
    }
}

#[cfg(any(feature = "v1_10", feature = "dox"))]
#[doc(hidden)]
impl ToGlib for StreamType {
    type GlibType = ffi::GstStreamType;

    fn to_glib(&self) -> ffi::GstStreamType {
        self.bits()
    }
}

#[cfg(any(feature = "v1_10", feature = "dox"))]
#[doc(hidden)]
impl FromGlib<ffi::GstStreamType> for StreamType {
    fn from_glib(value: ffi::GstStreamType) -> StreamType {
        skip_assert_initialized!();
        StreamType::from_bits_truncate(value)
    }
}

#[cfg(any(feature = "v1_10", feature = "dox"))]
impl StaticType for StreamType {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gst_stream_type_get_type()) }
    }
}

#[cfg(any(feature = "v1_10", feature = "dox"))]
impl<'a> FromValueOptional<'a> for StreamType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

#[cfg(any(feature = "v1_10", feature = "dox"))]
impl<'a> FromValue<'a> for StreamType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(any(feature = "v1_10", feature = "dox"))]
impl SetValue for StreamType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
    }
}