gstreamer_gl/auto/
enums.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
4// DO NOT EDIT
5
6use crate::{ffi, GLContext, GLSLProfile};
7use glib::{prelude::*, translate::*};
8
9#[cfg(feature = "v1_20")]
10#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
11#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
12#[non_exhaustive]
13#[doc(alias = "GstGLConfigCaveat")]
14pub enum GLConfigCaveat {
15    /// none
16    #[doc(alias = "GST_GL_CONFIG_CAVEAT_NONE")]
17    None,
18    /// slow
19    #[doc(alias = "GST_GL_CONFIG_CAVEAT_SLOW")]
20    Slow,
21    /// non-conformant
22    #[doc(alias = "GST_GL_CONFIG_CAVEAT_NON_CONFORMANT")]
23    NonConformant,
24    #[doc(hidden)]
25    __Unknown(i32),
26}
27
28#[cfg(feature = "v1_20")]
29#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
30impl GLConfigCaveat {
31    #[doc(alias = "gst_gl_config_caveat_to_string")]
32    #[doc(alias = "to_string")]
33    pub fn to_str(self) -> Option<glib::GString> {
34        assert_initialized_main_thread!();
35        unsafe { from_glib_none(ffi::gst_gl_config_caveat_to_string(self.into_glib())) }
36    }
37}
38
39#[cfg(feature = "v1_20")]
40#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
41#[doc(hidden)]
42impl IntoGlib for GLConfigCaveat {
43    type GlibType = ffi::GstGLConfigCaveat;
44
45    #[inline]
46    fn into_glib(self) -> ffi::GstGLConfigCaveat {
47        match self {
48            Self::None => ffi::GST_GL_CONFIG_CAVEAT_NONE,
49            Self::Slow => ffi::GST_GL_CONFIG_CAVEAT_SLOW,
50            Self::NonConformant => ffi::GST_GL_CONFIG_CAVEAT_NON_CONFORMANT,
51            Self::__Unknown(value) => value,
52        }
53    }
54}
55
56#[cfg(feature = "v1_20")]
57#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
58#[doc(hidden)]
59impl FromGlib<ffi::GstGLConfigCaveat> for GLConfigCaveat {
60    #[inline]
61    unsafe fn from_glib(value: ffi::GstGLConfigCaveat) -> Self {
62        skip_assert_initialized!();
63
64        match value {
65            ffi::GST_GL_CONFIG_CAVEAT_NONE => Self::None,
66            ffi::GST_GL_CONFIG_CAVEAT_SLOW => Self::Slow,
67            ffi::GST_GL_CONFIG_CAVEAT_NON_CONFORMANT => Self::NonConformant,
68            value => Self::__Unknown(value),
69        }
70    }
71}
72
73#[cfg(feature = "v1_20")]
74#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
75impl StaticType for GLConfigCaveat {
76    #[inline]
77    #[doc(alias = "gst_gl_config_caveat_get_type")]
78    fn static_type() -> glib::Type {
79        unsafe { from_glib(ffi::gst_gl_config_caveat_get_type()) }
80    }
81}
82
83#[cfg(feature = "v1_20")]
84#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
85impl glib::HasParamSpec for GLConfigCaveat {
86    type ParamSpec = glib::ParamSpecEnum;
87    type SetValue = Self;
88    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
89
90    fn param_spec_builder() -> Self::BuilderFn {
91        Self::ParamSpec::builder_with_default
92    }
93}
94
95#[cfg(feature = "v1_20")]
96#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
97impl glib::value::ValueType for GLConfigCaveat {
98    type Type = Self;
99}
100
101#[cfg(feature = "v1_20")]
102#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
103unsafe impl<'a> glib::value::FromValue<'a> for GLConfigCaveat {
104    type Checker = glib::value::GenericValueTypeChecker<Self>;
105
106    #[inline]
107    unsafe fn from_value(value: &'a glib::Value) -> Self {
108        skip_assert_initialized!();
109        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
110    }
111}
112
113#[cfg(feature = "v1_20")]
114#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
115impl ToValue for GLConfigCaveat {
116    #[inline]
117    fn to_value(&self) -> glib::Value {
118        let mut value = glib::Value::for_value_type::<Self>();
119        unsafe {
120            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
121        }
122        value
123    }
124
125    #[inline]
126    fn value_type(&self) -> glib::Type {
127        Self::static_type()
128    }
129}
130
131#[cfg(feature = "v1_20")]
132#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
133impl From<GLConfigCaveat> for glib::Value {
134    #[inline]
135    fn from(v: GLConfigCaveat) -> Self {
136        skip_assert_initialized!();
137        ToValue::to_value(&v)
138    }
139}
140
141/// OpenGL context errors.
142#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
143#[non_exhaustive]
144#[doc(alias = "GstGLContextError")]
145pub enum GLContextError {
146    /// Failed for an unspecified reason
147    #[doc(alias = "GST_GL_CONTEXT_ERROR_FAILED")]
148    Failed,
149    /// The configuration requested is not correct
150    #[doc(alias = "GST_GL_CONTEXT_ERROR_WRONG_CONFIG")]
151    WrongConfig,
152    /// The OpenGL API requested is not correct
153    #[doc(alias = "GST_GL_CONTEXT_ERROR_WRONG_API")]
154    WrongApi,
155    /// The OpenGL libraries are too old
156    #[doc(alias = "GST_GL_CONTEXT_ERROR_OLD_LIBS")]
157    OldLibs,
158    /// glXCreateContext (or similar) failed
159    #[doc(alias = "GST_GL_CONTEXT_ERROR_CREATE_CONTEXT")]
160    CreateContext,
161    /// A resource is not available
162    #[doc(alias = "GST_GL_CONTEXT_ERROR_RESOURCE_UNAVAILABLE")]
163    ResourceUnavailable,
164    #[doc(hidden)]
165    __Unknown(i32),
166}
167
168#[doc(hidden)]
169impl IntoGlib for GLContextError {
170    type GlibType = ffi::GstGLContextError;
171
172    #[inline]
173    fn into_glib(self) -> ffi::GstGLContextError {
174        match self {
175            Self::Failed => ffi::GST_GL_CONTEXT_ERROR_FAILED,
176            Self::WrongConfig => ffi::GST_GL_CONTEXT_ERROR_WRONG_CONFIG,
177            Self::WrongApi => ffi::GST_GL_CONTEXT_ERROR_WRONG_API,
178            Self::OldLibs => ffi::GST_GL_CONTEXT_ERROR_OLD_LIBS,
179            Self::CreateContext => ffi::GST_GL_CONTEXT_ERROR_CREATE_CONTEXT,
180            Self::ResourceUnavailable => ffi::GST_GL_CONTEXT_ERROR_RESOURCE_UNAVAILABLE,
181            Self::__Unknown(value) => value,
182        }
183    }
184}
185
186#[doc(hidden)]
187impl FromGlib<ffi::GstGLContextError> for GLContextError {
188    #[inline]
189    unsafe fn from_glib(value: ffi::GstGLContextError) -> Self {
190        skip_assert_initialized!();
191
192        match value {
193            ffi::GST_GL_CONTEXT_ERROR_FAILED => Self::Failed,
194            ffi::GST_GL_CONTEXT_ERROR_WRONG_CONFIG => Self::WrongConfig,
195            ffi::GST_GL_CONTEXT_ERROR_WRONG_API => Self::WrongApi,
196            ffi::GST_GL_CONTEXT_ERROR_OLD_LIBS => Self::OldLibs,
197            ffi::GST_GL_CONTEXT_ERROR_CREATE_CONTEXT => Self::CreateContext,
198            ffi::GST_GL_CONTEXT_ERROR_RESOURCE_UNAVAILABLE => Self::ResourceUnavailable,
199            value => Self::__Unknown(value),
200        }
201    }
202}
203
204impl glib::error::ErrorDomain for GLContextError {
205    #[inline]
206    fn domain() -> glib::Quark {
207        skip_assert_initialized!();
208
209        unsafe { from_glib(ffi::gst_gl_context_error_quark()) }
210    }
211
212    #[inline]
213    fn code(self) -> i32 {
214        self.into_glib()
215    }
216
217    #[inline]
218    #[allow(clippy::match_single_binding)]
219    fn from(code: i32) -> Option<Self> {
220        skip_assert_initialized!();
221        match unsafe { from_glib(code) } {
222            Self::__Unknown(_) => Some(Self::Failed),
223            value => Some(value),
224        }
225    }
226}
227
228impl StaticType for GLContextError {
229    #[inline]
230    #[doc(alias = "gst_gl_context_error_get_type")]
231    fn static_type() -> glib::Type {
232        unsafe { from_glib(ffi::gst_gl_context_error_get_type()) }
233    }
234}
235
236impl glib::HasParamSpec for GLContextError {
237    type ParamSpec = glib::ParamSpecEnum;
238    type SetValue = Self;
239    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
240
241    fn param_spec_builder() -> Self::BuilderFn {
242        Self::ParamSpec::builder_with_default
243    }
244}
245
246impl glib::value::ValueType for GLContextError {
247    type Type = Self;
248}
249
250unsafe impl<'a> glib::value::FromValue<'a> for GLContextError {
251    type Checker = glib::value::GenericValueTypeChecker<Self>;
252
253    #[inline]
254    unsafe fn from_value(value: &'a glib::Value) -> Self {
255        skip_assert_initialized!();
256        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
257    }
258}
259
260impl ToValue for GLContextError {
261    #[inline]
262    fn to_value(&self) -> glib::Value {
263        let mut value = glib::Value::for_value_type::<Self>();
264        unsafe {
265            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
266        }
267        value
268    }
269
270    #[inline]
271    fn value_type(&self) -> glib::Type {
272        Self::static_type()
273    }
274}
275
276impl From<GLContextError> for glib::Value {
277    #[inline]
278    fn from(v: GLContextError) -> Self {
279        skip_assert_initialized!();
280        ToValue::to_value(&v)
281    }
282}
283
284#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
285#[non_exhaustive]
286#[doc(alias = "GstGLFormat")]
287pub enum GLFormat {
288    /// Single component replicated across R, G, and B textures
289    ///  components
290    #[doc(alias = "GST_GL_LUMINANCE")]
291    Luminance,
292    /// Single component stored in the A texture component
293    #[doc(alias = "GST_GL_ALPHA")]
294    Alpha,
295    /// Combination of [`Luminance`][Self::Luminance] and [`Alpha`][Self::Alpha]
296    #[doc(alias = "GST_GL_LUMINANCE_ALPHA")]
297    LuminanceAlpha,
298    /// Single component stored in the R texture component
299    #[doc(alias = "GST_GL_RED")]
300    Red,
301    /// Single 8-bit component stored in the R texture component
302    #[doc(alias = "GST_GL_R8")]
303    R8,
304    /// Two components stored in the R and G texture components
305    #[doc(alias = "GST_GL_RG")]
306    Rg,
307    /// Two 8-bit components stored in the R and G texture components
308    #[doc(alias = "GST_GL_RG8")]
309    Rg8,
310    /// Three components stored in the R, G, and B texture components
311    #[doc(alias = "GST_GL_RGB")]
312    Rgb,
313    /// Three 8-bit components stored in the R, G, and B
314    ///  texture components
315    #[doc(alias = "GST_GL_RGB8")]
316    Rgb8,
317    /// Three components of bit depth 5, 6 and 5 stored in the R, G,
318    ///  and B texture components respectively.
319    #[doc(alias = "GST_GL_RGB565")]
320    Rgb565,
321    /// Three 16-bit components stored in the R, G, and B
322    ///  texture components
323    #[doc(alias = "GST_GL_RGB16")]
324    Rgb16,
325    /// Four components stored in the R, G, B, and A texture
326    ///  components respectively.
327    #[doc(alias = "GST_GL_RGBA")]
328    Rgba,
329    /// Four 8-bit components stored in the R, G, B, and A texture
330    ///  components respectively.
331    #[doc(alias = "GST_GL_RGBA8")]
332    Rgba8,
333    /// Four 16-bit components stored in the R, G, B, and A texture
334    ///  components respectively.
335    #[doc(alias = "GST_GL_RGBA16")]
336    Rgba16,
337    /// A single 16-bit component for depth information.
338    #[doc(alias = "GST_GL_DEPTH_COMPONENT16")]
339    DepthComponent16,
340    /// A 24-bit component for depth information and
341    ///  a 8-bit component for stencil informat.
342    #[doc(alias = "GST_GL_DEPTH24_STENCIL8")]
343    Depth24Stencil8,
344    #[doc(alias = "GST_GL_RGB10_A2")]
345    Rgb10A2,
346    /// Single 16-bit component stored in the R texture component
347    #[doc(alias = "GST_GL_R16")]
348    R16,
349    /// Two 16-bit components stored in the R and G texture components
350    #[doc(alias = "GST_GL_RG16")]
351    Rg16,
352    #[doc(hidden)]
353    __Unknown(i32),
354}
355
356impl GLFormat {
357    #[doc(alias = "gst_gl_format_from_video_info")]
358    pub fn from_video_info(
359        context: &impl IsA<GLContext>,
360        vinfo: &gst_video::VideoInfo,
361        plane: u32,
362    ) -> GLFormat {
363        skip_assert_initialized!();
364        unsafe {
365            from_glib(ffi::gst_gl_format_from_video_info(
366                context.as_ref().to_glib_none().0,
367                vinfo.to_glib_none().0,
368                plane,
369            ))
370        }
371    }
372
373    #[cfg(feature = "v1_16")]
374    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
375    #[doc(alias = "gst_gl_format_is_supported")]
376    pub fn is_supported(context: &impl IsA<GLContext>, format: GLFormat) -> bool {
377        skip_assert_initialized!();
378        unsafe {
379            from_glib(ffi::gst_gl_format_is_supported(
380                context.as_ref().to_glib_none().0,
381                format.into_glib(),
382            ))
383        }
384    }
385
386    #[cfg(feature = "v1_24")]
387    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
388    #[doc(alias = "gst_gl_format_n_components")]
389    pub fn n_components(self) -> u32 {
390        assert_initialized_main_thread!();
391        unsafe { ffi::gst_gl_format_n_components(self.into_glib()) }
392    }
393
394    #[cfg(feature = "v1_16")]
395    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
396    #[doc(alias = "gst_gl_format_type_from_sized_gl_format")]
397    pub fn type_from_sized_gl_format(self) -> (GLFormat, u32) {
398        assert_initialized_main_thread!();
399        unsafe {
400            let mut unsized_format = std::mem::MaybeUninit::uninit();
401            let mut gl_type = std::mem::MaybeUninit::uninit();
402            ffi::gst_gl_format_type_from_sized_gl_format(
403                self.into_glib(),
404                unsized_format.as_mut_ptr(),
405                gl_type.as_mut_ptr(),
406            );
407            (
408                from_glib(unsized_format.assume_init()),
409                gl_type.assume_init(),
410            )
411        }
412    }
413
414    #[doc(alias = "gst_gl_format_type_n_bytes")]
415    pub fn type_n_bytes(format: u32, type_: u32) -> u32 {
416        assert_initialized_main_thread!();
417        unsafe { ffi::gst_gl_format_type_n_bytes(format, type_) }
418    }
419}
420
421#[doc(hidden)]
422impl IntoGlib for GLFormat {
423    type GlibType = ffi::GstGLFormat;
424
425    fn into_glib(self) -> ffi::GstGLFormat {
426        match self {
427            Self::Luminance => ffi::GST_GL_LUMINANCE,
428            Self::Alpha => ffi::GST_GL_ALPHA,
429            Self::LuminanceAlpha => ffi::GST_GL_LUMINANCE_ALPHA,
430            Self::Red => ffi::GST_GL_RED,
431            Self::R8 => ffi::GST_GL_R8,
432            Self::Rg => ffi::GST_GL_RG,
433            Self::Rg8 => ffi::GST_GL_RG8,
434            Self::Rgb => ffi::GST_GL_RGB,
435            Self::Rgb8 => ffi::GST_GL_RGB8,
436            Self::Rgb565 => ffi::GST_GL_RGB565,
437            Self::Rgb16 => ffi::GST_GL_RGB16,
438            Self::Rgba => ffi::GST_GL_RGBA,
439            Self::Rgba8 => ffi::GST_GL_RGBA8,
440            Self::Rgba16 => ffi::GST_GL_RGBA16,
441            Self::DepthComponent16 => ffi::GST_GL_DEPTH_COMPONENT16,
442            Self::Depth24Stencil8 => ffi::GST_GL_DEPTH24_STENCIL8,
443            Self::Rgb10A2 => ffi::GST_GL_RGB10_A2,
444            Self::R16 => ffi::GST_GL_R16,
445            Self::Rg16 => ffi::GST_GL_RG16,
446            Self::__Unknown(value) => value,
447        }
448    }
449}
450
451#[doc(hidden)]
452impl FromGlib<ffi::GstGLFormat> for GLFormat {
453    unsafe fn from_glib(value: ffi::GstGLFormat) -> Self {
454        skip_assert_initialized!();
455
456        match value {
457            ffi::GST_GL_LUMINANCE => Self::Luminance,
458            ffi::GST_GL_ALPHA => Self::Alpha,
459            ffi::GST_GL_LUMINANCE_ALPHA => Self::LuminanceAlpha,
460            ffi::GST_GL_RED => Self::Red,
461            ffi::GST_GL_R8 => Self::R8,
462            ffi::GST_GL_RG => Self::Rg,
463            ffi::GST_GL_RG8 => Self::Rg8,
464            ffi::GST_GL_RGB => Self::Rgb,
465            ffi::GST_GL_RGB8 => Self::Rgb8,
466            ffi::GST_GL_RGB565 => Self::Rgb565,
467            ffi::GST_GL_RGB16 => Self::Rgb16,
468            ffi::GST_GL_RGBA => Self::Rgba,
469            ffi::GST_GL_RGBA8 => Self::Rgba8,
470            ffi::GST_GL_RGBA16 => Self::Rgba16,
471            ffi::GST_GL_DEPTH_COMPONENT16 => Self::DepthComponent16,
472            ffi::GST_GL_DEPTH24_STENCIL8 => Self::Depth24Stencil8,
473            ffi::GST_GL_RGB10_A2 => Self::Rgb10A2,
474            ffi::GST_GL_R16 => Self::R16,
475            ffi::GST_GL_RG16 => Self::Rg16,
476            value => Self::__Unknown(value),
477        }
478    }
479}
480
481impl StaticType for GLFormat {
482    #[inline]
483    #[doc(alias = "gst_gl_format_get_type")]
484    fn static_type() -> glib::Type {
485        unsafe { from_glib(ffi::gst_gl_format_get_type()) }
486    }
487}
488
489impl glib::HasParamSpec for GLFormat {
490    type ParamSpec = glib::ParamSpecEnum;
491    type SetValue = Self;
492    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
493
494    fn param_spec_builder() -> Self::BuilderFn {
495        Self::ParamSpec::builder_with_default
496    }
497}
498
499impl glib::value::ValueType for GLFormat {
500    type Type = Self;
501}
502
503unsafe impl<'a> glib::value::FromValue<'a> for GLFormat {
504    type Checker = glib::value::GenericValueTypeChecker<Self>;
505
506    #[inline]
507    unsafe fn from_value(value: &'a glib::Value) -> Self {
508        skip_assert_initialized!();
509        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
510    }
511}
512
513impl ToValue for GLFormat {
514    #[inline]
515    fn to_value(&self) -> glib::Value {
516        let mut value = glib::Value::for_value_type::<Self>();
517        unsafe {
518            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
519        }
520        value
521    }
522
523    #[inline]
524    fn value_type(&self) -> glib::Type {
525        Self::static_type()
526    }
527}
528
529impl From<GLFormat> for glib::Value {
530    #[inline]
531    fn from(v: GLFormat) -> Self {
532        skip_assert_initialized!();
533        ToValue::to_value(&v)
534    }
535}
536
537#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
538#[non_exhaustive]
539#[doc(alias = "GstGLQueryType")]
540pub enum GLQueryType {
541    /// no query
542    #[doc(alias = "GST_GL_QUERY_NONE")]
543    None,
544    /// query the time elapsed
545    #[doc(alias = "GST_GL_QUERY_TIME_ELAPSED")]
546    TimeElapsed,
547    /// query the current time
548    #[doc(alias = "GST_GL_QUERY_TIMESTAMP")]
549    Timestamp,
550    #[doc(hidden)]
551    __Unknown(i32),
552}
553
554#[doc(hidden)]
555impl IntoGlib for GLQueryType {
556    type GlibType = ffi::GstGLQueryType;
557
558    #[inline]
559    fn into_glib(self) -> ffi::GstGLQueryType {
560        match self {
561            Self::None => ffi::GST_GL_QUERY_NONE,
562            Self::TimeElapsed => ffi::GST_GL_QUERY_TIME_ELAPSED,
563            Self::Timestamp => ffi::GST_GL_QUERY_TIMESTAMP,
564            Self::__Unknown(value) => value,
565        }
566    }
567}
568
569#[doc(hidden)]
570impl FromGlib<ffi::GstGLQueryType> for GLQueryType {
571    #[inline]
572    unsafe fn from_glib(value: ffi::GstGLQueryType) -> Self {
573        skip_assert_initialized!();
574
575        match value {
576            ffi::GST_GL_QUERY_NONE => Self::None,
577            ffi::GST_GL_QUERY_TIME_ELAPSED => Self::TimeElapsed,
578            ffi::GST_GL_QUERY_TIMESTAMP => Self::Timestamp,
579            value => Self::__Unknown(value),
580        }
581    }
582}
583
584impl StaticType for GLQueryType {
585    #[inline]
586    #[doc(alias = "gst_gl_query_type_get_type")]
587    fn static_type() -> glib::Type {
588        unsafe { from_glib(ffi::gst_gl_query_type_get_type()) }
589    }
590}
591
592impl glib::HasParamSpec for GLQueryType {
593    type ParamSpec = glib::ParamSpecEnum;
594    type SetValue = Self;
595    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
596
597    fn param_spec_builder() -> Self::BuilderFn {
598        Self::ParamSpec::builder_with_default
599    }
600}
601
602impl glib::value::ValueType for GLQueryType {
603    type Type = Self;
604}
605
606unsafe impl<'a> glib::value::FromValue<'a> for GLQueryType {
607    type Checker = glib::value::GenericValueTypeChecker<Self>;
608
609    #[inline]
610    unsafe fn from_value(value: &'a glib::Value) -> Self {
611        skip_assert_initialized!();
612        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
613    }
614}
615
616impl ToValue for GLQueryType {
617    #[inline]
618    fn to_value(&self) -> glib::Value {
619        let mut value = glib::Value::for_value_type::<Self>();
620        unsafe {
621            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
622        }
623        value
624    }
625
626    #[inline]
627    fn value_type(&self) -> glib::Type {
628        Self::static_type()
629    }
630}
631
632impl From<GLQueryType> for glib::Value {
633    #[inline]
634    fn from(v: GLQueryType) -> Self {
635        skip_assert_initialized!();
636        ToValue::to_value(&v)
637    }
638}
639
640/// Compilation stage that caused an error
641#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
642#[non_exhaustive]
643#[doc(alias = "GstGLSLError")]
644pub enum GLSLError {
645    /// Compilation error occurred
646    #[doc(alias = "GST_GLSL_ERROR_COMPILE")]
647    Compile,
648    /// Link error occurred
649    #[doc(alias = "GST_GLSL_ERROR_LINK")]
650    Link,
651    /// General program error occurred
652    #[doc(alias = "GST_GLSL_ERROR_PROGRAM")]
653    Program,
654    #[doc(hidden)]
655    __Unknown(i32),
656}
657
658#[doc(hidden)]
659impl IntoGlib for GLSLError {
660    type GlibType = ffi::GstGLSLError;
661
662    #[inline]
663    fn into_glib(self) -> ffi::GstGLSLError {
664        match self {
665            Self::Compile => ffi::GST_GLSL_ERROR_COMPILE,
666            Self::Link => ffi::GST_GLSL_ERROR_LINK,
667            Self::Program => ffi::GST_GLSL_ERROR_PROGRAM,
668            Self::__Unknown(value) => value,
669        }
670    }
671}
672
673#[doc(hidden)]
674impl FromGlib<ffi::GstGLSLError> for GLSLError {
675    #[inline]
676    unsafe fn from_glib(value: ffi::GstGLSLError) -> Self {
677        skip_assert_initialized!();
678
679        match value {
680            ffi::GST_GLSL_ERROR_COMPILE => Self::Compile,
681            ffi::GST_GLSL_ERROR_LINK => Self::Link,
682            ffi::GST_GLSL_ERROR_PROGRAM => Self::Program,
683            value => Self::__Unknown(value),
684        }
685    }
686}
687
688impl glib::error::ErrorDomain for GLSLError {
689    #[inline]
690    fn domain() -> glib::Quark {
691        skip_assert_initialized!();
692
693        unsafe { from_glib(ffi::gst_glsl_error_quark()) }
694    }
695
696    #[inline]
697    fn code(self) -> i32 {
698        self.into_glib()
699    }
700
701    #[inline]
702    #[allow(clippy::match_single_binding)]
703    fn from(code: i32) -> Option<Self> {
704        skip_assert_initialized!();
705        match unsafe { from_glib(code) } {
706            value => Some(value),
707        }
708    }
709}
710
711impl StaticType for GLSLError {
712    #[inline]
713    #[doc(alias = "gst_glsl_error_get_type")]
714    fn static_type() -> glib::Type {
715        unsafe { from_glib(ffi::gst_glsl_error_get_type()) }
716    }
717}
718
719impl glib::HasParamSpec for GLSLError {
720    type ParamSpec = glib::ParamSpecEnum;
721    type SetValue = Self;
722    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
723
724    fn param_spec_builder() -> Self::BuilderFn {
725        Self::ParamSpec::builder_with_default
726    }
727}
728
729impl glib::value::ValueType for GLSLError {
730    type Type = Self;
731}
732
733unsafe impl<'a> glib::value::FromValue<'a> for GLSLError {
734    type Checker = glib::value::GenericValueTypeChecker<Self>;
735
736    #[inline]
737    unsafe fn from_value(value: &'a glib::Value) -> Self {
738        skip_assert_initialized!();
739        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
740    }
741}
742
743impl ToValue for GLSLError {
744    #[inline]
745    fn to_value(&self) -> glib::Value {
746        let mut value = glib::Value::for_value_type::<Self>();
747        unsafe {
748            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
749        }
750        value
751    }
752
753    #[inline]
754    fn value_type(&self) -> glib::Type {
755        Self::static_type()
756    }
757}
758
759impl From<GLSLError> for glib::Value {
760    #[inline]
761    fn from(v: GLSLError) -> Self {
762        skip_assert_initialized!();
763        ToValue::to_value(&v)
764    }
765}
766
767/// GLSL version list
768#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
769#[non_exhaustive]
770#[doc(alias = "GstGLSLVersion")]
771pub enum GLSLVersion {
772    /// no version
773    #[doc(alias = "GST_GLSL_VERSION_NONE")]
774    None,
775    /// version 100 (only valid for ES)
776    #[doc(alias = "GST_GLSL_VERSION_100")]
777    _100,
778    /// version 110 (only valid for compatibility desktop GL)
779    #[doc(alias = "GST_GLSL_VERSION_110")]
780    _110,
781    /// version 120 (only valid for compatibility desktop GL)
782    #[doc(alias = "GST_GLSL_VERSION_120")]
783    _120,
784    /// version 130 (only valid for compatibility desktop GL)
785    #[doc(alias = "GST_GLSL_VERSION_130")]
786    _130,
787    /// version 140 (only valid for compatibility desktop GL)
788    #[doc(alias = "GST_GLSL_VERSION_140")]
789    _140,
790    /// version 150 (valid for compatibility/core desktop GL)
791    #[doc(alias = "GST_GLSL_VERSION_150")]
792    _150,
793    /// version 300 (only valid for ES)
794    #[doc(alias = "GST_GLSL_VERSION_300")]
795    _300,
796    /// version 310 (only valid for ES)
797    #[doc(alias = "GST_GLSL_VERSION_310")]
798    _310,
799    /// version 320 (only valid for ES)
800    #[doc(alias = "GST_GLSL_VERSION_320")]
801    _320,
802    /// version 330 (valid for compatibility/core desktop GL)
803    #[doc(alias = "GST_GLSL_VERSION_330")]
804    _330,
805    /// version 400 (valid for compatibility/core desktop GL)
806    #[doc(alias = "GST_GLSL_VERSION_400")]
807    _400,
808    /// version 410 (valid for compatibility/core desktop GL)
809    #[doc(alias = "GST_GLSL_VERSION_410")]
810    _410,
811    /// version 420 (valid for compatibility/core desktop GL)
812    #[doc(alias = "GST_GLSL_VERSION_420")]
813    _420,
814    /// version 430 (valid for compatibility/core desktop GL)
815    #[doc(alias = "GST_GLSL_VERSION_430")]
816    _430,
817    /// version 440 (valid for compatibility/core desktop GL)
818    #[doc(alias = "GST_GLSL_VERSION_440")]
819    _440,
820    /// version 450 (valid for compatibility/core desktop GL)
821    #[doc(alias = "GST_GLSL_VERSION_450")]
822    _450,
823    #[doc(hidden)]
824    __Unknown(i32),
825}
826
827impl GLSLVersion {
828    #[doc(alias = "gst_glsl_version_from_string")]
829    pub fn from_string(string: &str) -> GLSLVersion {
830        assert_initialized_main_thread!();
831        unsafe { from_glib(ffi::gst_glsl_version_from_string(string.to_glib_none().0)) }
832    }
833
834    #[doc(alias = "gst_glsl_version_profile_from_string")]
835    pub fn profile_from_string(string: &str) -> Option<(GLSLVersion, GLSLProfile)> {
836        assert_initialized_main_thread!();
837        unsafe {
838            let mut version_ret = std::mem::MaybeUninit::uninit();
839            let mut profile_ret = std::mem::MaybeUninit::uninit();
840            let ret = from_glib(ffi::gst_glsl_version_profile_from_string(
841                string.to_glib_none().0,
842                version_ret.as_mut_ptr(),
843                profile_ret.as_mut_ptr(),
844            ));
845            if ret {
846                Some((
847                    from_glib(version_ret.assume_init()),
848                    from_glib(profile_ret.assume_init()),
849                ))
850            } else {
851                None
852            }
853        }
854    }
855
856    #[doc(alias = "gst_glsl_version_profile_to_string")]
857    pub fn profile_to_string(self, profile: GLSLProfile) -> Option<glib::GString> {
858        assert_initialized_main_thread!();
859        unsafe {
860            from_glib_full(ffi::gst_glsl_version_profile_to_string(
861                self.into_glib(),
862                profile.into_glib(),
863            ))
864        }
865    }
866
867    #[doc(alias = "gst_glsl_version_to_string")]
868    #[doc(alias = "to_string")]
869    pub fn to_str(self) -> Option<glib::GString> {
870        assert_initialized_main_thread!();
871        unsafe { from_glib_none(ffi::gst_glsl_version_to_string(self.into_glib())) }
872    }
873}
874
875#[doc(hidden)]
876impl IntoGlib for GLSLVersion {
877    type GlibType = ffi::GstGLSLVersion;
878
879    fn into_glib(self) -> ffi::GstGLSLVersion {
880        match self {
881            Self::None => ffi::GST_GLSL_VERSION_NONE,
882            Self::_100 => ffi::GST_GLSL_VERSION_100,
883            Self::_110 => ffi::GST_GLSL_VERSION_110,
884            Self::_120 => ffi::GST_GLSL_VERSION_120,
885            Self::_130 => ffi::GST_GLSL_VERSION_130,
886            Self::_140 => ffi::GST_GLSL_VERSION_140,
887            Self::_150 => ffi::GST_GLSL_VERSION_150,
888            Self::_300 => ffi::GST_GLSL_VERSION_300,
889            Self::_310 => ffi::GST_GLSL_VERSION_310,
890            Self::_320 => ffi::GST_GLSL_VERSION_320,
891            Self::_330 => ffi::GST_GLSL_VERSION_330,
892            Self::_400 => ffi::GST_GLSL_VERSION_400,
893            Self::_410 => ffi::GST_GLSL_VERSION_410,
894            Self::_420 => ffi::GST_GLSL_VERSION_420,
895            Self::_430 => ffi::GST_GLSL_VERSION_430,
896            Self::_440 => ffi::GST_GLSL_VERSION_440,
897            Self::_450 => ffi::GST_GLSL_VERSION_450,
898            Self::__Unknown(value) => value,
899        }
900    }
901}
902
903#[doc(hidden)]
904impl FromGlib<ffi::GstGLSLVersion> for GLSLVersion {
905    unsafe fn from_glib(value: ffi::GstGLSLVersion) -> Self {
906        skip_assert_initialized!();
907
908        match value {
909            ffi::GST_GLSL_VERSION_NONE => Self::None,
910            ffi::GST_GLSL_VERSION_100 => Self::_100,
911            ffi::GST_GLSL_VERSION_110 => Self::_110,
912            ffi::GST_GLSL_VERSION_120 => Self::_120,
913            ffi::GST_GLSL_VERSION_130 => Self::_130,
914            ffi::GST_GLSL_VERSION_140 => Self::_140,
915            ffi::GST_GLSL_VERSION_150 => Self::_150,
916            ffi::GST_GLSL_VERSION_300 => Self::_300,
917            ffi::GST_GLSL_VERSION_310 => Self::_310,
918            ffi::GST_GLSL_VERSION_320 => Self::_320,
919            ffi::GST_GLSL_VERSION_330 => Self::_330,
920            ffi::GST_GLSL_VERSION_400 => Self::_400,
921            ffi::GST_GLSL_VERSION_410 => Self::_410,
922            ffi::GST_GLSL_VERSION_420 => Self::_420,
923            ffi::GST_GLSL_VERSION_430 => Self::_430,
924            ffi::GST_GLSL_VERSION_440 => Self::_440,
925            ffi::GST_GLSL_VERSION_450 => Self::_450,
926            value => Self::__Unknown(value),
927        }
928    }
929}
930
931impl StaticType for GLSLVersion {
932    #[inline]
933    #[doc(alias = "gst_glsl_version_get_type")]
934    fn static_type() -> glib::Type {
935        unsafe { from_glib(ffi::gst_glsl_version_get_type()) }
936    }
937}
938
939impl glib::HasParamSpec for GLSLVersion {
940    type ParamSpec = glib::ParamSpecEnum;
941    type SetValue = Self;
942    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
943
944    fn param_spec_builder() -> Self::BuilderFn {
945        Self::ParamSpec::builder_with_default
946    }
947}
948
949impl glib::value::ValueType for GLSLVersion {
950    type Type = Self;
951}
952
953unsafe impl<'a> glib::value::FromValue<'a> for GLSLVersion {
954    type Checker = glib::value::GenericValueTypeChecker<Self>;
955
956    #[inline]
957    unsafe fn from_value(value: &'a glib::Value) -> Self {
958        skip_assert_initialized!();
959        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
960    }
961}
962
963impl ToValue for GLSLVersion {
964    #[inline]
965    fn to_value(&self) -> glib::Value {
966        let mut value = glib::Value::for_value_type::<Self>();
967        unsafe {
968            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
969        }
970        value
971    }
972
973    #[inline]
974    fn value_type(&self) -> glib::Type {
975        Self::static_type()
976    }
977}
978
979impl From<GLSLVersion> for glib::Value {
980    #[inline]
981    fn from(v: GLSLVersion) -> Self {
982        skip_assert_initialized!();
983        ToValue::to_value(&v)
984    }
985}
986
987/// Output anaglyph type to generate when downmixing to mono
988#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
989#[non_exhaustive]
990#[doc(alias = "GstGLStereoDownmix")]
991pub enum GLStereoDownmix {
992    /// Dubois optimised Green-Magenta anaglyph
993    #[doc(alias = "GST_GL_STEREO_DOWNMIX_ANAGLYPH_GREEN_MAGENTA_DUBOIS")]
994    GreenMagentaDubois,
995    /// Dubois optimised Red-Cyan anaglyph
996    #[doc(alias = "GST_GL_STEREO_DOWNMIX_ANAGLYPH_RED_CYAN_DUBOIS")]
997    RedCyanDubois,
998    /// Dubois optimised Amber-Blue anaglyph
999    #[doc(alias = "GST_GL_STEREO_DOWNMIX_ANAGLYPH_AMBER_BLUE_DUBOIS")]
1000    AmberBlueDubois,
1001    #[doc(hidden)]
1002    __Unknown(i32),
1003}
1004
1005#[doc(hidden)]
1006impl IntoGlib for GLStereoDownmix {
1007    type GlibType = ffi::GstGLStereoDownmix;
1008
1009    #[inline]
1010    fn into_glib(self) -> ffi::GstGLStereoDownmix {
1011        match self {
1012            Self::GreenMagentaDubois => ffi::GST_GL_STEREO_DOWNMIX_ANAGLYPH_GREEN_MAGENTA_DUBOIS,
1013            Self::RedCyanDubois => ffi::GST_GL_STEREO_DOWNMIX_ANAGLYPH_RED_CYAN_DUBOIS,
1014            Self::AmberBlueDubois => ffi::GST_GL_STEREO_DOWNMIX_ANAGLYPH_AMBER_BLUE_DUBOIS,
1015            Self::__Unknown(value) => value,
1016        }
1017    }
1018}
1019
1020#[doc(hidden)]
1021impl FromGlib<ffi::GstGLStereoDownmix> for GLStereoDownmix {
1022    #[inline]
1023    unsafe fn from_glib(value: ffi::GstGLStereoDownmix) -> Self {
1024        skip_assert_initialized!();
1025
1026        match value {
1027            ffi::GST_GL_STEREO_DOWNMIX_ANAGLYPH_GREEN_MAGENTA_DUBOIS => Self::GreenMagentaDubois,
1028            ffi::GST_GL_STEREO_DOWNMIX_ANAGLYPH_RED_CYAN_DUBOIS => Self::RedCyanDubois,
1029            ffi::GST_GL_STEREO_DOWNMIX_ANAGLYPH_AMBER_BLUE_DUBOIS => Self::AmberBlueDubois,
1030            value => Self::__Unknown(value),
1031        }
1032    }
1033}
1034
1035impl StaticType for GLStereoDownmix {
1036    #[inline]
1037    #[doc(alias = "gst_gl_stereo_downmix_get_type")]
1038    fn static_type() -> glib::Type {
1039        unsafe { from_glib(ffi::gst_gl_stereo_downmix_get_type()) }
1040    }
1041}
1042
1043impl glib::HasParamSpec for GLStereoDownmix {
1044    type ParamSpec = glib::ParamSpecEnum;
1045    type SetValue = Self;
1046    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1047
1048    fn param_spec_builder() -> Self::BuilderFn {
1049        Self::ParamSpec::builder_with_default
1050    }
1051}
1052
1053impl glib::value::ValueType for GLStereoDownmix {
1054    type Type = Self;
1055}
1056
1057unsafe impl<'a> glib::value::FromValue<'a> for GLStereoDownmix {
1058    type Checker = glib::value::GenericValueTypeChecker<Self>;
1059
1060    #[inline]
1061    unsafe fn from_value(value: &'a glib::Value) -> Self {
1062        skip_assert_initialized!();
1063        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1064    }
1065}
1066
1067impl ToValue for GLStereoDownmix {
1068    #[inline]
1069    fn to_value(&self) -> glib::Value {
1070        let mut value = glib::Value::for_value_type::<Self>();
1071        unsafe {
1072            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1073        }
1074        value
1075    }
1076
1077    #[inline]
1078    fn value_type(&self) -> glib::Type {
1079        Self::static_type()
1080    }
1081}
1082
1083impl From<GLStereoDownmix> for glib::Value {
1084    #[inline]
1085    fn from(v: GLStereoDownmix) -> Self {
1086        skip_assert_initialized!();
1087        ToValue::to_value(&v)
1088    }
1089}
1090
1091/// The OpenGL texture target that an OpenGL texture can be bound to. The
1092/// `gst_gl_value_set_texture_target_from_mask()`,
1093/// `gst_gl_value_get_texture_target_mask()`, and
1094/// `gst_gl_value_set_texture_target()` functions can be used for handling texture
1095/// targets with [`glib::Value`][crate::glib::Value]'s when e.g. dealing with [`gst::Caps`][crate::gst::Caps].
1096#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1097#[non_exhaustive]
1098#[doc(alias = "GstGLTextureTarget")]
1099pub enum GLTextureTarget {
1100    /// no texture target
1101    #[doc(alias = "GST_GL_TEXTURE_TARGET_NONE")]
1102    None,
1103    /// 2D texture target (`GL_TEXTURE_2D`)
1104    #[doc(alias = "GST_GL_TEXTURE_TARGET_2D")]
1105    _2d,
1106    /// rectangle texture target
1107    ///  (`GL_TEXTURE_RECTANGLE`)
1108    #[doc(alias = "GST_GL_TEXTURE_TARGET_RECTANGLE")]
1109    Rectangle,
1110    /// external oes texture target
1111    ///  (`GL_TEXTURE_EXTERNAL_OES`)
1112    #[doc(alias = "GST_GL_TEXTURE_TARGET_EXTERNAL_OES")]
1113    ExternalOes,
1114    #[doc(hidden)]
1115    __Unknown(i32),
1116}
1117
1118impl GLTextureTarget {
1119    #[doc(alias = "gst_gl_texture_target_from_gl")]
1120    pub fn from_gl(target: u32) -> GLTextureTarget {
1121        assert_initialized_main_thread!();
1122        unsafe { from_glib(ffi::gst_gl_texture_target_from_gl(target)) }
1123    }
1124
1125    #[doc(alias = "gst_gl_texture_target_from_string")]
1126    pub fn from_string(str: &str) -> GLTextureTarget {
1127        assert_initialized_main_thread!();
1128        unsafe { from_glib(ffi::gst_gl_texture_target_from_string(str.to_glib_none().0)) }
1129    }
1130
1131    #[doc(alias = "gst_gl_texture_target_to_buffer_pool_option")]
1132    pub fn to_buffer_pool_option(self) -> Option<glib::GString> {
1133        assert_initialized_main_thread!();
1134        unsafe {
1135            from_glib_none(ffi::gst_gl_texture_target_to_buffer_pool_option(
1136                self.into_glib(),
1137            ))
1138        }
1139    }
1140
1141    #[doc(alias = "gst_gl_texture_target_to_gl")]
1142    pub fn to_gl(self) -> u32 {
1143        assert_initialized_main_thread!();
1144        unsafe { ffi::gst_gl_texture_target_to_gl(self.into_glib()) }
1145    }
1146
1147    #[doc(alias = "gst_gl_texture_target_to_string")]
1148    #[doc(alias = "to_string")]
1149    pub fn to_str(self) -> Option<glib::GString> {
1150        assert_initialized_main_thread!();
1151        unsafe { from_glib_none(ffi::gst_gl_texture_target_to_string(self.into_glib())) }
1152    }
1153}
1154
1155#[doc(hidden)]
1156impl IntoGlib for GLTextureTarget {
1157    type GlibType = ffi::GstGLTextureTarget;
1158
1159    #[inline]
1160    fn into_glib(self) -> ffi::GstGLTextureTarget {
1161        match self {
1162            Self::None => ffi::GST_GL_TEXTURE_TARGET_NONE,
1163            Self::_2d => ffi::GST_GL_TEXTURE_TARGET_2D,
1164            Self::Rectangle => ffi::GST_GL_TEXTURE_TARGET_RECTANGLE,
1165            Self::ExternalOes => ffi::GST_GL_TEXTURE_TARGET_EXTERNAL_OES,
1166            Self::__Unknown(value) => value,
1167        }
1168    }
1169}
1170
1171#[doc(hidden)]
1172impl FromGlib<ffi::GstGLTextureTarget> for GLTextureTarget {
1173    #[inline]
1174    unsafe fn from_glib(value: ffi::GstGLTextureTarget) -> Self {
1175        skip_assert_initialized!();
1176
1177        match value {
1178            ffi::GST_GL_TEXTURE_TARGET_NONE => Self::None,
1179            ffi::GST_GL_TEXTURE_TARGET_2D => Self::_2d,
1180            ffi::GST_GL_TEXTURE_TARGET_RECTANGLE => Self::Rectangle,
1181            ffi::GST_GL_TEXTURE_TARGET_EXTERNAL_OES => Self::ExternalOes,
1182            value => Self::__Unknown(value),
1183        }
1184    }
1185}
1186
1187impl StaticType for GLTextureTarget {
1188    #[inline]
1189    #[doc(alias = "gst_gl_texture_target_get_type")]
1190    fn static_type() -> glib::Type {
1191        unsafe { from_glib(ffi::gst_gl_texture_target_get_type()) }
1192    }
1193}
1194
1195impl glib::HasParamSpec for GLTextureTarget {
1196    type ParamSpec = glib::ParamSpecEnum;
1197    type SetValue = Self;
1198    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1199
1200    fn param_spec_builder() -> Self::BuilderFn {
1201        Self::ParamSpec::builder_with_default
1202    }
1203}
1204
1205impl glib::value::ValueType for GLTextureTarget {
1206    type Type = Self;
1207}
1208
1209unsafe impl<'a> glib::value::FromValue<'a> for GLTextureTarget {
1210    type Checker = glib::value::GenericValueTypeChecker<Self>;
1211
1212    #[inline]
1213    unsafe fn from_value(value: &'a glib::Value) -> Self {
1214        skip_assert_initialized!();
1215        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1216    }
1217}
1218
1219impl ToValue for GLTextureTarget {
1220    #[inline]
1221    fn to_value(&self) -> glib::Value {
1222        let mut value = glib::Value::for_value_type::<Self>();
1223        unsafe {
1224            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1225        }
1226        value
1227    }
1228
1229    #[inline]
1230    fn value_type(&self) -> glib::Type {
1231        Self::static_type()
1232    }
1233}
1234
1235impl From<GLTextureTarget> for glib::Value {
1236    #[inline]
1237    fn from(v: GLTextureTarget) -> Self {
1238        skip_assert_initialized!();
1239        ToValue::to_value(&v)
1240    }
1241}
1242
1243#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1244#[non_exhaustive]
1245#[doc(alias = "GstGLUploadReturn")]
1246pub enum GLUploadReturn {
1247    /// No further processing required
1248    #[doc(alias = "GST_GL_UPLOAD_DONE")]
1249    Done,
1250    /// An unspecified error occurred
1251    #[doc(alias = "GST_GL_UPLOAD_ERROR")]
1252    Error,
1253    /// The configuration is unsupported.
1254    #[doc(alias = "GST_GL_UPLOAD_UNSUPPORTED")]
1255    Unsupported,
1256    /// This element requires a reconfiguration.
1257    #[doc(alias = "GST_GL_UPLOAD_RECONFIGURE")]
1258    Reconfigure,
1259    /// private return value.
1260    #[doc(alias = "GST_GL_UPLOAD_UNSHARED_GL_CONTEXT")]
1261    UnsharedGlContext,
1262    #[doc(hidden)]
1263    __Unknown(i32),
1264}
1265
1266#[doc(hidden)]
1267impl IntoGlib for GLUploadReturn {
1268    type GlibType = ffi::GstGLUploadReturn;
1269
1270    #[inline]
1271    fn into_glib(self) -> ffi::GstGLUploadReturn {
1272        match self {
1273            Self::Done => ffi::GST_GL_UPLOAD_DONE,
1274            Self::Error => ffi::GST_GL_UPLOAD_ERROR,
1275            Self::Unsupported => ffi::GST_GL_UPLOAD_UNSUPPORTED,
1276            Self::Reconfigure => ffi::GST_GL_UPLOAD_RECONFIGURE,
1277            Self::UnsharedGlContext => ffi::GST_GL_UPLOAD_UNSHARED_GL_CONTEXT,
1278            Self::__Unknown(value) => value,
1279        }
1280    }
1281}
1282
1283#[doc(hidden)]
1284impl FromGlib<ffi::GstGLUploadReturn> for GLUploadReturn {
1285    #[inline]
1286    unsafe fn from_glib(value: ffi::GstGLUploadReturn) -> Self {
1287        skip_assert_initialized!();
1288
1289        match value {
1290            ffi::GST_GL_UPLOAD_DONE => Self::Done,
1291            ffi::GST_GL_UPLOAD_ERROR => Self::Error,
1292            ffi::GST_GL_UPLOAD_UNSUPPORTED => Self::Unsupported,
1293            ffi::GST_GL_UPLOAD_RECONFIGURE => Self::Reconfigure,
1294            ffi::GST_GL_UPLOAD_UNSHARED_GL_CONTEXT => Self::UnsharedGlContext,
1295            value => Self::__Unknown(value),
1296        }
1297    }
1298}
1299
1300impl StaticType for GLUploadReturn {
1301    #[inline]
1302    #[doc(alias = "gst_gl_upload_return_get_type")]
1303    fn static_type() -> glib::Type {
1304        unsafe { from_glib(ffi::gst_gl_upload_return_get_type()) }
1305    }
1306}
1307
1308impl glib::HasParamSpec for GLUploadReturn {
1309    type ParamSpec = glib::ParamSpecEnum;
1310    type SetValue = Self;
1311    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1312
1313    fn param_spec_builder() -> Self::BuilderFn {
1314        Self::ParamSpec::builder_with_default
1315    }
1316}
1317
1318impl glib::value::ValueType for GLUploadReturn {
1319    type Type = Self;
1320}
1321
1322unsafe impl<'a> glib::value::FromValue<'a> for GLUploadReturn {
1323    type Checker = glib::value::GenericValueTypeChecker<Self>;
1324
1325    #[inline]
1326    unsafe fn from_value(value: &'a glib::Value) -> Self {
1327        skip_assert_initialized!();
1328        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1329    }
1330}
1331
1332impl ToValue for GLUploadReturn {
1333    #[inline]
1334    fn to_value(&self) -> glib::Value {
1335        let mut value = glib::Value::for_value_type::<Self>();
1336        unsafe {
1337            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1338        }
1339        value
1340    }
1341
1342    #[inline]
1343    fn value_type(&self) -> glib::Type {
1344        Self::static_type()
1345    }
1346}
1347
1348impl From<GLUploadReturn> for glib::Value {
1349    #[inline]
1350    fn from(v: GLUploadReturn) -> Self {
1351        skip_assert_initialized!();
1352        ToValue::to_value(&v)
1353    }
1354}
1355
1356#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1357#[non_exhaustive]
1358#[doc(alias = "GstGLWindowError")]
1359pub enum GLWindowError {
1360    /// failed for a unspecified reason
1361    #[doc(alias = "GST_GL_WINDOW_ERROR_FAILED")]
1362    Failed,
1363    /// the implementation is too old
1364    #[doc(alias = "GST_GL_WINDOW_ERROR_OLD_LIBS")]
1365    OldLibs,
1366    /// no such resource was found
1367    #[doc(alias = "GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE")]
1368    ResourceUnavailable,
1369    #[doc(hidden)]
1370    __Unknown(i32),
1371}
1372
1373#[doc(hidden)]
1374impl IntoGlib for GLWindowError {
1375    type GlibType = ffi::GstGLWindowError;
1376
1377    #[inline]
1378    fn into_glib(self) -> ffi::GstGLWindowError {
1379        match self {
1380            Self::Failed => ffi::GST_GL_WINDOW_ERROR_FAILED,
1381            Self::OldLibs => ffi::GST_GL_WINDOW_ERROR_OLD_LIBS,
1382            Self::ResourceUnavailable => ffi::GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE,
1383            Self::__Unknown(value) => value,
1384        }
1385    }
1386}
1387
1388#[doc(hidden)]
1389impl FromGlib<ffi::GstGLWindowError> for GLWindowError {
1390    #[inline]
1391    unsafe fn from_glib(value: ffi::GstGLWindowError) -> Self {
1392        skip_assert_initialized!();
1393
1394        match value {
1395            ffi::GST_GL_WINDOW_ERROR_FAILED => Self::Failed,
1396            ffi::GST_GL_WINDOW_ERROR_OLD_LIBS => Self::OldLibs,
1397            ffi::GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE => Self::ResourceUnavailable,
1398            value => Self::__Unknown(value),
1399        }
1400    }
1401}
1402
1403impl glib::error::ErrorDomain for GLWindowError {
1404    #[inline]
1405    fn domain() -> glib::Quark {
1406        skip_assert_initialized!();
1407
1408        unsafe { from_glib(ffi::gst_gl_window_error_quark()) }
1409    }
1410
1411    #[inline]
1412    fn code(self) -> i32 {
1413        self.into_glib()
1414    }
1415
1416    #[inline]
1417    #[allow(clippy::match_single_binding)]
1418    fn from(code: i32) -> Option<Self> {
1419        skip_assert_initialized!();
1420        match unsafe { from_glib(code) } {
1421            Self::__Unknown(_) => Some(Self::Failed),
1422            value => Some(value),
1423        }
1424    }
1425}
1426
1427impl StaticType for GLWindowError {
1428    #[inline]
1429    #[doc(alias = "gst_gl_window_error_get_type")]
1430    fn static_type() -> glib::Type {
1431        unsafe { from_glib(ffi::gst_gl_window_error_get_type()) }
1432    }
1433}
1434
1435impl glib::HasParamSpec for GLWindowError {
1436    type ParamSpec = glib::ParamSpecEnum;
1437    type SetValue = Self;
1438    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1439
1440    fn param_spec_builder() -> Self::BuilderFn {
1441        Self::ParamSpec::builder_with_default
1442    }
1443}
1444
1445impl glib::value::ValueType for GLWindowError {
1446    type Type = Self;
1447}
1448
1449unsafe impl<'a> glib::value::FromValue<'a> for GLWindowError {
1450    type Checker = glib::value::GenericValueTypeChecker<Self>;
1451
1452    #[inline]
1453    unsafe fn from_value(value: &'a glib::Value) -> Self {
1454        skip_assert_initialized!();
1455        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1456    }
1457}
1458
1459impl ToValue for GLWindowError {
1460    #[inline]
1461    fn to_value(&self) -> glib::Value {
1462        let mut value = glib::Value::for_value_type::<Self>();
1463        unsafe {
1464            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1465        }
1466        value
1467    }
1468
1469    #[inline]
1470    fn value_type(&self) -> glib::Type {
1471        Self::static_type()
1472    }
1473}
1474
1475impl From<GLWindowError> for glib::Value {
1476    #[inline]
1477    fn from(v: GLWindowError) -> Self {
1478        skip_assert_initialized!();
1479        ToValue::to_value(&v)
1480    }
1481}