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
// 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 glib::error::ErrorDomain;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
use glib::value::SetValue;
use glib::value::Value;
use glib::Quark;
use glib::StaticType;
use glib::Type;
use gobject_sys;
use gst_gl_sys;

/// OpenGL context errors.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum GLContextError {
    /// Failed for an unspecified reason
    Failed,
    /// The configuration requested is not correct
    WrongConfig,
    /// The OpenGL API requested is not correct
    WrongApi,
    /// The OpenGL libraries are too old
    OldLibs,
    /// glXCreateContext (or similar) failed
    CreateContext,
    /// A resource is not available
    ResourceUnavailable,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for GLContextError {
    type GlibType = gst_gl_sys::GstGLContextError;

    fn to_glib(&self) -> gst_gl_sys::GstGLContextError {
        match *self {
            GLContextError::Failed => gst_gl_sys::GST_GL_CONTEXT_ERROR_FAILED,
            GLContextError::WrongConfig => gst_gl_sys::GST_GL_CONTEXT_ERROR_WRONG_CONFIG,
            GLContextError::WrongApi => gst_gl_sys::GST_GL_CONTEXT_ERROR_WRONG_API,
            GLContextError::OldLibs => gst_gl_sys::GST_GL_CONTEXT_ERROR_OLD_LIBS,
            GLContextError::CreateContext => gst_gl_sys::GST_GL_CONTEXT_ERROR_CREATE_CONTEXT,
            GLContextError::ResourceUnavailable => {
                gst_gl_sys::GST_GL_CONTEXT_ERROR_RESOURCE_UNAVAILABLE
            }
            GLContextError::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gst_gl_sys::GstGLContextError> for GLContextError {
    fn from_glib(value: gst_gl_sys::GstGLContextError) -> Self {
        skip_assert_initialized!();
        match value {
            0 => GLContextError::Failed,
            1 => GLContextError::WrongConfig,
            2 => GLContextError::WrongApi,
            3 => GLContextError::OldLibs,
            4 => GLContextError::CreateContext,
            5 => GLContextError::ResourceUnavailable,
            value => GLContextError::__Unknown(value),
        }
    }
}

impl ErrorDomain for GLContextError {
    fn domain() -> Quark {
        skip_assert_initialized!();
        unsafe { from_glib(gst_gl_sys::gst_gl_context_error_quark()) }
    }

    fn code(self) -> i32 {
        self.to_glib()
    }

    fn from(code: i32) -> Option<Self> {
        skip_assert_initialized!();
        match code {
            0 => Some(GLContextError::Failed),
            1 => Some(GLContextError::WrongConfig),
            2 => Some(GLContextError::WrongApi),
            3 => Some(GLContextError::OldLibs),
            4 => Some(GLContextError::CreateContext),
            5 => Some(GLContextError::ResourceUnavailable),
            _ => Some(GLContextError::Failed),
        }
    }
}

impl StaticType for GLContextError {
    fn static_type() -> Type {
        unsafe { from_glib(gst_gl_sys::gst_gl_context_error_get_type()) }
    }
}

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

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

impl SetValue for GLContextError {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum GLFormat {
    /// Single component replicated across R, G, and B textures
    ///  components
    Luminance,
    /// Single component stored in the A texture component
    Alpha,
    /// Combination of `GLFormat::Luminance` and `GLFormat::Alpha`
    LuminanceAlpha,
    /// Single component stored in the R texture component
    Red,
    /// Single 8-bit component stored in the R texture component
    R8,
    /// Two components stored in the R and G texture components
    Rg,
    /// Two 8-bit components stored in the R and G texture components
    Rg8,
    /// Three components stored in the R, G, and B texture components
    Rgb,
    /// Three 8-bit components stored in the R, G, and B
    ///  texture components
    Rgb8,
    /// Three components of bit depth 5, 6 and 5 stored in the R, G,
    ///  and B texture components respectively.
    Rgb565,
    /// Three 16-bit components stored in the R, G, and B
    ///  texture components
    Rgb16,
    /// Four components stored in the R, G, B, and A texture
    ///  components respectively.
    Rgba,
    /// Four 8-bit components stored in the R, G, B, and A texture
    ///  components respectively.
    Rgba8,
    /// Four 16-bit components stored in the R, G, B, and A texture
    ///  components respectively.
    Rgba16,
    /// A single 16-bit component for depth information.
    DepthComponent16,
    /// A 24-bit component for depth information and
    ///  a 8-bit component for stencil informat.
    Depth24Stencil8,
    Rgb10A2,
    /// Single 16-bit component stored in the R texture component
    R16,
    /// Two 16-bit components stored in the R and G texture components
    Rg16,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for GLFormat {
    type GlibType = gst_gl_sys::GstGLFormat;

    fn to_glib(&self) -> gst_gl_sys::GstGLFormat {
        match *self {
            GLFormat::Luminance => gst_gl_sys::GST_GL_LUMINANCE,
            GLFormat::Alpha => gst_gl_sys::GST_GL_ALPHA,
            GLFormat::LuminanceAlpha => gst_gl_sys::GST_GL_LUMINANCE_ALPHA,
            GLFormat::Red => gst_gl_sys::GST_GL_RED,
            GLFormat::R8 => gst_gl_sys::GST_GL_R8,
            GLFormat::Rg => gst_gl_sys::GST_GL_RG,
            GLFormat::Rg8 => gst_gl_sys::GST_GL_RG8,
            GLFormat::Rgb => gst_gl_sys::GST_GL_RGB,
            GLFormat::Rgb8 => gst_gl_sys::GST_GL_RGB8,
            GLFormat::Rgb565 => gst_gl_sys::GST_GL_RGB565,
            GLFormat::Rgb16 => gst_gl_sys::GST_GL_RGB16,
            GLFormat::Rgba => gst_gl_sys::GST_GL_RGBA,
            GLFormat::Rgba8 => gst_gl_sys::GST_GL_RGBA8,
            GLFormat::Rgba16 => gst_gl_sys::GST_GL_RGBA16,
            GLFormat::DepthComponent16 => gst_gl_sys::GST_GL_DEPTH_COMPONENT16,
            GLFormat::Depth24Stencil8 => gst_gl_sys::GST_GL_DEPTH24_STENCIL8,
            GLFormat::Rgb10A2 => gst_gl_sys::GST_GL_RGB10_A2,
            GLFormat::R16 => gst_gl_sys::GST_GL_R16,
            GLFormat::Rg16 => gst_gl_sys::GST_GL_RG16,
            GLFormat::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gst_gl_sys::GstGLFormat> for GLFormat {
    fn from_glib(value: gst_gl_sys::GstGLFormat) -> Self {
        skip_assert_initialized!();
        match value {
            6409 => GLFormat::Luminance,
            6406 => GLFormat::Alpha,
            6410 => GLFormat::LuminanceAlpha,
            6403 => GLFormat::Red,
            33321 => GLFormat::R8,
            33319 => GLFormat::Rg,
            33323 => GLFormat::Rg8,
            6407 => GLFormat::Rgb,
            32849 => GLFormat::Rgb8,
            36194 => GLFormat::Rgb565,
            32852 => GLFormat::Rgb16,
            6408 => GLFormat::Rgba,
            32856 => GLFormat::Rgba8,
            32859 => GLFormat::Rgba16,
            33189 => GLFormat::DepthComponent16,
            35056 => GLFormat::Depth24Stencil8,
            32857 => GLFormat::Rgb10A2,
            33322 => GLFormat::R16,
            33324 => GLFormat::Rg16,
            value => GLFormat::__Unknown(value),
        }
    }
}

impl StaticType for GLFormat {
    fn static_type() -> Type {
        unsafe { from_glib(gst_gl_sys::gst_gl_format_get_type()) }
    }
}

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

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

impl SetValue for GLFormat {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum GLQueryType {
    /// no query
    None,
    /// query the time elapsed
    TimeElapsed,
    /// query the current time
    Timestamp,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for GLQueryType {
    type GlibType = gst_gl_sys::GstGLQueryType;

    fn to_glib(&self) -> gst_gl_sys::GstGLQueryType {
        match *self {
            GLQueryType::None => gst_gl_sys::GST_GL_QUERY_NONE,
            GLQueryType::TimeElapsed => gst_gl_sys::GST_GL_QUERY_TIME_ELAPSED,
            GLQueryType::Timestamp => gst_gl_sys::GST_GL_QUERY_TIMESTAMP,
            GLQueryType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gst_gl_sys::GstGLQueryType> for GLQueryType {
    fn from_glib(value: gst_gl_sys::GstGLQueryType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => GLQueryType::None,
            1 => GLQueryType::TimeElapsed,
            2 => GLQueryType::Timestamp,
            value => GLQueryType::__Unknown(value),
        }
    }
}

impl StaticType for GLQueryType {
    fn static_type() -> Type {
        unsafe { from_glib(gst_gl_sys::gst_gl_query_type_get_type()) }
    }
}

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

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

impl SetValue for GLQueryType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

/// Compilation stage that caused an error
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum GLSLError {
    /// Compilation error occurred
    Compile,
    /// Link error occurred
    Link,
    /// General program error occurred
    Program,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for GLSLError {
    type GlibType = gst_gl_sys::GstGLSLError;

    fn to_glib(&self) -> gst_gl_sys::GstGLSLError {
        match *self {
            GLSLError::Compile => gst_gl_sys::GST_GLSL_ERROR_COMPILE,
            GLSLError::Link => gst_gl_sys::GST_GLSL_ERROR_LINK,
            GLSLError::Program => gst_gl_sys::GST_GLSL_ERROR_PROGRAM,
            GLSLError::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gst_gl_sys::GstGLSLError> for GLSLError {
    fn from_glib(value: gst_gl_sys::GstGLSLError) -> Self {
        skip_assert_initialized!();
        match value {
            0 => GLSLError::Compile,
            1 => GLSLError::Link,
            2 => GLSLError::Program,
            value => GLSLError::__Unknown(value),
        }
    }
}

impl ErrorDomain for GLSLError {
    fn domain() -> Quark {
        skip_assert_initialized!();
        unsafe { from_glib(gst_gl_sys::gst_glsl_error_quark()) }
    }

    fn code(self) -> i32 {
        self.to_glib()
    }

    fn from(code: i32) -> Option<Self> {
        skip_assert_initialized!();
        match code {
            0 => Some(GLSLError::Compile),
            1 => Some(GLSLError::Link),
            2 => Some(GLSLError::Program),
            value => Some(GLSLError::__Unknown(value)),
        }
    }
}

impl StaticType for GLSLError {
    fn static_type() -> Type {
        unsafe { from_glib(gst_gl_sys::gst_glsl_error_get_type()) }
    }
}

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

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

impl SetValue for GLSLError {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

/// GLSL version list
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum GLSLVersion {
    /// no version
    None,
    _100,
    _110,
    _120,
    _130,
    _140,
    _150,
    _300,
    _310,
    _320,
    _330,
    _400,
    _410,
    _420,
    _430,
    _440,
    _450,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for GLSLVersion {
    type GlibType = gst_gl_sys::GstGLSLVersion;

    fn to_glib(&self) -> gst_gl_sys::GstGLSLVersion {
        match *self {
            GLSLVersion::None => gst_gl_sys::GST_GLSL_VERSION_NONE,
            GLSLVersion::_100 => gst_gl_sys::GST_GLSL_VERSION_100,
            GLSLVersion::_110 => gst_gl_sys::GST_GLSL_VERSION_110,
            GLSLVersion::_120 => gst_gl_sys::GST_GLSL_VERSION_120,
            GLSLVersion::_130 => gst_gl_sys::GST_GLSL_VERSION_130,
            GLSLVersion::_140 => gst_gl_sys::GST_GLSL_VERSION_140,
            GLSLVersion::_150 => gst_gl_sys::GST_GLSL_VERSION_150,
            GLSLVersion::_300 => gst_gl_sys::GST_GLSL_VERSION_300,
            GLSLVersion::_310 => gst_gl_sys::GST_GLSL_VERSION_310,
            GLSLVersion::_320 => gst_gl_sys::GST_GLSL_VERSION_320,
            GLSLVersion::_330 => gst_gl_sys::GST_GLSL_VERSION_330,
            GLSLVersion::_400 => gst_gl_sys::GST_GLSL_VERSION_400,
            GLSLVersion::_410 => gst_gl_sys::GST_GLSL_VERSION_410,
            GLSLVersion::_420 => gst_gl_sys::GST_GLSL_VERSION_420,
            GLSLVersion::_430 => gst_gl_sys::GST_GLSL_VERSION_430,
            GLSLVersion::_440 => gst_gl_sys::GST_GLSL_VERSION_440,
            GLSLVersion::_450 => gst_gl_sys::GST_GLSL_VERSION_450,
            GLSLVersion::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gst_gl_sys::GstGLSLVersion> for GLSLVersion {
    fn from_glib(value: gst_gl_sys::GstGLSLVersion) -> Self {
        skip_assert_initialized!();
        match value {
            0 => GLSLVersion::None,
            100 => GLSLVersion::_100,
            110 => GLSLVersion::_110,
            120 => GLSLVersion::_120,
            130 => GLSLVersion::_130,
            140 => GLSLVersion::_140,
            150 => GLSLVersion::_150,
            300 => GLSLVersion::_300,
            310 => GLSLVersion::_310,
            320 => GLSLVersion::_320,
            330 => GLSLVersion::_330,
            400 => GLSLVersion::_400,
            410 => GLSLVersion::_410,
            420 => GLSLVersion::_420,
            430 => GLSLVersion::_430,
            440 => GLSLVersion::_440,
            450 => GLSLVersion::_450,
            value => GLSLVersion::__Unknown(value),
        }
    }
}

impl StaticType for GLSLVersion {
    fn static_type() -> Type {
        unsafe { from_glib(gst_gl_sys::gst_glsl_version_get_type()) }
    }
}

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

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

impl SetValue for GLSLVersion {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

/// Output anaglyph type to generate when downmixing to mono
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum GLStereoDownmix {
    /// Dubois optimised Green-Magenta anaglyph
    GreenMagentaDubois,
    /// Dubois optimised Red-Cyan anaglyph
    RedCyanDubois,
    /// Dubois optimised Amber-Blue anaglyph
    AmberBlueDubois,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for GLStereoDownmix {
    type GlibType = gst_gl_sys::GstGLStereoDownmix;

    fn to_glib(&self) -> gst_gl_sys::GstGLStereoDownmix {
        match *self {
            GLStereoDownmix::GreenMagentaDubois => {
                gst_gl_sys::GST_GL_STEREO_DOWNMIX_ANAGLYPH_GREEN_MAGENTA_DUBOIS
            }
            GLStereoDownmix::RedCyanDubois => {
                gst_gl_sys::GST_GL_STEREO_DOWNMIX_ANAGLYPH_RED_CYAN_DUBOIS
            }
            GLStereoDownmix::AmberBlueDubois => {
                gst_gl_sys::GST_GL_STEREO_DOWNMIX_ANAGLYPH_AMBER_BLUE_DUBOIS
            }
            GLStereoDownmix::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gst_gl_sys::GstGLStereoDownmix> for GLStereoDownmix {
    fn from_glib(value: gst_gl_sys::GstGLStereoDownmix) -> Self {
        skip_assert_initialized!();
        match value {
            0 => GLStereoDownmix::GreenMagentaDubois,
            1 => GLStereoDownmix::RedCyanDubois,
            2 => GLStereoDownmix::AmberBlueDubois,
            value => GLStereoDownmix::__Unknown(value),
        }
    }
}

impl StaticType for GLStereoDownmix {
    fn static_type() -> Type {
        unsafe { from_glib(gst_gl_sys::gst_gl_stereo_downmix_get_type()) }
    }
}

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

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

impl SetValue for GLStereoDownmix {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum GLTextureTarget {
    /// no texture target
    None,
    _2d,
    /// rectangle texture target
    Rectangle,
    /// external oes texture target
    ExternalOes,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for GLTextureTarget {
    type GlibType = gst_gl_sys::GstGLTextureTarget;

    fn to_glib(&self) -> gst_gl_sys::GstGLTextureTarget {
        match *self {
            GLTextureTarget::None => gst_gl_sys::GST_GL_TEXTURE_TARGET_NONE,
            GLTextureTarget::_2d => gst_gl_sys::GST_GL_TEXTURE_TARGET_2D,
            GLTextureTarget::Rectangle => gst_gl_sys::GST_GL_TEXTURE_TARGET_RECTANGLE,
            GLTextureTarget::ExternalOes => gst_gl_sys::GST_GL_TEXTURE_TARGET_EXTERNAL_OES,
            GLTextureTarget::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gst_gl_sys::GstGLTextureTarget> for GLTextureTarget {
    fn from_glib(value: gst_gl_sys::GstGLTextureTarget) -> Self {
        skip_assert_initialized!();
        match value {
            0 => GLTextureTarget::None,
            1 => GLTextureTarget::_2d,
            2 => GLTextureTarget::Rectangle,
            3 => GLTextureTarget::ExternalOes,
            value => GLTextureTarget::__Unknown(value),
        }
    }
}

impl StaticType for GLTextureTarget {
    fn static_type() -> Type {
        unsafe { from_glib(gst_gl_sys::gst_gl_texture_target_get_type()) }
    }
}

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

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

impl SetValue for GLTextureTarget {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum GLUploadReturn {
    /// No further processing required
    Done,
    /// An unspecified error occurred
    Error,
    /// The configuration is unsupported.
    Unsupported,
    /// This element requires a reconfiguration.
    Reconfigure,
    /// private return value.
    UnsharedGlContext,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for GLUploadReturn {
    type GlibType = gst_gl_sys::GstGLUploadReturn;

    fn to_glib(&self) -> gst_gl_sys::GstGLUploadReturn {
        match *self {
            GLUploadReturn::Done => gst_gl_sys::GST_GL_UPLOAD_DONE,
            GLUploadReturn::Error => gst_gl_sys::GST_GL_UPLOAD_ERROR,
            GLUploadReturn::Unsupported => gst_gl_sys::GST_GL_UPLOAD_UNSUPPORTED,
            GLUploadReturn::Reconfigure => gst_gl_sys::GST_GL_UPLOAD_RECONFIGURE,
            GLUploadReturn::UnsharedGlContext => gst_gl_sys::GST_GL_UPLOAD_UNSHARED_GL_CONTEXT,
            GLUploadReturn::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gst_gl_sys::GstGLUploadReturn> for GLUploadReturn {
    fn from_glib(value: gst_gl_sys::GstGLUploadReturn) -> Self {
        skip_assert_initialized!();
        match value {
            1 => GLUploadReturn::Done,
            -1 => GLUploadReturn::Error,
            -2 => GLUploadReturn::Unsupported,
            -3 => GLUploadReturn::Reconfigure,
            -100 => GLUploadReturn::UnsharedGlContext,
            value => GLUploadReturn::__Unknown(value),
        }
    }
}

impl StaticType for GLUploadReturn {
    fn static_type() -> Type {
        unsafe { from_glib(gst_gl_sys::gst_gl_upload_return_get_type()) }
    }
}

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

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

impl SetValue for GLUploadReturn {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum GLWindowError {
    /// failed for a unspecified reason
    Failed,
    /// the implementation is too old
    OldLibs,
    /// no such resource was found
    ResourceUnavailable,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for GLWindowError {
    type GlibType = gst_gl_sys::GstGLWindowError;

    fn to_glib(&self) -> gst_gl_sys::GstGLWindowError {
        match *self {
            GLWindowError::Failed => gst_gl_sys::GST_GL_WINDOW_ERROR_FAILED,
            GLWindowError::OldLibs => gst_gl_sys::GST_GL_WINDOW_ERROR_OLD_LIBS,
            GLWindowError::ResourceUnavailable => {
                gst_gl_sys::GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE
            }
            GLWindowError::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gst_gl_sys::GstGLWindowError> for GLWindowError {
    fn from_glib(value: gst_gl_sys::GstGLWindowError) -> Self {
        skip_assert_initialized!();
        match value {
            0 => GLWindowError::Failed,
            1 => GLWindowError::OldLibs,
            2 => GLWindowError::ResourceUnavailable,
            value => GLWindowError::__Unknown(value),
        }
    }
}

impl ErrorDomain for GLWindowError {
    fn domain() -> Quark {
        skip_assert_initialized!();
        unsafe { from_glib(gst_gl_sys::gst_gl_window_error_quark()) }
    }

    fn code(self) -> i32 {
        self.to_glib()
    }

    fn from(code: i32) -> Option<Self> {
        skip_assert_initialized!();
        match code {
            0 => Some(GLWindowError::Failed),
            1 => Some(GLWindowError::OldLibs),
            2 => Some(GLWindowError::ResourceUnavailable),
            _ => Some(GLWindowError::Failed),
        }
    }
}

impl StaticType for GLWindowError {
    fn static_type() -> Type {
        unsafe { from_glib(gst_gl_sys::gst_gl_window_error_get_type()) }
    }
}

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

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

impl SetValue for GLWindowError {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}