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
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT

use glib::{bitflags::bitflags, prelude::*, translate::*};

#[cfg(feature = "v1_22")]
bitflags! {
    /// Flags to indicate the state of modifier keys and mouse buttons
    /// in events.
    ///
    /// Typical modifier keys are Shift, Control, Meta, Super, Hyper, Alt, Compose,
    /// Apple, CapsLock or ShiftLock.
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "GstNavigationModifierType")]
    pub struct NavigationModifierType: u32 {
        /// the Shift key.
        #[doc(alias = "GST_NAVIGATION_MODIFIER_SHIFT_MASK")]
        const SHIFT_MASK = ffi::GST_NAVIGATION_MODIFIER_SHIFT_MASK as _;
        #[doc(alias = "GST_NAVIGATION_MODIFIER_LOCK_MASK")]
        const LOCK_MASK = ffi::GST_NAVIGATION_MODIFIER_LOCK_MASK as _;
        /// the Control key.
        #[doc(alias = "GST_NAVIGATION_MODIFIER_CONTROL_MASK")]
        const CONTROL_MASK = ffi::GST_NAVIGATION_MODIFIER_CONTROL_MASK as _;
        /// the third modifier key
        #[doc(alias = "GST_NAVIGATION_MODIFIER_MOD1_MASK")]
        const MOD1_MASK = ffi::GST_NAVIGATION_MODIFIER_MOD1_MASK as _;
        /// the fourth modifier key
        #[doc(alias = "GST_NAVIGATION_MODIFIER_MOD2_MASK")]
        const MOD2_MASK = ffi::GST_NAVIGATION_MODIFIER_MOD2_MASK as _;
        /// the fifth modifier key
        #[doc(alias = "GST_NAVIGATION_MODIFIER_MOD3_MASK")]
        const MOD3_MASK = ffi::GST_NAVIGATION_MODIFIER_MOD3_MASK as _;
        /// the sixth modifier key
        #[doc(alias = "GST_NAVIGATION_MODIFIER_MOD4_MASK")]
        const MOD4_MASK = ffi::GST_NAVIGATION_MODIFIER_MOD4_MASK as _;
        /// the seventh modifier key
        #[doc(alias = "GST_NAVIGATION_MODIFIER_MOD5_MASK")]
        const MOD5_MASK = ffi::GST_NAVIGATION_MODIFIER_MOD5_MASK as _;
        /// the first mouse button (usually the left button).
        #[doc(alias = "GST_NAVIGATION_MODIFIER_BUTTON1_MASK")]
        const BUTTON1_MASK = ffi::GST_NAVIGATION_MODIFIER_BUTTON1_MASK as _;
        /// the second mouse button (usually the right button).
        #[doc(alias = "GST_NAVIGATION_MODIFIER_BUTTON2_MASK")]
        const BUTTON2_MASK = ffi::GST_NAVIGATION_MODIFIER_BUTTON2_MASK as _;
        /// the third mouse button (usually the mouse wheel button or middle button).
        #[doc(alias = "GST_NAVIGATION_MODIFIER_BUTTON3_MASK")]
        const BUTTON3_MASK = ffi::GST_NAVIGATION_MODIFIER_BUTTON3_MASK as _;
        /// the fourth mouse button (typically the "Back" button).
        #[doc(alias = "GST_NAVIGATION_MODIFIER_BUTTON4_MASK")]
        const BUTTON4_MASK = ffi::GST_NAVIGATION_MODIFIER_BUTTON4_MASK as _;
        /// the fifth mouse button (typically the "forward" button).
        #[doc(alias = "GST_NAVIGATION_MODIFIER_BUTTON5_MASK")]
        const BUTTON5_MASK = ffi::GST_NAVIGATION_MODIFIER_BUTTON5_MASK as _;
        /// the Super modifier
        #[doc(alias = "GST_NAVIGATION_MODIFIER_SUPER_MASK")]
        const SUPER_MASK = ffi::GST_NAVIGATION_MODIFIER_SUPER_MASK as _;
        /// the Hyper modifier
        #[doc(alias = "GST_NAVIGATION_MODIFIER_HYPER_MASK")]
        const HYPER_MASK = ffi::GST_NAVIGATION_MODIFIER_HYPER_MASK as _;
        /// the Meta modifier
        #[doc(alias = "GST_NAVIGATION_MODIFIER_META_MASK")]
        const META_MASK = ffi::GST_NAVIGATION_MODIFIER_META_MASK as _;
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
#[doc(hidden)]
impl IntoGlib for NavigationModifierType {
    type GlibType = ffi::GstNavigationModifierType;

    #[inline]
    fn into_glib(self) -> ffi::GstNavigationModifierType {
        self.bits()
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
#[doc(hidden)]
impl FromGlib<ffi::GstNavigationModifierType> for NavigationModifierType {
    #[inline]
    unsafe fn from_glib(value: ffi::GstNavigationModifierType) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl StaticType for NavigationModifierType {
    #[inline]
    #[doc(alias = "gst_navigation_modifier_type_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gst_navigation_modifier_type_get_type()) }
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl glib::HasParamSpec for NavigationModifierType {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl glib::value::ValueType for NavigationModifierType {
    type Type = Self;
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
unsafe impl<'a> glib::value::FromValue<'a> for NavigationModifierType {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl ToValue for NavigationModifierType {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl From<NavigationModifierType> for glib::Value {
    #[inline]
    fn from(v: NavigationModifierType) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

bitflags! {
    /// Additional video buffer flags. These flags can potentially be used on any
    /// buffers carrying closed caption data, or video data - even encoded data.
    ///
    /// Note that these are only valid for [`gst::Caps`][crate::gst::Caps] of type: video/... and caption/...
    /// They can conflict with other extended buffer flags.
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "GstVideoBufferFlags")]
    pub struct VideoBufferFlags: u32 {
        /// If the [`gst::Buffer`][crate::gst::Buffer] is interlaced. In mixed
        ///  interlace-mode, this flags specifies if the frame is
        ///  interlaced or progressive.
        #[doc(alias = "GST_VIDEO_BUFFER_FLAG_INTERLACED")]
        const INTERLACED = ffi::GST_VIDEO_BUFFER_FLAG_INTERLACED as _;
        /// If the [`gst::Buffer`][crate::gst::Buffer] is interlaced, then the first field
        ///  in the video frame is the top field. If unset, the
        ///  bottom field is first.
        #[doc(alias = "GST_VIDEO_BUFFER_FLAG_TFF")]
        const TFF = ffi::GST_VIDEO_BUFFER_FLAG_TFF as _;
        /// If the [`gst::Buffer`][crate::gst::Buffer] is interlaced, then the first field
        ///  (as defined by the [`TFF`][Self::TFF] flag setting)
        ///  is repeated.
        #[doc(alias = "GST_VIDEO_BUFFER_FLAG_RFF")]
        const RFF = ffi::GST_VIDEO_BUFFER_FLAG_RFF as _;
        /// If the [`gst::Buffer`][crate::gst::Buffer] is interlaced, then only the
        ///  first field (as defined by the [`TFF`][Self::TFF]
        ///  flag setting) is to be displayed (Since: 1.16).
        #[doc(alias = "GST_VIDEO_BUFFER_FLAG_ONEFIELD")]
        const ONEFIELD = ffi::GST_VIDEO_BUFFER_FLAG_ONEFIELD as _;
        /// The [`gst::Buffer`][crate::gst::Buffer] contains one or more specific views,
        ///  such as left or right eye view. This flags is set on
        ///  any buffer that contains non-mono content - even for
        ///  streams that contain only a single viewpoint. In mixed
        ///  mono / non-mono streams, the absence of the flag marks
        ///  mono buffers.
        #[doc(alias = "GST_VIDEO_BUFFER_FLAG_MULTIPLE_VIEW")]
        const MULTIPLE_VIEW = ffi::GST_VIDEO_BUFFER_FLAG_MULTIPLE_VIEW as _;
        /// When conveying stereo/multiview content with
        ///  frame-by-frame methods, this flag marks the first buffer
        ///  in a bundle of frames that belong together.
        #[doc(alias = "GST_VIDEO_BUFFER_FLAG_FIRST_IN_BUNDLE")]
        const FIRST_IN_BUNDLE = ffi::GST_VIDEO_BUFFER_FLAG_FIRST_IN_BUNDLE as _;
        /// The video frame has the top field only. This is the
        ///  same as GST_VIDEO_BUFFER_FLAG_TFF |
        ///  GST_VIDEO_BUFFER_FLAG_ONEFIELD (Since: 1.16).
        ///  Use GST_VIDEO_BUFFER_IS_TOP_FIELD() to check for this flag.
        #[cfg(feature = "v1_16")]
        #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
        #[doc(alias = "GST_VIDEO_BUFFER_FLAG_TOP_FIELD")]
        const TOP_FIELD = ffi::GST_VIDEO_BUFFER_FLAG_TOP_FIELD as _;
        /// The video frame has the bottom field only. This is
        ///  the same as GST_VIDEO_BUFFER_FLAG_ONEFIELD
        ///  (GST_VIDEO_BUFFER_FLAG_TFF flag unset) (Since: 1.16).
        ///  Use GST_VIDEO_BUFFER_IS_BOTTOM_FIELD() to check for this flag.
        #[cfg(feature = "v1_16")]
        #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
        #[doc(alias = "GST_VIDEO_BUFFER_FLAG_BOTTOM_FIELD")]
        const BOTTOM_FIELD = ffi::GST_VIDEO_BUFFER_FLAG_BOTTOM_FIELD as _;
        /// The [`gst::Buffer`][crate::gst::Buffer] contains the end of a video field or frame
        ///  boundary such as the last subframe or packet (Since: 1.18).
        #[cfg(feature = "v1_18")]
        #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
        #[doc(alias = "GST_VIDEO_BUFFER_FLAG_MARKER")]
        const MARKER = ffi::GST_VIDEO_BUFFER_FLAG_MARKER as _;
    }
}

#[doc(hidden)]
impl IntoGlib for VideoBufferFlags {
    type GlibType = ffi::GstVideoBufferFlags;

    #[inline]
    fn into_glib(self) -> ffi::GstVideoBufferFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstVideoBufferFlags> for VideoBufferFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::GstVideoBufferFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for VideoBufferFlags {
    #[inline]
    #[doc(alias = "gst_video_buffer_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gst_video_buffer_flags_get_type()) }
    }
}

impl glib::HasParamSpec for VideoBufferFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

impl glib::value::ValueType for VideoBufferFlags {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for VideoBufferFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for VideoBufferFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<VideoBufferFlags> for glib::Value {
    #[inline]
    fn from(v: VideoBufferFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

bitflags! {
    /// Various Chroma sitings.
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "GstVideoChromaSite")]
    pub struct VideoChromaSite: u32 {
        /// no cositing
        #[doc(alias = "GST_VIDEO_CHROMA_SITE_NONE")]
        const NONE = ffi::GST_VIDEO_CHROMA_SITE_NONE as _;
        /// chroma is horizontally cosited
        #[doc(alias = "GST_VIDEO_CHROMA_SITE_H_COSITED")]
        const H_COSITED = ffi::GST_VIDEO_CHROMA_SITE_H_COSITED as _;
        /// chroma is vertically cosited
        #[doc(alias = "GST_VIDEO_CHROMA_SITE_V_COSITED")]
        const V_COSITED = ffi::GST_VIDEO_CHROMA_SITE_V_COSITED as _;
        /// choma samples are sited on alternate lines
        #[doc(alias = "GST_VIDEO_CHROMA_SITE_ALT_LINE")]
        const ALT_LINE = ffi::GST_VIDEO_CHROMA_SITE_ALT_LINE as _;
        /// chroma samples cosited with luma samples
        #[doc(alias = "GST_VIDEO_CHROMA_SITE_COSITED")]
        const COSITED = ffi::GST_VIDEO_CHROMA_SITE_COSITED as _;
        /// jpeg style cositing, also for mpeg1 and mjpeg
        #[doc(alias = "GST_VIDEO_CHROMA_SITE_JPEG")]
        const JPEG = ffi::GST_VIDEO_CHROMA_SITE_JPEG as _;
        /// mpeg2 style cositing
        #[doc(alias = "GST_VIDEO_CHROMA_SITE_MPEG2")]
        const MPEG2 = ffi::GST_VIDEO_CHROMA_SITE_MPEG2 as _;
        /// DV style cositing
        #[doc(alias = "GST_VIDEO_CHROMA_SITE_DV")]
        const DV = ffi::GST_VIDEO_CHROMA_SITE_DV as _;
    }
}

impl VideoChromaSite {
    #[cfg(feature = "v1_20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
    #[doc(alias = "gst_video_chroma_site_from_string")]
    pub fn from_string(s: &str) -> VideoChromaSite {
        assert_initialized_main_thread!();
        unsafe { from_glib(ffi::gst_video_chroma_site_from_string(s.to_glib_none().0)) }
    }
}

impl std::fmt::Display for VideoChromaSite {
    #[inline]
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        f.write_str(&self.to_str())
    }
}

#[doc(hidden)]
impl IntoGlib for VideoChromaSite {
    type GlibType = ffi::GstVideoChromaSite;

    #[inline]
    fn into_glib(self) -> ffi::GstVideoChromaSite {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstVideoChromaSite> for VideoChromaSite {
    #[inline]
    unsafe fn from_glib(value: ffi::GstVideoChromaSite) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for VideoChromaSite {
    #[inline]
    #[doc(alias = "gst_video_chroma_site_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gst_video_chroma_site_get_type()) }
    }
}

impl glib::HasParamSpec for VideoChromaSite {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

impl glib::value::ValueType for VideoChromaSite {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for VideoChromaSite {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for VideoChromaSite {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<VideoChromaSite> for glib::Value {
    #[inline]
    fn from(v: VideoChromaSite) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

bitflags! {
    /// Flags for [`VideoCodecFrame`][crate::VideoCodecFrame]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "GstVideoCodecFrameFlags")]
    pub struct VideoCodecFrameFlags: u32 {
        /// is the frame only meant to be decoded
        #[doc(alias = "GST_VIDEO_CODEC_FRAME_FLAG_DECODE_ONLY")]
        const DECODE_ONLY = ffi::GST_VIDEO_CODEC_FRAME_FLAG_DECODE_ONLY as _;
        /// is the frame a synchronization point (keyframe)
        #[doc(alias = "GST_VIDEO_CODEC_FRAME_FLAG_SYNC_POINT")]
        const SYNC_POINT = ffi::GST_VIDEO_CODEC_FRAME_FLAG_SYNC_POINT as _;
        /// should the output frame be made a keyframe
        #[doc(alias = "GST_VIDEO_CODEC_FRAME_FLAG_FORCE_KEYFRAME")]
        const FORCE_KEYFRAME = ffi::GST_VIDEO_CODEC_FRAME_FLAG_FORCE_KEYFRAME as _;
        /// should the encoder output stream headers
        #[doc(alias = "GST_VIDEO_CODEC_FRAME_FLAG_FORCE_KEYFRAME_HEADERS")]
        const FORCE_KEYFRAME_HEADERS = ffi::GST_VIDEO_CODEC_FRAME_FLAG_FORCE_KEYFRAME_HEADERS as _;
        /// The buffer data is corrupted.
        #[cfg(feature = "v1_20")]
        #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
        #[doc(alias = "GST_VIDEO_CODEC_FRAME_FLAG_CORRUPTED")]
        const CORRUPTED = ffi::GST_VIDEO_CODEC_FRAME_FLAG_CORRUPTED as _;
    }
}

#[doc(hidden)]
impl IntoGlib for VideoCodecFrameFlags {
    type GlibType = ffi::GstVideoCodecFrameFlags;

    #[inline]
    fn into_glib(self) -> ffi::GstVideoCodecFrameFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstVideoCodecFrameFlags> for VideoCodecFrameFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::GstVideoCodecFrameFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
impl StaticType for VideoCodecFrameFlags {
    #[inline]
    #[doc(alias = "gst_video_codec_frame_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gst_video_codec_frame_flags_get_type()) }
    }
}

#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
impl glib::HasParamSpec for VideoCodecFrameFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
impl glib::value::ValueType for VideoCodecFrameFlags {
    type Type = Self;
}

#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
unsafe impl<'a> glib::value::FromValue<'a> for VideoCodecFrameFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
impl ToValue for VideoCodecFrameFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
impl From<VideoCodecFrameFlags> for glib::Value {
    #[inline]
    fn from(v: VideoCodecFrameFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[cfg(feature = "v1_20")]
bitflags! {
    /// Flags to be used in combination with [`VideoDecoderExt::request_sync_point()`][crate::prelude::VideoDecoderExt::request_sync_point()].
    /// See the function documentation for more details.
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "GstVideoDecoderRequestSyncPointFlags")]
    pub struct VideoDecoderRequestSyncPointFlags: u32 {
        /// discard all following
        ///  input until the next sync point.
        #[doc(alias = "GST_VIDEO_DECODER_REQUEST_SYNC_POINT_DISCARD_INPUT")]
        const DISCARD_INPUT = ffi::GST_VIDEO_DECODER_REQUEST_SYNC_POINT_DISCARD_INPUT as _;
        /// discard all following
        ///  output until the next sync point.
        #[doc(alias = "GST_VIDEO_DECODER_REQUEST_SYNC_POINT_CORRUPT_OUTPUT")]
        const CORRUPT_OUTPUT = ffi::GST_VIDEO_DECODER_REQUEST_SYNC_POINT_CORRUPT_OUTPUT as _;
    }
}

#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
#[doc(hidden)]
impl IntoGlib for VideoDecoderRequestSyncPointFlags {
    type GlibType = ffi::GstVideoDecoderRequestSyncPointFlags;

    #[inline]
    fn into_glib(self) -> ffi::GstVideoDecoderRequestSyncPointFlags {
        self.bits()
    }
}

#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
#[doc(hidden)]
impl FromGlib<ffi::GstVideoDecoderRequestSyncPointFlags> for VideoDecoderRequestSyncPointFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::GstVideoDecoderRequestSyncPointFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
impl StaticType for VideoDecoderRequestSyncPointFlags {
    #[inline]
    #[doc(alias = "gst_video_decoder_request_sync_point_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gst_video_decoder_request_sync_point_flags_get_type()) }
    }
}

#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
impl glib::HasParamSpec for VideoDecoderRequestSyncPointFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
impl glib::value::ValueType for VideoDecoderRequestSyncPointFlags {
    type Type = Self;
}

#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
unsafe impl<'a> glib::value::FromValue<'a> for VideoDecoderRequestSyncPointFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
impl ToValue for VideoDecoderRequestSyncPointFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
impl From<VideoDecoderRequestSyncPointFlags> for glib::Value {
    #[inline]
    fn from(v: VideoDecoderRequestSyncPointFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

bitflags! {
    /// Extra video flags
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "GstVideoFlags")]
    pub struct VideoFlags: u32 {
        /// a variable fps is selected, fps_n and fps_d
        ///  denote the maximum fps of the video
        #[doc(alias = "GST_VIDEO_FLAG_VARIABLE_FPS")]
        const VARIABLE_FPS = ffi::GST_VIDEO_FLAG_VARIABLE_FPS as _;
        /// Each color has been scaled by the alpha
        ///  value.
        #[doc(alias = "GST_VIDEO_FLAG_PREMULTIPLIED_ALPHA")]
        const PREMULTIPLIED_ALPHA = ffi::GST_VIDEO_FLAG_PREMULTIPLIED_ALPHA as _;
    }
}

#[doc(hidden)]
impl IntoGlib for VideoFlags {
    type GlibType = ffi::GstVideoFlags;

    #[inline]
    fn into_glib(self) -> ffi::GstVideoFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstVideoFlags> for VideoFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::GstVideoFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for VideoFlags {
    #[inline]
    #[doc(alias = "gst_video_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gst_video_flags_get_type()) }
    }
}

impl glib::HasParamSpec for VideoFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

impl glib::value::ValueType for VideoFlags {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for VideoFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for VideoFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<VideoFlags> for glib::Value {
    #[inline]
    fn from(v: VideoFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

bitflags! {
    /// The different video flags that a format info can have.
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "GstVideoFormatFlags")]
    pub struct VideoFormatFlags: u32 {
        /// The video format is YUV, components are numbered
        ///  0=Y, 1=U, 2=V.
        #[doc(alias = "GST_VIDEO_FORMAT_FLAG_YUV")]
        const YUV = ffi::GST_VIDEO_FORMAT_FLAG_YUV as _;
        /// The video format is RGB, components are numbered
        ///  0=R, 1=G, 2=B.
        #[doc(alias = "GST_VIDEO_FORMAT_FLAG_RGB")]
        const RGB = ffi::GST_VIDEO_FORMAT_FLAG_RGB as _;
        /// The video is gray, there is one gray component
        ///  with index 0.
        #[doc(alias = "GST_VIDEO_FORMAT_FLAG_GRAY")]
        const GRAY = ffi::GST_VIDEO_FORMAT_FLAG_GRAY as _;
        /// The video format has an alpha components with
        ///  the number 3.
        #[doc(alias = "GST_VIDEO_FORMAT_FLAG_ALPHA")]
        const ALPHA = ffi::GST_VIDEO_FORMAT_FLAG_ALPHA as _;
        /// The video format has data stored in little
        ///  endianness.
        #[doc(alias = "GST_VIDEO_FORMAT_FLAG_LE")]
        const LE = ffi::GST_VIDEO_FORMAT_FLAG_LE as _;
        /// The video format has a palette. The palette
        ///  is stored in the second plane and indexes are stored in the first plane.
        #[doc(alias = "GST_VIDEO_FORMAT_FLAG_PALETTE")]
        const PALETTE = ffi::GST_VIDEO_FORMAT_FLAG_PALETTE as _;
        /// The video format has a complex layout that
        ///  can't be described with the usual information in the [`VideoFormatInfo`][crate::VideoFormatInfo].
        #[doc(alias = "GST_VIDEO_FORMAT_FLAG_COMPLEX")]
        const COMPLEX = ffi::GST_VIDEO_FORMAT_FLAG_COMPLEX as _;
        /// This format can be used in a
        ///  `GstVideoFormatUnpack` and `GstVideoFormatPack` function.
        #[doc(alias = "GST_VIDEO_FORMAT_FLAG_UNPACK")]
        const UNPACK = ffi::GST_VIDEO_FORMAT_FLAG_UNPACK as _;
        /// The format is tiled, there is tiling information
        ///  in the last plane.
        #[doc(alias = "GST_VIDEO_FORMAT_FLAG_TILED")]
        const TILED = ffi::GST_VIDEO_FORMAT_FLAG_TILED as _;
        /// The tile size varies per plane according to the subsampling.
        #[cfg(feature = "v1_22")]
        #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
        #[doc(alias = "GST_VIDEO_FORMAT_FLAG_SUBTILES")]
        const SUBTILES = ffi::GST_VIDEO_FORMAT_FLAG_SUBTILES as _;
    }
}

#[doc(hidden)]
impl IntoGlib for VideoFormatFlags {
    type GlibType = ffi::GstVideoFormatFlags;

    #[inline]
    fn into_glib(self) -> ffi::GstVideoFormatFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstVideoFormatFlags> for VideoFormatFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::GstVideoFormatFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for VideoFormatFlags {
    #[inline]
    #[doc(alias = "gst_video_format_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gst_video_format_flags_get_type()) }
    }
}

impl glib::HasParamSpec for VideoFormatFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

impl glib::value::ValueType for VideoFormatFlags {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for VideoFormatFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for VideoFormatFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<VideoFormatFlags> for glib::Value {
    #[inline]
    fn from(v: VideoFormatFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

bitflags! {
    /// Extra video frame flags
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "GstVideoFrameFlags")]
    pub struct VideoFrameFlags: u32 {
        /// The video frame is interlaced. In mixed
        ///  interlace-mode, this flag specifies if the frame is interlaced or
        ///  progressive.
        #[doc(alias = "GST_VIDEO_FRAME_FLAG_INTERLACED")]
        const INTERLACED = ffi::GST_VIDEO_FRAME_FLAG_INTERLACED as _;
        /// The video frame has the top field first
        #[doc(alias = "GST_VIDEO_FRAME_FLAG_TFF")]
        const TFF = ffi::GST_VIDEO_FRAME_FLAG_TFF as _;
        /// The video frame has the repeat flag
        #[doc(alias = "GST_VIDEO_FRAME_FLAG_RFF")]
        const RFF = ffi::GST_VIDEO_FRAME_FLAG_RFF as _;
        /// The video frame has one field
        #[doc(alias = "GST_VIDEO_FRAME_FLAG_ONEFIELD")]
        const ONEFIELD = ffi::GST_VIDEO_FRAME_FLAG_ONEFIELD as _;
        /// The video contains one or
        ///  more non-mono views
        #[doc(alias = "GST_VIDEO_FRAME_FLAG_MULTIPLE_VIEW")]
        const MULTIPLE_VIEW = ffi::GST_VIDEO_FRAME_FLAG_MULTIPLE_VIEW as _;
        /// The video frame is the first
        ///  in a set of corresponding views provided as sequential frames.
        #[doc(alias = "GST_VIDEO_FRAME_FLAG_FIRST_IN_BUNDLE")]
        const FIRST_IN_BUNDLE = ffi::GST_VIDEO_FRAME_FLAG_FIRST_IN_BUNDLE as _;
        /// The video frame has the top field only. This
        ///  is the same as GST_VIDEO_FRAME_FLAG_TFF | GST_VIDEO_FRAME_FLAG_ONEFIELD
        ///  (Since: 1.16).
        #[cfg(feature = "v1_16")]
        #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
        #[doc(alias = "GST_VIDEO_FRAME_FLAG_TOP_FIELD")]
        const TOP_FIELD = ffi::GST_VIDEO_FRAME_FLAG_TOP_FIELD as _;
        /// The video frame has the bottom field
        ///  only. This is the same as GST_VIDEO_FRAME_FLAG_ONEFIELD
        ///  (GST_VIDEO_FRAME_FLAG_TFF flag unset) (Since: 1.16).
        #[cfg(feature = "v1_16")]
        #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
        #[doc(alias = "GST_VIDEO_FRAME_FLAG_BOTTOM_FIELD")]
        const BOTTOM_FIELD = ffi::GST_VIDEO_FRAME_FLAG_BOTTOM_FIELD as _;
    }
}

#[doc(hidden)]
impl IntoGlib for VideoFrameFlags {
    type GlibType = ffi::GstVideoFrameFlags;

    #[inline]
    fn into_glib(self) -> ffi::GstVideoFrameFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstVideoFrameFlags> for VideoFrameFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::GstVideoFrameFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for VideoFrameFlags {
    #[inline]
    #[doc(alias = "gst_video_frame_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gst_video_frame_flags_get_type()) }
    }
}

impl glib::HasParamSpec for VideoFrameFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

impl glib::value::ValueType for VideoFrameFlags {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for VideoFrameFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for VideoFrameFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<VideoFrameFlags> for glib::Value {
    #[inline]
    fn from(v: VideoFrameFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

bitflags! {
    /// GstVideoMultiviewFlags are used to indicate extra properties of a
    /// stereo/multiview stream beyond the frame layout and buffer mapping
    /// that is conveyed in the [`VideoMultiviewMode`][crate::VideoMultiviewMode].
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "GstVideoMultiviewFlags")]
    pub struct VideoMultiviewFlags: u32 {
        /// For stereo streams, the
        ///  normal arrangement of left and right views is reversed.
        #[doc(alias = "GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_VIEW_FIRST")]
        const RIGHT_VIEW_FIRST = ffi::GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_VIEW_FIRST as _;
        /// The left view is vertically
        ///  mirrored.
        #[doc(alias = "GST_VIDEO_MULTIVIEW_FLAGS_LEFT_FLIPPED")]
        const LEFT_FLIPPED = ffi::GST_VIDEO_MULTIVIEW_FLAGS_LEFT_FLIPPED as _;
        /// The left view is horizontally
        ///  mirrored.
        #[doc(alias = "GST_VIDEO_MULTIVIEW_FLAGS_LEFT_FLOPPED")]
        const LEFT_FLOPPED = ffi::GST_VIDEO_MULTIVIEW_FLAGS_LEFT_FLOPPED as _;
        /// The right view is
        ///  vertically mirrored.
        #[doc(alias = "GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_FLIPPED")]
        const RIGHT_FLIPPED = ffi::GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_FLIPPED as _;
        /// The right view is
        ///  horizontally mirrored.
        #[doc(alias = "GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_FLOPPED")]
        const RIGHT_FLOPPED = ffi::GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_FLOPPED as _;
        /// For frame-packed
        ///  multiview modes, indicates that the individual
        ///  views have been encoded with half the true width or height
        ///  and should be scaled back up for display. This flag
        ///  is used for overriding input layout interpretation
        ///  by adjusting pixel-aspect-ratio.
        ///  For side-by-side, column interleaved or checkerboard packings, the
        ///  pixel width will be doubled. For row interleaved and top-bottom
        ///  encodings, pixel height will be doubled.
        #[doc(alias = "GST_VIDEO_MULTIVIEW_FLAGS_HALF_ASPECT")]
        const HALF_ASPECT = ffi::GST_VIDEO_MULTIVIEW_FLAGS_HALF_ASPECT as _;
        /// The video stream contains both
        ///  mono and multiview portions, signalled on each buffer by the
        ///  absence or presence of the [`VideoBufferFlags::MULTIPLE_VIEW`][crate::VideoBufferFlags::MULTIPLE_VIEW]
        ///  buffer flag.
        #[doc(alias = "GST_VIDEO_MULTIVIEW_FLAGS_MIXED_MONO")]
        const MIXED_MONO = ffi::GST_VIDEO_MULTIVIEW_FLAGS_MIXED_MONO as _;
    }
}

#[doc(hidden)]
impl IntoGlib for VideoMultiviewFlags {
    type GlibType = ffi::GstVideoMultiviewFlags;

    #[inline]
    fn into_glib(self) -> ffi::GstVideoMultiviewFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstVideoMultiviewFlags> for VideoMultiviewFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::GstVideoMultiviewFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for VideoMultiviewFlags {
    #[inline]
    #[doc(alias = "gst_video_multiview_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gst_video_multiview_flags_get_type()) }
    }
}

impl glib::HasParamSpec for VideoMultiviewFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

impl glib::value::ValueType for VideoMultiviewFlags {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for VideoMultiviewFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for VideoMultiviewFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<VideoMultiviewFlags> for glib::Value {
    #[inline]
    fn from(v: VideoMultiviewFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

bitflags! {
    /// Overlay format flags.
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "GstVideoOverlayFormatFlags")]
    pub struct VideoOverlayFormatFlags: u32 {
        /// RGB are premultiplied by A/255.
        #[doc(alias = "GST_VIDEO_OVERLAY_FORMAT_FLAG_PREMULTIPLIED_ALPHA")]
        const PREMULTIPLIED_ALPHA = ffi::GST_VIDEO_OVERLAY_FORMAT_FLAG_PREMULTIPLIED_ALPHA as _;
        /// a global-alpha value != 1 is set.
        #[doc(alias = "GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA")]
        const GLOBAL_ALPHA = ffi::GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA as _;
    }
}

#[doc(hidden)]
impl IntoGlib for VideoOverlayFormatFlags {
    type GlibType = ffi::GstVideoOverlayFormatFlags;

    #[inline]
    fn into_glib(self) -> ffi::GstVideoOverlayFormatFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstVideoOverlayFormatFlags> for VideoOverlayFormatFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::GstVideoOverlayFormatFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_16")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
impl StaticType for VideoOverlayFormatFlags {
    #[inline]
    #[doc(alias = "gst_video_overlay_format_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gst_video_overlay_format_flags_get_type()) }
    }
}

#[cfg(feature = "v1_16")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
impl glib::HasParamSpec for VideoOverlayFormatFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_16")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
impl glib::value::ValueType for VideoOverlayFormatFlags {
    type Type = Self;
}

#[cfg(feature = "v1_16")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
unsafe impl<'a> glib::value::FromValue<'a> for VideoOverlayFormatFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_16")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
impl ToValue for VideoOverlayFormatFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_16")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
impl From<VideoOverlayFormatFlags> for glib::Value {
    #[inline]
    fn from(v: VideoOverlayFormatFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

bitflags! {
    /// The different flags that can be used when packing and unpacking.
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "GstVideoPackFlags")]
    pub struct VideoPackFlags: u32 {
        /// When the source has a smaller depth
        ///  than the target format, set the least significant bits of the target
        ///  to 0. This is likely slightly faster but less accurate. When this flag
        ///  is not specified, the most significant bits of the source are duplicated
        ///  in the least significant bits of the destination.
        #[doc(alias = "GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE")]
        const TRUNCATE_RANGE = ffi::GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE as _;
        /// The source is interlaced. The unpacked
        ///  format will be interlaced as well with each line containing
        ///  information from alternating fields. (Since: 1.2)
        #[doc(alias = "GST_VIDEO_PACK_FLAG_INTERLACED")]
        const INTERLACED = ffi::GST_VIDEO_PACK_FLAG_INTERLACED as _;
    }
}

#[doc(hidden)]
impl IntoGlib for VideoPackFlags {
    type GlibType = ffi::GstVideoPackFlags;

    #[inline]
    fn into_glib(self) -> ffi::GstVideoPackFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstVideoPackFlags> for VideoPackFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::GstVideoPackFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for VideoPackFlags {
    #[inline]
    #[doc(alias = "gst_video_pack_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gst_video_pack_flags_get_type()) }
    }
}

impl glib::HasParamSpec for VideoPackFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

impl glib::value::ValueType for VideoPackFlags {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for VideoPackFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for VideoPackFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<VideoPackFlags> for glib::Value {
    #[inline]
    fn from(v: VideoPackFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

bitflags! {
    /// Flags related to the time code information.
    /// For drop frame, only 30000/1001 and 60000/1001 frame rates are supported.
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "GstVideoTimeCodeFlags")]
    pub struct VideoTimeCodeFlags: u32 {
        /// Whether we have drop frame rate
        #[doc(alias = "GST_VIDEO_TIME_CODE_FLAGS_DROP_FRAME")]
        const DROP_FRAME = ffi::GST_VIDEO_TIME_CODE_FLAGS_DROP_FRAME as _;
        /// Whether we have interlaced video
        #[doc(alias = "GST_VIDEO_TIME_CODE_FLAGS_INTERLACED")]
        const INTERLACED = ffi::GST_VIDEO_TIME_CODE_FLAGS_INTERLACED as _;
    }
}

#[doc(hidden)]
impl IntoGlib for VideoTimeCodeFlags {
    type GlibType = ffi::GstVideoTimeCodeFlags;

    #[inline]
    fn into_glib(self) -> ffi::GstVideoTimeCodeFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstVideoTimeCodeFlags> for VideoTimeCodeFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::GstVideoTimeCodeFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
impl StaticType for VideoTimeCodeFlags {
    #[inline]
    #[doc(alias = "gst_video_time_code_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gst_video_time_code_flags_get_type()) }
    }
}

#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
impl glib::HasParamSpec for VideoTimeCodeFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
impl glib::value::ValueType for VideoTimeCodeFlags {
    type Type = Self;
}

#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
unsafe impl<'a> glib::value::FromValue<'a> for VideoTimeCodeFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
impl ToValue for VideoTimeCodeFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
impl From<VideoTimeCodeFlags> for glib::Value {
    #[inline]
    fn from(v: VideoTimeCodeFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}