2018-11-27 21:52:42 +00:00
|
|
|
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
|
|
|
// from gir-files (https://github.com/gtk-rs/gir-files)
|
2021-04-01 13:58:41 +00:00
|
|
|
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
2018-11-27 21:52:42 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
2020-12-07 11:11:04 +00:00
|
|
|
use crate::GLContext;
|
|
|
|
use crate::GLSLProfile;
|
2018-11-27 21:52:42 +00:00
|
|
|
use glib::error::ErrorDomain;
|
2020-12-07 11:11:04 +00:00
|
|
|
use glib::object::IsA;
|
2018-11-27 21:52:42 +00:00
|
|
|
use glib::translate::*;
|
|
|
|
use glib::value::FromValue;
|
2021-04-19 16:24:43 +00:00
|
|
|
use glib::value::ToValue;
|
2019-06-18 10:12:00 +00:00
|
|
|
use glib::Quark;
|
|
|
|
use glib::StaticType;
|
|
|
|
use glib::Type;
|
2020-12-07 11:11:04 +00:00
|
|
|
use std::mem;
|
2018-11-27 21:52:42 +00:00
|
|
|
|
2021-04-17 10:11:52 +00:00
|
|
|
#[cfg(any(feature = "v1_20", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
|
|
|
|
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
|
|
|
#[non_exhaustive]
|
|
|
|
#[doc(alias = "GstGLConfigCaveat")]
|
|
|
|
pub enum GLConfigCaveat {
|
|
|
|
#[doc(alias = "GST_GL_CONFIG_CAVEAT_NONE")]
|
|
|
|
None,
|
|
|
|
#[doc(alias = "GST_GL_CONFIG_CAVEAT_SLOW")]
|
|
|
|
Slow,
|
|
|
|
#[doc(alias = "GST_GL_CONFIG_CAVEAT_NON_CONFORMANT")]
|
|
|
|
NonConformant,
|
|
|
|
#[doc(hidden)]
|
|
|
|
__Unknown(i32),
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(any(feature = "v1_20", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
|
|
|
|
impl GLConfigCaveat {
|
|
|
|
#[doc(alias = "gst_gl_config_caveat_to_string")]
|
|
|
|
#[doc(alias = "to_string")]
|
|
|
|
pub fn to_str(self) -> Option<glib::GString> {
|
|
|
|
assert_initialized_main_thread!();
|
|
|
|
unsafe { from_glib_none(ffi::gst_gl_config_caveat_to_string(self.into_glib())) }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(any(feature = "v1_20", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
|
|
|
|
#[doc(hidden)]
|
|
|
|
impl IntoGlib for GLConfigCaveat {
|
|
|
|
type GlibType = ffi::GstGLConfigCaveat;
|
|
|
|
|
|
|
|
fn into_glib(self) -> ffi::GstGLConfigCaveat {
|
|
|
|
match self {
|
|
|
|
Self::None => ffi::GST_GL_CONFIG_CAVEAT_NONE,
|
|
|
|
Self::Slow => ffi::GST_GL_CONFIG_CAVEAT_SLOW,
|
|
|
|
Self::NonConformant => ffi::GST_GL_CONFIG_CAVEAT_NON_CONFORMANT,
|
|
|
|
Self::__Unknown(value) => value,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(any(feature = "v1_20", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
|
|
|
|
#[doc(hidden)]
|
|
|
|
impl FromGlib<ffi::GstGLConfigCaveat> for GLConfigCaveat {
|
|
|
|
unsafe fn from_glib(value: ffi::GstGLConfigCaveat) -> Self {
|
|
|
|
skip_assert_initialized!();
|
|
|
|
match value {
|
|
|
|
ffi::GST_GL_CONFIG_CAVEAT_NONE => Self::None,
|
|
|
|
ffi::GST_GL_CONFIG_CAVEAT_SLOW => Self::Slow,
|
|
|
|
ffi::GST_GL_CONFIG_CAVEAT_NON_CONFORMANT => Self::NonConformant,
|
|
|
|
value => Self::__Unknown(value),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(any(feature = "v1_20", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
|
|
|
|
impl StaticType for GLConfigCaveat {
|
|
|
|
fn static_type() -> Type {
|
|
|
|
unsafe { from_glib(ffi::gst_gl_config_caveat_get_type()) }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(any(feature = "v1_20", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
|
|
|
|
impl glib::value::ValueType for GLConfigCaveat {
|
|
|
|
type Type = Self;
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(any(feature = "v1_20", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
|
|
|
|
unsafe impl<'a> FromValue<'a> for GLConfigCaveat {
|
|
|
|
type Checker = glib::value::GenericValueTypeChecker<Self>;
|
|
|
|
|
|
|
|
unsafe fn from_value(value: &'a glib::Value) -> Self {
|
|
|
|
skip_assert_initialized!();
|
|
|
|
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(any(feature = "v1_20", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
|
|
|
|
impl ToValue for GLConfigCaveat {
|
|
|
|
fn to_value(&self) -> glib::Value {
|
|
|
|
let mut value = glib::Value::for_value_type::<Self>();
|
|
|
|
unsafe {
|
|
|
|
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
|
|
|
|
}
|
|
|
|
value
|
|
|
|
}
|
|
|
|
|
|
|
|
fn value_type(&self) -> glib::Type {
|
|
|
|
Self::static_type()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
2020-04-12 15:55:06 +00:00
|
|
|
#[non_exhaustive]
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GstGLContextError")]
|
2018-11-27 21:52:42 +00:00
|
|
|
pub enum GLContextError {
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_CONTEXT_ERROR_FAILED")]
|
2018-11-27 21:52:42 +00:00
|
|
|
Failed,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_CONTEXT_ERROR_WRONG_CONFIG")]
|
2018-11-27 21:52:42 +00:00
|
|
|
WrongConfig,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_CONTEXT_ERROR_WRONG_API")]
|
2018-11-27 21:52:42 +00:00
|
|
|
WrongApi,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_CONTEXT_ERROR_OLD_LIBS")]
|
2018-11-27 21:52:42 +00:00
|
|
|
OldLibs,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_CONTEXT_ERROR_CREATE_CONTEXT")]
|
2018-11-27 21:52:42 +00:00
|
|
|
CreateContext,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_CONTEXT_ERROR_RESOURCE_UNAVAILABLE")]
|
2018-11-27 21:52:42 +00:00
|
|
|
ResourceUnavailable,
|
|
|
|
#[doc(hidden)]
|
|
|
|
__Unknown(i32),
|
|
|
|
}
|
|
|
|
|
|
|
|
#[doc(hidden)]
|
2021-04-27 15:10:39 +00:00
|
|
|
impl IntoGlib for GLContextError {
|
2020-11-22 10:20:20 +00:00
|
|
|
type GlibType = ffi::GstGLContextError;
|
2018-11-27 21:52:42 +00:00
|
|
|
|
2021-04-27 15:10:39 +00:00
|
|
|
fn into_glib(self) -> ffi::GstGLContextError {
|
|
|
|
match self {
|
2021-04-25 16:45:59 +00:00
|
|
|
Self::Failed => ffi::GST_GL_CONTEXT_ERROR_FAILED,
|
|
|
|
Self::WrongConfig => ffi::GST_GL_CONTEXT_ERROR_WRONG_CONFIG,
|
|
|
|
Self::WrongApi => ffi::GST_GL_CONTEXT_ERROR_WRONG_API,
|
|
|
|
Self::OldLibs => ffi::GST_GL_CONTEXT_ERROR_OLD_LIBS,
|
|
|
|
Self::CreateContext => ffi::GST_GL_CONTEXT_ERROR_CREATE_CONTEXT,
|
|
|
|
Self::ResourceUnavailable => ffi::GST_GL_CONTEXT_ERROR_RESOURCE_UNAVAILABLE,
|
|
|
|
Self::__Unknown(value) => value,
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[doc(hidden)]
|
2020-11-22 10:20:20 +00:00
|
|
|
impl FromGlib<ffi::GstGLContextError> for GLContextError {
|
2020-12-08 13:00:17 +00:00
|
|
|
unsafe fn from_glib(value: ffi::GstGLContextError) -> Self {
|
2018-11-27 21:52:42 +00:00
|
|
|
skip_assert_initialized!();
|
|
|
|
match value {
|
2021-05-23 16:27:13 +00:00
|
|
|
ffi::GST_GL_CONTEXT_ERROR_FAILED => Self::Failed,
|
|
|
|
ffi::GST_GL_CONTEXT_ERROR_WRONG_CONFIG => Self::WrongConfig,
|
|
|
|
ffi::GST_GL_CONTEXT_ERROR_WRONG_API => Self::WrongApi,
|
|
|
|
ffi::GST_GL_CONTEXT_ERROR_OLD_LIBS => Self::OldLibs,
|
|
|
|
ffi::GST_GL_CONTEXT_ERROR_CREATE_CONTEXT => Self::CreateContext,
|
|
|
|
ffi::GST_GL_CONTEXT_ERROR_RESOURCE_UNAVAILABLE => Self::ResourceUnavailable,
|
2021-04-25 16:45:59 +00:00
|
|
|
value => Self::__Unknown(value),
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ErrorDomain for GLContextError {
|
|
|
|
fn domain() -> Quark {
|
|
|
|
skip_assert_initialized!();
|
2020-10-31 07:36:53 +00:00
|
|
|
|
2020-11-22 10:20:20 +00:00
|
|
|
unsafe { from_glib(ffi::gst_gl_context_error_quark()) }
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn code(self) -> i32 {
|
2021-04-27 15:10:39 +00:00
|
|
|
self.into_glib()
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn from(code: i32) -> Option<Self> {
|
|
|
|
skip_assert_initialized!();
|
|
|
|
match code {
|
2021-05-23 16:27:13 +00:00
|
|
|
ffi::GST_GL_CONTEXT_ERROR_FAILED => Some(Self::Failed),
|
|
|
|
ffi::GST_GL_CONTEXT_ERROR_WRONG_CONFIG => Some(Self::WrongConfig),
|
|
|
|
ffi::GST_GL_CONTEXT_ERROR_WRONG_API => Some(Self::WrongApi),
|
|
|
|
ffi::GST_GL_CONTEXT_ERROR_OLD_LIBS => Some(Self::OldLibs),
|
|
|
|
ffi::GST_GL_CONTEXT_ERROR_CREATE_CONTEXT => Some(Self::CreateContext),
|
|
|
|
ffi::GST_GL_CONTEXT_ERROR_RESOURCE_UNAVAILABLE => Some(Self::ResourceUnavailable),
|
2021-04-25 16:45:59 +00:00
|
|
|
_ => Some(Self::Failed),
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-23 14:32:09 +00:00
|
|
|
impl StaticType for GLContextError {
|
|
|
|
fn static_type() -> Type {
|
2020-11-22 10:20:20 +00:00
|
|
|
unsafe { from_glib(ffi::gst_gl_context_error_get_type()) }
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
impl glib::value::ValueType for GLContextError {
|
|
|
|
type Type = Self;
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
unsafe impl<'a> FromValue<'a> for GLContextError {
|
|
|
|
type Checker = glib::value::GenericValueTypeChecker<Self>;
|
|
|
|
|
|
|
|
unsafe fn from_value(value: &'a glib::Value) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2020-11-22 10:20:20 +00:00
|
|
|
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
impl ToValue for GLContextError {
|
|
|
|
fn to_value(&self) -> glib::Value {
|
2021-04-25 16:45:59 +00:00
|
|
|
let mut value = glib::Value::for_value_type::<Self>();
|
2021-04-19 16:24:43 +00:00
|
|
|
unsafe {
|
2021-04-27 15:10:39 +00:00
|
|
|
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
|
2021-04-19 16:24:43 +00:00
|
|
|
}
|
|
|
|
value
|
|
|
|
}
|
|
|
|
|
|
|
|
fn value_type(&self) -> glib::Type {
|
|
|
|
Self::static_type()
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
2020-04-12 15:55:06 +00:00
|
|
|
#[non_exhaustive]
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GstGLFormat")]
|
2018-11-27 21:52:42 +00:00
|
|
|
pub enum GLFormat {
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_LUMINANCE")]
|
2018-11-27 21:52:42 +00:00
|
|
|
Luminance,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_ALPHA")]
|
2018-11-27 21:52:42 +00:00
|
|
|
Alpha,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_LUMINANCE_ALPHA")]
|
2018-11-27 21:52:42 +00:00
|
|
|
LuminanceAlpha,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_RED")]
|
2018-11-27 21:52:42 +00:00
|
|
|
Red,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_R8")]
|
2018-11-27 21:52:42 +00:00
|
|
|
R8,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_RG")]
|
2018-11-27 21:52:42 +00:00
|
|
|
Rg,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_RG8")]
|
2018-11-27 21:52:42 +00:00
|
|
|
Rg8,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_RGB")]
|
2018-11-27 21:52:42 +00:00
|
|
|
Rgb,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_RGB8")]
|
2018-11-27 21:52:42 +00:00
|
|
|
Rgb8,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_RGB565")]
|
2018-11-27 21:52:42 +00:00
|
|
|
Rgb565,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_RGB16")]
|
2019-04-23 14:32:09 +00:00
|
|
|
Rgb16,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_RGBA")]
|
2018-11-27 21:52:42 +00:00
|
|
|
Rgba,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_RGBA8")]
|
2018-11-27 21:52:42 +00:00
|
|
|
Rgba8,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_RGBA16")]
|
2019-04-23 14:32:09 +00:00
|
|
|
Rgba16,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_DEPTH_COMPONENT16")]
|
2018-11-27 21:52:42 +00:00
|
|
|
DepthComponent16,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_DEPTH24_STENCIL8")]
|
2018-11-27 21:52:42 +00:00
|
|
|
Depth24Stencil8,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_RGB10_A2")]
|
2020-04-30 16:51:41 +00:00
|
|
|
Rgb10A2,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_R16")]
|
2020-04-30 16:51:41 +00:00
|
|
|
R16,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_RG16")]
|
2020-04-30 16:51:41 +00:00
|
|
|
Rg16,
|
2018-11-27 21:52:42 +00:00
|
|
|
#[doc(hidden)]
|
|
|
|
__Unknown(i32),
|
|
|
|
}
|
|
|
|
|
2020-12-07 11:11:04 +00:00
|
|
|
impl GLFormat {
|
2021-01-29 21:12:00 +00:00
|
|
|
#[doc(alias = "gst_gl_format_from_video_info")]
|
2021-05-23 19:22:45 +00:00
|
|
|
pub fn from_video_info(
|
|
|
|
context: &impl IsA<GLContext>,
|
2021-01-29 21:12:00 +00:00
|
|
|
vinfo: &gst_video::VideoInfo,
|
|
|
|
plane: u32,
|
|
|
|
) -> GLFormat {
|
|
|
|
skip_assert_initialized!();
|
|
|
|
unsafe {
|
|
|
|
from_glib(ffi::gst_gl_format_from_video_info(
|
|
|
|
context.as_ref().to_glib_none().0,
|
2021-04-17 10:11:52 +00:00
|
|
|
vinfo.to_glib_none().0,
|
2021-01-29 21:12:00 +00:00
|
|
|
plane,
|
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
2020-12-07 11:11:04 +00:00
|
|
|
|
|
|
|
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_gl_format_is_supported")]
|
2021-05-23 19:22:45 +00:00
|
|
|
pub fn is_supported(context: &impl IsA<GLContext>, format: GLFormat) -> bool {
|
2020-12-07 11:11:04 +00:00
|
|
|
skip_assert_initialized!();
|
|
|
|
unsafe {
|
|
|
|
from_glib(ffi::gst_gl_format_is_supported(
|
|
|
|
context.as_ref().to_glib_none().0,
|
2021-04-27 15:10:39 +00:00
|
|
|
format.into_glib(),
|
2020-12-07 11:11:04 +00:00
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_gl_format_type_from_sized_gl_format")]
|
2020-12-07 11:11:04 +00:00
|
|
|
pub fn type_from_sized_gl_format(self) -> (GLFormat, u32) {
|
|
|
|
assert_initialized_main_thread!();
|
|
|
|
unsafe {
|
|
|
|
let mut unsized_format = mem::MaybeUninit::uninit();
|
|
|
|
let mut gl_type = mem::MaybeUninit::uninit();
|
|
|
|
ffi::gst_gl_format_type_from_sized_gl_format(
|
2021-04-27 15:10:39 +00:00
|
|
|
self.into_glib(),
|
2020-12-07 11:11:04 +00:00
|
|
|
unsized_format.as_mut_ptr(),
|
|
|
|
gl_type.as_mut_ptr(),
|
|
|
|
);
|
|
|
|
let unsized_format = unsized_format.assume_init();
|
|
|
|
let gl_type = gl_type.assume_init();
|
|
|
|
(from_glib(unsized_format), gl_type)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_gl_format_type_n_bytes")]
|
2020-12-07 11:11:04 +00:00
|
|
|
pub fn type_n_bytes(format: u32, type_: u32) -> u32 {
|
|
|
|
assert_initialized_main_thread!();
|
|
|
|
unsafe { ffi::gst_gl_format_type_n_bytes(format, type_) }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-27 21:52:42 +00:00
|
|
|
#[doc(hidden)]
|
2021-04-27 15:10:39 +00:00
|
|
|
impl IntoGlib for GLFormat {
|
2020-11-22 10:20:20 +00:00
|
|
|
type GlibType = ffi::GstGLFormat;
|
2018-11-27 21:52:42 +00:00
|
|
|
|
2021-04-27 15:10:39 +00:00
|
|
|
fn into_glib(self) -> ffi::GstGLFormat {
|
|
|
|
match self {
|
2021-04-25 16:45:59 +00:00
|
|
|
Self::Luminance => ffi::GST_GL_LUMINANCE,
|
|
|
|
Self::Alpha => ffi::GST_GL_ALPHA,
|
|
|
|
Self::LuminanceAlpha => ffi::GST_GL_LUMINANCE_ALPHA,
|
|
|
|
Self::Red => ffi::GST_GL_RED,
|
|
|
|
Self::R8 => ffi::GST_GL_R8,
|
|
|
|
Self::Rg => ffi::GST_GL_RG,
|
|
|
|
Self::Rg8 => ffi::GST_GL_RG8,
|
|
|
|
Self::Rgb => ffi::GST_GL_RGB,
|
|
|
|
Self::Rgb8 => ffi::GST_GL_RGB8,
|
|
|
|
Self::Rgb565 => ffi::GST_GL_RGB565,
|
|
|
|
Self::Rgb16 => ffi::GST_GL_RGB16,
|
|
|
|
Self::Rgba => ffi::GST_GL_RGBA,
|
|
|
|
Self::Rgba8 => ffi::GST_GL_RGBA8,
|
|
|
|
Self::Rgba16 => ffi::GST_GL_RGBA16,
|
|
|
|
Self::DepthComponent16 => ffi::GST_GL_DEPTH_COMPONENT16,
|
|
|
|
Self::Depth24Stencil8 => ffi::GST_GL_DEPTH24_STENCIL8,
|
|
|
|
Self::Rgb10A2 => ffi::GST_GL_RGB10_A2,
|
|
|
|
Self::R16 => ffi::GST_GL_R16,
|
|
|
|
Self::Rg16 => ffi::GST_GL_RG16,
|
|
|
|
Self::__Unknown(value) => value,
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[doc(hidden)]
|
2020-11-22 10:20:20 +00:00
|
|
|
impl FromGlib<ffi::GstGLFormat> for GLFormat {
|
2020-12-08 13:00:17 +00:00
|
|
|
unsafe fn from_glib(value: ffi::GstGLFormat) -> Self {
|
2018-11-27 21:52:42 +00:00
|
|
|
skip_assert_initialized!();
|
|
|
|
match value {
|
2021-05-23 16:27:13 +00:00
|
|
|
ffi::GST_GL_LUMINANCE => Self::Luminance,
|
|
|
|
ffi::GST_GL_ALPHA => Self::Alpha,
|
|
|
|
ffi::GST_GL_LUMINANCE_ALPHA => Self::LuminanceAlpha,
|
|
|
|
ffi::GST_GL_RED => Self::Red,
|
|
|
|
ffi::GST_GL_R8 => Self::R8,
|
|
|
|
ffi::GST_GL_RG => Self::Rg,
|
|
|
|
ffi::GST_GL_RG8 => Self::Rg8,
|
|
|
|
ffi::GST_GL_RGB => Self::Rgb,
|
|
|
|
ffi::GST_GL_RGB8 => Self::Rgb8,
|
|
|
|
ffi::GST_GL_RGB565 => Self::Rgb565,
|
|
|
|
ffi::GST_GL_RGB16 => Self::Rgb16,
|
|
|
|
ffi::GST_GL_RGBA => Self::Rgba,
|
|
|
|
ffi::GST_GL_RGBA8 => Self::Rgba8,
|
|
|
|
ffi::GST_GL_RGBA16 => Self::Rgba16,
|
|
|
|
ffi::GST_GL_DEPTH_COMPONENT16 => Self::DepthComponent16,
|
|
|
|
ffi::GST_GL_DEPTH24_STENCIL8 => Self::Depth24Stencil8,
|
|
|
|
ffi::GST_GL_RGB10_A2 => Self::Rgb10A2,
|
|
|
|
ffi::GST_GL_R16 => Self::R16,
|
|
|
|
ffi::GST_GL_RG16 => Self::Rg16,
|
2021-04-25 16:45:59 +00:00
|
|
|
value => Self::__Unknown(value),
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-23 14:32:09 +00:00
|
|
|
impl StaticType for GLFormat {
|
|
|
|
fn static_type() -> Type {
|
2020-11-22 10:20:20 +00:00
|
|
|
unsafe { from_glib(ffi::gst_gl_format_get_type()) }
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
impl glib::value::ValueType for GLFormat {
|
|
|
|
type Type = Self;
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
unsafe impl<'a> FromValue<'a> for GLFormat {
|
|
|
|
type Checker = glib::value::GenericValueTypeChecker<Self>;
|
|
|
|
|
|
|
|
unsafe fn from_value(value: &'a glib::Value) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2020-11-22 10:20:20 +00:00
|
|
|
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
impl ToValue for GLFormat {
|
|
|
|
fn to_value(&self) -> glib::Value {
|
2021-04-25 16:45:59 +00:00
|
|
|
let mut value = glib::Value::for_value_type::<Self>();
|
2021-04-19 16:24:43 +00:00
|
|
|
unsafe {
|
2021-04-27 15:10:39 +00:00
|
|
|
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
|
2021-04-19 16:24:43 +00:00
|
|
|
}
|
|
|
|
value
|
|
|
|
}
|
|
|
|
|
|
|
|
fn value_type(&self) -> glib::Type {
|
|
|
|
Self::static_type()
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
2020-04-12 15:55:06 +00:00
|
|
|
#[non_exhaustive]
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GstGLQueryType")]
|
2018-11-27 21:52:42 +00:00
|
|
|
pub enum GLQueryType {
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_QUERY_NONE")]
|
2018-11-27 21:52:42 +00:00
|
|
|
None,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_QUERY_TIME_ELAPSED")]
|
2018-11-27 21:52:42 +00:00
|
|
|
TimeElapsed,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_QUERY_TIMESTAMP")]
|
2018-11-27 21:52:42 +00:00
|
|
|
Timestamp,
|
|
|
|
#[doc(hidden)]
|
|
|
|
__Unknown(i32),
|
|
|
|
}
|
|
|
|
|
|
|
|
#[doc(hidden)]
|
2021-04-27 15:10:39 +00:00
|
|
|
impl IntoGlib for GLQueryType {
|
2020-11-22 10:20:20 +00:00
|
|
|
type GlibType = ffi::GstGLQueryType;
|
2018-11-27 21:52:42 +00:00
|
|
|
|
2021-04-27 15:10:39 +00:00
|
|
|
fn into_glib(self) -> ffi::GstGLQueryType {
|
|
|
|
match self {
|
2021-04-25 16:45:59 +00:00
|
|
|
Self::None => ffi::GST_GL_QUERY_NONE,
|
|
|
|
Self::TimeElapsed => ffi::GST_GL_QUERY_TIME_ELAPSED,
|
|
|
|
Self::Timestamp => ffi::GST_GL_QUERY_TIMESTAMP,
|
|
|
|
Self::__Unknown(value) => value,
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[doc(hidden)]
|
2020-11-22 10:20:20 +00:00
|
|
|
impl FromGlib<ffi::GstGLQueryType> for GLQueryType {
|
2020-12-08 13:00:17 +00:00
|
|
|
unsafe fn from_glib(value: ffi::GstGLQueryType) -> Self {
|
2018-11-27 21:52:42 +00:00
|
|
|
skip_assert_initialized!();
|
|
|
|
match value {
|
2021-05-23 16:27:13 +00:00
|
|
|
ffi::GST_GL_QUERY_NONE => Self::None,
|
|
|
|
ffi::GST_GL_QUERY_TIME_ELAPSED => Self::TimeElapsed,
|
|
|
|
ffi::GST_GL_QUERY_TIMESTAMP => Self::Timestamp,
|
2021-04-25 16:45:59 +00:00
|
|
|
value => Self::__Unknown(value),
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-23 14:32:09 +00:00
|
|
|
impl StaticType for GLQueryType {
|
|
|
|
fn static_type() -> Type {
|
2020-11-22 10:20:20 +00:00
|
|
|
unsafe { from_glib(ffi::gst_gl_query_type_get_type()) }
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
impl glib::value::ValueType for GLQueryType {
|
|
|
|
type Type = Self;
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
unsafe impl<'a> FromValue<'a> for GLQueryType {
|
|
|
|
type Checker = glib::value::GenericValueTypeChecker<Self>;
|
|
|
|
|
|
|
|
unsafe fn from_value(value: &'a glib::Value) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2020-11-22 10:20:20 +00:00
|
|
|
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
impl ToValue for GLQueryType {
|
|
|
|
fn to_value(&self) -> glib::Value {
|
2021-04-25 16:45:59 +00:00
|
|
|
let mut value = glib::Value::for_value_type::<Self>();
|
2021-04-19 16:24:43 +00:00
|
|
|
unsafe {
|
2021-04-27 15:10:39 +00:00
|
|
|
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
|
2021-04-19 16:24:43 +00:00
|
|
|
}
|
|
|
|
value
|
|
|
|
}
|
|
|
|
|
|
|
|
fn value_type(&self) -> glib::Type {
|
|
|
|
Self::static_type()
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
2020-04-12 15:55:06 +00:00
|
|
|
#[non_exhaustive]
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GstGLSLError")]
|
2018-11-27 21:52:42 +00:00
|
|
|
pub enum GLSLError {
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GLSL_ERROR_COMPILE")]
|
2018-11-27 21:52:42 +00:00
|
|
|
Compile,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GLSL_ERROR_LINK")]
|
2018-11-27 21:52:42 +00:00
|
|
|
Link,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GLSL_ERROR_PROGRAM")]
|
2018-11-27 21:52:42 +00:00
|
|
|
Program,
|
|
|
|
#[doc(hidden)]
|
|
|
|
__Unknown(i32),
|
|
|
|
}
|
|
|
|
|
|
|
|
#[doc(hidden)]
|
2021-04-27 15:10:39 +00:00
|
|
|
impl IntoGlib for GLSLError {
|
2020-11-22 10:20:20 +00:00
|
|
|
type GlibType = ffi::GstGLSLError;
|
2018-11-27 21:52:42 +00:00
|
|
|
|
2021-04-27 15:10:39 +00:00
|
|
|
fn into_glib(self) -> ffi::GstGLSLError {
|
|
|
|
match self {
|
2021-04-25 16:45:59 +00:00
|
|
|
Self::Compile => ffi::GST_GLSL_ERROR_COMPILE,
|
|
|
|
Self::Link => ffi::GST_GLSL_ERROR_LINK,
|
|
|
|
Self::Program => ffi::GST_GLSL_ERROR_PROGRAM,
|
|
|
|
Self::__Unknown(value) => value,
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[doc(hidden)]
|
2020-11-22 10:20:20 +00:00
|
|
|
impl FromGlib<ffi::GstGLSLError> for GLSLError {
|
2020-12-08 13:00:17 +00:00
|
|
|
unsafe fn from_glib(value: ffi::GstGLSLError) -> Self {
|
2018-11-27 21:52:42 +00:00
|
|
|
skip_assert_initialized!();
|
|
|
|
match value {
|
2021-05-23 16:27:13 +00:00
|
|
|
ffi::GST_GLSL_ERROR_COMPILE => Self::Compile,
|
|
|
|
ffi::GST_GLSL_ERROR_LINK => Self::Link,
|
|
|
|
ffi::GST_GLSL_ERROR_PROGRAM => Self::Program,
|
2021-04-25 16:45:59 +00:00
|
|
|
value => Self::__Unknown(value),
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ErrorDomain for GLSLError {
|
|
|
|
fn domain() -> Quark {
|
|
|
|
skip_assert_initialized!();
|
2020-10-31 07:36:53 +00:00
|
|
|
|
2020-11-22 10:20:20 +00:00
|
|
|
unsafe { from_glib(ffi::gst_glsl_error_quark()) }
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn code(self) -> i32 {
|
2021-04-27 15:10:39 +00:00
|
|
|
self.into_glib()
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn from(code: i32) -> Option<Self> {
|
|
|
|
skip_assert_initialized!();
|
|
|
|
match code {
|
2021-05-23 16:27:13 +00:00
|
|
|
ffi::GST_GLSL_ERROR_COMPILE => Some(Self::Compile),
|
|
|
|
ffi::GST_GLSL_ERROR_LINK => Some(Self::Link),
|
|
|
|
ffi::GST_GLSL_ERROR_PROGRAM => Some(Self::Program),
|
2021-04-25 16:45:59 +00:00
|
|
|
value => Some(Self::__Unknown(value)),
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-23 14:32:09 +00:00
|
|
|
impl StaticType for GLSLError {
|
|
|
|
fn static_type() -> Type {
|
2020-11-22 10:20:20 +00:00
|
|
|
unsafe { from_glib(ffi::gst_glsl_error_get_type()) }
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
impl glib::value::ValueType for GLSLError {
|
|
|
|
type Type = Self;
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
unsafe impl<'a> FromValue<'a> for GLSLError {
|
|
|
|
type Checker = glib::value::GenericValueTypeChecker<Self>;
|
|
|
|
|
|
|
|
unsafe fn from_value(value: &'a glib::Value) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2020-11-22 10:20:20 +00:00
|
|
|
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
impl ToValue for GLSLError {
|
|
|
|
fn to_value(&self) -> glib::Value {
|
2021-04-25 16:45:59 +00:00
|
|
|
let mut value = glib::Value::for_value_type::<Self>();
|
2021-04-19 16:24:43 +00:00
|
|
|
unsafe {
|
2021-04-27 15:10:39 +00:00
|
|
|
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
|
2021-04-19 16:24:43 +00:00
|
|
|
}
|
|
|
|
value
|
|
|
|
}
|
|
|
|
|
|
|
|
fn value_type(&self) -> glib::Type {
|
|
|
|
Self::static_type()
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
2020-04-12 15:55:06 +00:00
|
|
|
#[non_exhaustive]
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GstGLSLVersion")]
|
2018-11-27 21:52:42 +00:00
|
|
|
pub enum GLSLVersion {
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GLSL_VERSION_NONE")]
|
2018-11-27 21:52:42 +00:00
|
|
|
None,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GLSL_VERSION_100")]
|
2018-11-27 21:52:42 +00:00
|
|
|
_100,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GLSL_VERSION_110")]
|
2018-11-27 21:52:42 +00:00
|
|
|
_110,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GLSL_VERSION_120")]
|
2018-11-27 21:52:42 +00:00
|
|
|
_120,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GLSL_VERSION_130")]
|
2018-11-27 21:52:42 +00:00
|
|
|
_130,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GLSL_VERSION_140")]
|
2018-11-27 21:52:42 +00:00
|
|
|
_140,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GLSL_VERSION_150")]
|
2018-11-27 21:52:42 +00:00
|
|
|
_150,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GLSL_VERSION_300")]
|
2018-11-27 21:52:42 +00:00
|
|
|
_300,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GLSL_VERSION_310")]
|
2018-11-27 21:52:42 +00:00
|
|
|
_310,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GLSL_VERSION_320")]
|
2018-11-27 21:52:42 +00:00
|
|
|
_320,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GLSL_VERSION_330")]
|
2018-11-27 21:52:42 +00:00
|
|
|
_330,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GLSL_VERSION_400")]
|
2018-11-27 21:52:42 +00:00
|
|
|
_400,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GLSL_VERSION_410")]
|
2018-11-27 21:52:42 +00:00
|
|
|
_410,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GLSL_VERSION_420")]
|
2018-11-27 21:52:42 +00:00
|
|
|
_420,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GLSL_VERSION_430")]
|
2018-11-27 21:52:42 +00:00
|
|
|
_430,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GLSL_VERSION_440")]
|
2018-11-27 21:52:42 +00:00
|
|
|
_440,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GLSL_VERSION_450")]
|
2018-11-27 21:52:42 +00:00
|
|
|
_450,
|
|
|
|
#[doc(hidden)]
|
|
|
|
__Unknown(i32),
|
|
|
|
}
|
|
|
|
|
2020-12-07 11:11:04 +00:00
|
|
|
impl GLSLVersion {
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_glsl_version_from_string")]
|
2020-12-07 11:11:04 +00:00
|
|
|
pub fn from_string(string: &str) -> GLSLVersion {
|
|
|
|
assert_initialized_main_thread!();
|
|
|
|
unsafe { from_glib(ffi::gst_glsl_version_from_string(string.to_glib_none().0)) }
|
|
|
|
}
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_glsl_version_profile_from_string")]
|
2020-12-07 11:11:04 +00:00
|
|
|
pub fn profile_from_string(string: &str) -> Option<(GLSLVersion, GLSLProfile)> {
|
|
|
|
assert_initialized_main_thread!();
|
|
|
|
unsafe {
|
|
|
|
let mut version_ret = mem::MaybeUninit::uninit();
|
|
|
|
let mut profile_ret = mem::MaybeUninit::uninit();
|
|
|
|
let ret = from_glib(ffi::gst_glsl_version_profile_from_string(
|
|
|
|
string.to_glib_none().0,
|
|
|
|
version_ret.as_mut_ptr(),
|
|
|
|
profile_ret.as_mut_ptr(),
|
|
|
|
));
|
|
|
|
let version_ret = version_ret.assume_init();
|
|
|
|
let profile_ret = profile_ret.assume_init();
|
|
|
|
if ret {
|
|
|
|
Some((from_glib(version_ret), from_glib(profile_ret)))
|
|
|
|
} else {
|
|
|
|
None
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_glsl_version_profile_to_string")]
|
2020-12-07 11:11:04 +00:00
|
|
|
pub fn profile_to_string(self, profile: GLSLProfile) -> Option<glib::GString> {
|
|
|
|
assert_initialized_main_thread!();
|
|
|
|
unsafe {
|
|
|
|
from_glib_full(ffi::gst_glsl_version_profile_to_string(
|
2021-04-27 15:10:39 +00:00
|
|
|
self.into_glib(),
|
|
|
|
profile.into_glib(),
|
2020-12-07 11:11:04 +00:00
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_glsl_version_to_string")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "to_string")]
|
2020-12-07 11:11:04 +00:00
|
|
|
pub fn to_str(self) -> Option<glib::GString> {
|
|
|
|
assert_initialized_main_thread!();
|
2021-04-27 15:10:39 +00:00
|
|
|
unsafe { from_glib_none(ffi::gst_glsl_version_to_string(self.into_glib())) }
|
2020-12-07 11:11:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-27 21:52:42 +00:00
|
|
|
#[doc(hidden)]
|
2021-04-27 15:10:39 +00:00
|
|
|
impl IntoGlib for GLSLVersion {
|
2020-11-22 10:20:20 +00:00
|
|
|
type GlibType = ffi::GstGLSLVersion;
|
2018-11-27 21:52:42 +00:00
|
|
|
|
2021-04-27 15:10:39 +00:00
|
|
|
fn into_glib(self) -> ffi::GstGLSLVersion {
|
|
|
|
match self {
|
2021-04-25 16:45:59 +00:00
|
|
|
Self::None => ffi::GST_GLSL_VERSION_NONE,
|
|
|
|
Self::_100 => ffi::GST_GLSL_VERSION_100,
|
|
|
|
Self::_110 => ffi::GST_GLSL_VERSION_110,
|
|
|
|
Self::_120 => ffi::GST_GLSL_VERSION_120,
|
|
|
|
Self::_130 => ffi::GST_GLSL_VERSION_130,
|
|
|
|
Self::_140 => ffi::GST_GLSL_VERSION_140,
|
|
|
|
Self::_150 => ffi::GST_GLSL_VERSION_150,
|
|
|
|
Self::_300 => ffi::GST_GLSL_VERSION_300,
|
|
|
|
Self::_310 => ffi::GST_GLSL_VERSION_310,
|
|
|
|
Self::_320 => ffi::GST_GLSL_VERSION_320,
|
|
|
|
Self::_330 => ffi::GST_GLSL_VERSION_330,
|
|
|
|
Self::_400 => ffi::GST_GLSL_VERSION_400,
|
|
|
|
Self::_410 => ffi::GST_GLSL_VERSION_410,
|
|
|
|
Self::_420 => ffi::GST_GLSL_VERSION_420,
|
|
|
|
Self::_430 => ffi::GST_GLSL_VERSION_430,
|
|
|
|
Self::_440 => ffi::GST_GLSL_VERSION_440,
|
|
|
|
Self::_450 => ffi::GST_GLSL_VERSION_450,
|
|
|
|
Self::__Unknown(value) => value,
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[doc(hidden)]
|
2020-11-22 10:20:20 +00:00
|
|
|
impl FromGlib<ffi::GstGLSLVersion> for GLSLVersion {
|
2020-12-08 13:00:17 +00:00
|
|
|
unsafe fn from_glib(value: ffi::GstGLSLVersion) -> Self {
|
2018-11-27 21:52:42 +00:00
|
|
|
skip_assert_initialized!();
|
|
|
|
match value {
|
2021-05-23 16:27:13 +00:00
|
|
|
ffi::GST_GLSL_VERSION_NONE => Self::None,
|
|
|
|
ffi::GST_GLSL_VERSION_100 => Self::_100,
|
|
|
|
ffi::GST_GLSL_VERSION_110 => Self::_110,
|
|
|
|
ffi::GST_GLSL_VERSION_120 => Self::_120,
|
|
|
|
ffi::GST_GLSL_VERSION_130 => Self::_130,
|
|
|
|
ffi::GST_GLSL_VERSION_140 => Self::_140,
|
|
|
|
ffi::GST_GLSL_VERSION_150 => Self::_150,
|
|
|
|
ffi::GST_GLSL_VERSION_300 => Self::_300,
|
|
|
|
ffi::GST_GLSL_VERSION_310 => Self::_310,
|
|
|
|
ffi::GST_GLSL_VERSION_320 => Self::_320,
|
|
|
|
ffi::GST_GLSL_VERSION_330 => Self::_330,
|
|
|
|
ffi::GST_GLSL_VERSION_400 => Self::_400,
|
|
|
|
ffi::GST_GLSL_VERSION_410 => Self::_410,
|
|
|
|
ffi::GST_GLSL_VERSION_420 => Self::_420,
|
|
|
|
ffi::GST_GLSL_VERSION_430 => Self::_430,
|
|
|
|
ffi::GST_GLSL_VERSION_440 => Self::_440,
|
|
|
|
ffi::GST_GLSL_VERSION_450 => Self::_450,
|
2021-04-25 16:45:59 +00:00
|
|
|
value => Self::__Unknown(value),
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-23 14:32:09 +00:00
|
|
|
impl StaticType for GLSLVersion {
|
|
|
|
fn static_type() -> Type {
|
2020-11-22 10:20:20 +00:00
|
|
|
unsafe { from_glib(ffi::gst_glsl_version_get_type()) }
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
impl glib::value::ValueType for GLSLVersion {
|
|
|
|
type Type = Self;
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
unsafe impl<'a> FromValue<'a> for GLSLVersion {
|
|
|
|
type Checker = glib::value::GenericValueTypeChecker<Self>;
|
|
|
|
|
|
|
|
unsafe fn from_value(value: &'a glib::Value) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2020-11-22 10:20:20 +00:00
|
|
|
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
impl ToValue for GLSLVersion {
|
|
|
|
fn to_value(&self) -> glib::Value {
|
2021-04-25 16:45:59 +00:00
|
|
|
let mut value = glib::Value::for_value_type::<Self>();
|
2021-04-19 16:24:43 +00:00
|
|
|
unsafe {
|
2021-04-27 15:10:39 +00:00
|
|
|
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
|
2021-04-19 16:24:43 +00:00
|
|
|
}
|
|
|
|
value
|
|
|
|
}
|
|
|
|
|
|
|
|
fn value_type(&self) -> glib::Type {
|
|
|
|
Self::static_type()
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
2020-04-12 15:55:06 +00:00
|
|
|
#[non_exhaustive]
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GstGLStereoDownmix")]
|
2018-11-27 21:52:42 +00:00
|
|
|
pub enum GLStereoDownmix {
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_STEREO_DOWNMIX_ANAGLYPH_GREEN_MAGENTA_DUBOIS")]
|
2018-11-27 21:52:42 +00:00
|
|
|
GreenMagentaDubois,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_STEREO_DOWNMIX_ANAGLYPH_RED_CYAN_DUBOIS")]
|
2018-11-27 21:52:42 +00:00
|
|
|
RedCyanDubois,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_STEREO_DOWNMIX_ANAGLYPH_AMBER_BLUE_DUBOIS")]
|
2018-11-27 21:52:42 +00:00
|
|
|
AmberBlueDubois,
|
|
|
|
#[doc(hidden)]
|
|
|
|
__Unknown(i32),
|
|
|
|
}
|
|
|
|
|
|
|
|
#[doc(hidden)]
|
2021-04-27 15:10:39 +00:00
|
|
|
impl IntoGlib for GLStereoDownmix {
|
2020-11-22 10:20:20 +00:00
|
|
|
type GlibType = ffi::GstGLStereoDownmix;
|
2018-11-27 21:52:42 +00:00
|
|
|
|
2021-04-27 15:10:39 +00:00
|
|
|
fn into_glib(self) -> ffi::GstGLStereoDownmix {
|
|
|
|
match self {
|
2021-04-25 16:45:59 +00:00
|
|
|
Self::GreenMagentaDubois => ffi::GST_GL_STEREO_DOWNMIX_ANAGLYPH_GREEN_MAGENTA_DUBOIS,
|
|
|
|
Self::RedCyanDubois => ffi::GST_GL_STEREO_DOWNMIX_ANAGLYPH_RED_CYAN_DUBOIS,
|
|
|
|
Self::AmberBlueDubois => ffi::GST_GL_STEREO_DOWNMIX_ANAGLYPH_AMBER_BLUE_DUBOIS,
|
|
|
|
Self::__Unknown(value) => value,
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[doc(hidden)]
|
2020-11-22 10:20:20 +00:00
|
|
|
impl FromGlib<ffi::GstGLStereoDownmix> for GLStereoDownmix {
|
2020-12-08 13:00:17 +00:00
|
|
|
unsafe fn from_glib(value: ffi::GstGLStereoDownmix) -> Self {
|
2018-11-27 21:52:42 +00:00
|
|
|
skip_assert_initialized!();
|
|
|
|
match value {
|
2021-05-23 16:27:13 +00:00
|
|
|
ffi::GST_GL_STEREO_DOWNMIX_ANAGLYPH_GREEN_MAGENTA_DUBOIS => Self::GreenMagentaDubois,
|
|
|
|
ffi::GST_GL_STEREO_DOWNMIX_ANAGLYPH_RED_CYAN_DUBOIS => Self::RedCyanDubois,
|
|
|
|
ffi::GST_GL_STEREO_DOWNMIX_ANAGLYPH_AMBER_BLUE_DUBOIS => Self::AmberBlueDubois,
|
2021-04-25 16:45:59 +00:00
|
|
|
value => Self::__Unknown(value),
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl StaticType for GLStereoDownmix {
|
|
|
|
fn static_type() -> Type {
|
2020-11-22 10:20:20 +00:00
|
|
|
unsafe { from_glib(ffi::gst_gl_stereo_downmix_get_type()) }
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
impl glib::value::ValueType for GLStereoDownmix {
|
|
|
|
type Type = Self;
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
unsafe impl<'a> FromValue<'a> for GLStereoDownmix {
|
|
|
|
type Checker = glib::value::GenericValueTypeChecker<Self>;
|
|
|
|
|
|
|
|
unsafe fn from_value(value: &'a glib::Value) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2020-11-22 10:20:20 +00:00
|
|
|
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
impl ToValue for GLStereoDownmix {
|
|
|
|
fn to_value(&self) -> glib::Value {
|
2021-04-25 16:45:59 +00:00
|
|
|
let mut value = glib::Value::for_value_type::<Self>();
|
2021-04-19 16:24:43 +00:00
|
|
|
unsafe {
|
2021-04-27 15:10:39 +00:00
|
|
|
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
|
2021-04-19 16:24:43 +00:00
|
|
|
}
|
|
|
|
value
|
|
|
|
}
|
|
|
|
|
|
|
|
fn value_type(&self) -> glib::Type {
|
|
|
|
Self::static_type()
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
2020-04-12 15:55:06 +00:00
|
|
|
#[non_exhaustive]
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GstGLTextureTarget")]
|
2018-11-27 21:52:42 +00:00
|
|
|
pub enum GLTextureTarget {
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_TEXTURE_TARGET_NONE")]
|
2018-11-27 21:52:42 +00:00
|
|
|
None,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_TEXTURE_TARGET_2D")]
|
2018-11-27 21:52:42 +00:00
|
|
|
_2d,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_TEXTURE_TARGET_RECTANGLE")]
|
2018-11-27 21:52:42 +00:00
|
|
|
Rectangle,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_TEXTURE_TARGET_EXTERNAL_OES")]
|
2018-11-27 21:52:42 +00:00
|
|
|
ExternalOes,
|
|
|
|
#[doc(hidden)]
|
|
|
|
__Unknown(i32),
|
|
|
|
}
|
|
|
|
|
2020-12-07 11:11:04 +00:00
|
|
|
impl GLTextureTarget {
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_gl_texture_target_from_gl")]
|
2020-12-07 11:11:04 +00:00
|
|
|
pub fn from_gl(target: u32) -> GLTextureTarget {
|
|
|
|
assert_initialized_main_thread!();
|
|
|
|
unsafe { from_glib(ffi::gst_gl_texture_target_from_gl(target)) }
|
|
|
|
}
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_gl_texture_target_from_string")]
|
2020-12-07 11:11:04 +00:00
|
|
|
pub fn from_string(str: &str) -> GLTextureTarget {
|
|
|
|
assert_initialized_main_thread!();
|
|
|
|
unsafe { from_glib(ffi::gst_gl_texture_target_from_string(str.to_glib_none().0)) }
|
|
|
|
}
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_gl_texture_target_to_buffer_pool_option")]
|
2020-12-07 11:11:04 +00:00
|
|
|
pub fn to_buffer_pool_option(self) -> Option<glib::GString> {
|
|
|
|
assert_initialized_main_thread!();
|
|
|
|
unsafe {
|
|
|
|
from_glib_none(ffi::gst_gl_texture_target_to_buffer_pool_option(
|
2021-04-27 15:10:39 +00:00
|
|
|
self.into_glib(),
|
2020-12-07 11:11:04 +00:00
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_gl_texture_target_to_gl")]
|
2020-12-07 11:11:04 +00:00
|
|
|
pub fn to_gl(self) -> u32 {
|
|
|
|
assert_initialized_main_thread!();
|
2021-04-27 15:10:39 +00:00
|
|
|
unsafe { ffi::gst_gl_texture_target_to_gl(self.into_glib()) }
|
2020-12-07 11:11:04 +00:00
|
|
|
}
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_gl_texture_target_to_string")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "to_string")]
|
2020-12-07 11:11:04 +00:00
|
|
|
pub fn to_str(self) -> Option<glib::GString> {
|
|
|
|
assert_initialized_main_thread!();
|
2021-04-27 15:10:39 +00:00
|
|
|
unsafe { from_glib_none(ffi::gst_gl_texture_target_to_string(self.into_glib())) }
|
2020-12-07 11:11:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-27 21:52:42 +00:00
|
|
|
#[doc(hidden)]
|
2021-04-27 15:10:39 +00:00
|
|
|
impl IntoGlib for GLTextureTarget {
|
2020-11-22 10:20:20 +00:00
|
|
|
type GlibType = ffi::GstGLTextureTarget;
|
2018-11-27 21:52:42 +00:00
|
|
|
|
2021-04-27 15:10:39 +00:00
|
|
|
fn into_glib(self) -> ffi::GstGLTextureTarget {
|
|
|
|
match self {
|
2021-04-25 16:45:59 +00:00
|
|
|
Self::None => ffi::GST_GL_TEXTURE_TARGET_NONE,
|
|
|
|
Self::_2d => ffi::GST_GL_TEXTURE_TARGET_2D,
|
|
|
|
Self::Rectangle => ffi::GST_GL_TEXTURE_TARGET_RECTANGLE,
|
|
|
|
Self::ExternalOes => ffi::GST_GL_TEXTURE_TARGET_EXTERNAL_OES,
|
|
|
|
Self::__Unknown(value) => value,
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[doc(hidden)]
|
2020-11-22 10:20:20 +00:00
|
|
|
impl FromGlib<ffi::GstGLTextureTarget> for GLTextureTarget {
|
2020-12-08 13:00:17 +00:00
|
|
|
unsafe fn from_glib(value: ffi::GstGLTextureTarget) -> Self {
|
2018-11-27 21:52:42 +00:00
|
|
|
skip_assert_initialized!();
|
|
|
|
match value {
|
2021-05-23 16:27:13 +00:00
|
|
|
ffi::GST_GL_TEXTURE_TARGET_NONE => Self::None,
|
|
|
|
ffi::GST_GL_TEXTURE_TARGET_2D => Self::_2d,
|
|
|
|
ffi::GST_GL_TEXTURE_TARGET_RECTANGLE => Self::Rectangle,
|
|
|
|
ffi::GST_GL_TEXTURE_TARGET_EXTERNAL_OES => Self::ExternalOes,
|
2021-04-25 16:45:59 +00:00
|
|
|
value => Self::__Unknown(value),
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-23 14:32:09 +00:00
|
|
|
impl StaticType for GLTextureTarget {
|
|
|
|
fn static_type() -> Type {
|
2020-11-22 10:20:20 +00:00
|
|
|
unsafe { from_glib(ffi::gst_gl_texture_target_get_type()) }
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
impl glib::value::ValueType for GLTextureTarget {
|
|
|
|
type Type = Self;
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
unsafe impl<'a> FromValue<'a> for GLTextureTarget {
|
|
|
|
type Checker = glib::value::GenericValueTypeChecker<Self>;
|
|
|
|
|
|
|
|
unsafe fn from_value(value: &'a glib::Value) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2020-11-22 10:20:20 +00:00
|
|
|
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
impl ToValue for GLTextureTarget {
|
|
|
|
fn to_value(&self) -> glib::Value {
|
2021-04-25 16:45:59 +00:00
|
|
|
let mut value = glib::Value::for_value_type::<Self>();
|
2021-04-19 16:24:43 +00:00
|
|
|
unsafe {
|
2021-04-27 15:10:39 +00:00
|
|
|
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
|
2021-04-19 16:24:43 +00:00
|
|
|
}
|
|
|
|
value
|
|
|
|
}
|
|
|
|
|
|
|
|
fn value_type(&self) -> glib::Type {
|
|
|
|
Self::static_type()
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
2020-04-12 15:55:06 +00:00
|
|
|
#[non_exhaustive]
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GstGLUploadReturn")]
|
2018-11-27 21:52:42 +00:00
|
|
|
pub enum GLUploadReturn {
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_UPLOAD_DONE")]
|
2018-11-27 21:52:42 +00:00
|
|
|
Done,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_UPLOAD_ERROR")]
|
2018-11-27 21:52:42 +00:00
|
|
|
Error,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_UPLOAD_UNSUPPORTED")]
|
2018-11-27 21:52:42 +00:00
|
|
|
Unsupported,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_UPLOAD_RECONFIGURE")]
|
2018-11-27 21:52:42 +00:00
|
|
|
Reconfigure,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_UPLOAD_UNSHARED_GL_CONTEXT")]
|
2019-04-23 14:32:09 +00:00
|
|
|
UnsharedGlContext,
|
2018-11-27 21:52:42 +00:00
|
|
|
#[doc(hidden)]
|
|
|
|
__Unknown(i32),
|
|
|
|
}
|
|
|
|
|
|
|
|
#[doc(hidden)]
|
2021-04-27 15:10:39 +00:00
|
|
|
impl IntoGlib for GLUploadReturn {
|
2020-11-22 10:20:20 +00:00
|
|
|
type GlibType = ffi::GstGLUploadReturn;
|
2018-11-27 21:52:42 +00:00
|
|
|
|
2021-04-27 15:10:39 +00:00
|
|
|
fn into_glib(self) -> ffi::GstGLUploadReturn {
|
|
|
|
match self {
|
2021-04-25 16:45:59 +00:00
|
|
|
Self::Done => ffi::GST_GL_UPLOAD_DONE,
|
|
|
|
Self::Error => ffi::GST_GL_UPLOAD_ERROR,
|
|
|
|
Self::Unsupported => ffi::GST_GL_UPLOAD_UNSUPPORTED,
|
|
|
|
Self::Reconfigure => ffi::GST_GL_UPLOAD_RECONFIGURE,
|
|
|
|
Self::UnsharedGlContext => ffi::GST_GL_UPLOAD_UNSHARED_GL_CONTEXT,
|
|
|
|
Self::__Unknown(value) => value,
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[doc(hidden)]
|
2020-11-22 10:20:20 +00:00
|
|
|
impl FromGlib<ffi::GstGLUploadReturn> for GLUploadReturn {
|
2020-12-08 13:00:17 +00:00
|
|
|
unsafe fn from_glib(value: ffi::GstGLUploadReturn) -> Self {
|
2018-11-27 21:52:42 +00:00
|
|
|
skip_assert_initialized!();
|
|
|
|
match value {
|
2021-05-23 16:27:13 +00:00
|
|
|
ffi::GST_GL_UPLOAD_DONE => Self::Done,
|
|
|
|
ffi::GST_GL_UPLOAD_ERROR => Self::Error,
|
|
|
|
ffi::GST_GL_UPLOAD_UNSUPPORTED => Self::Unsupported,
|
|
|
|
ffi::GST_GL_UPLOAD_RECONFIGURE => Self::Reconfigure,
|
|
|
|
ffi::GST_GL_UPLOAD_UNSHARED_GL_CONTEXT => Self::UnsharedGlContext,
|
2021-04-25 16:45:59 +00:00
|
|
|
value => Self::__Unknown(value),
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-23 14:32:09 +00:00
|
|
|
impl StaticType for GLUploadReturn {
|
|
|
|
fn static_type() -> Type {
|
2020-11-22 10:20:20 +00:00
|
|
|
unsafe { from_glib(ffi::gst_gl_upload_return_get_type()) }
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
impl glib::value::ValueType for GLUploadReturn {
|
|
|
|
type Type = Self;
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
unsafe impl<'a> FromValue<'a> for GLUploadReturn {
|
|
|
|
type Checker = glib::value::GenericValueTypeChecker<Self>;
|
|
|
|
|
|
|
|
unsafe fn from_value(value: &'a glib::Value) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2020-11-22 10:20:20 +00:00
|
|
|
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
impl ToValue for GLUploadReturn {
|
|
|
|
fn to_value(&self) -> glib::Value {
|
2021-04-25 16:45:59 +00:00
|
|
|
let mut value = glib::Value::for_value_type::<Self>();
|
2021-04-19 16:24:43 +00:00
|
|
|
unsafe {
|
2021-04-27 15:10:39 +00:00
|
|
|
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
|
2021-04-19 16:24:43 +00:00
|
|
|
}
|
|
|
|
value
|
|
|
|
}
|
|
|
|
|
|
|
|
fn value_type(&self) -> glib::Type {
|
|
|
|
Self::static_type()
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
2020-04-12 15:55:06 +00:00
|
|
|
#[non_exhaustive]
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GstGLWindowError")]
|
2018-11-27 21:52:42 +00:00
|
|
|
pub enum GLWindowError {
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_WINDOW_ERROR_FAILED")]
|
2018-11-27 21:52:42 +00:00
|
|
|
Failed,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_WINDOW_ERROR_OLD_LIBS")]
|
2018-11-27 21:52:42 +00:00
|
|
|
OldLibs,
|
2020-12-18 14:23:05 +00:00
|
|
|
#[doc(alias = "GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE")]
|
2018-11-27 21:52:42 +00:00
|
|
|
ResourceUnavailable,
|
|
|
|
#[doc(hidden)]
|
|
|
|
__Unknown(i32),
|
|
|
|
}
|
|
|
|
|
|
|
|
#[doc(hidden)]
|
2021-04-27 15:10:39 +00:00
|
|
|
impl IntoGlib for GLWindowError {
|
2020-11-22 10:20:20 +00:00
|
|
|
type GlibType = ffi::GstGLWindowError;
|
2018-11-27 21:52:42 +00:00
|
|
|
|
2021-04-27 15:10:39 +00:00
|
|
|
fn into_glib(self) -> ffi::GstGLWindowError {
|
|
|
|
match self {
|
2021-04-25 16:45:59 +00:00
|
|
|
Self::Failed => ffi::GST_GL_WINDOW_ERROR_FAILED,
|
|
|
|
Self::OldLibs => ffi::GST_GL_WINDOW_ERROR_OLD_LIBS,
|
|
|
|
Self::ResourceUnavailable => ffi::GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE,
|
|
|
|
Self::__Unknown(value) => value,
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[doc(hidden)]
|
2020-11-22 10:20:20 +00:00
|
|
|
impl FromGlib<ffi::GstGLWindowError> for GLWindowError {
|
2020-12-08 13:00:17 +00:00
|
|
|
unsafe fn from_glib(value: ffi::GstGLWindowError) -> Self {
|
2018-11-27 21:52:42 +00:00
|
|
|
skip_assert_initialized!();
|
|
|
|
match value {
|
2021-05-23 16:27:13 +00:00
|
|
|
ffi::GST_GL_WINDOW_ERROR_FAILED => Self::Failed,
|
|
|
|
ffi::GST_GL_WINDOW_ERROR_OLD_LIBS => Self::OldLibs,
|
|
|
|
ffi::GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE => Self::ResourceUnavailable,
|
2021-04-25 16:45:59 +00:00
|
|
|
value => Self::__Unknown(value),
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ErrorDomain for GLWindowError {
|
|
|
|
fn domain() -> Quark {
|
|
|
|
skip_assert_initialized!();
|
2020-10-31 07:36:53 +00:00
|
|
|
|
2020-11-22 10:20:20 +00:00
|
|
|
unsafe { from_glib(ffi::gst_gl_window_error_quark()) }
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn code(self) -> i32 {
|
2021-04-27 15:10:39 +00:00
|
|
|
self.into_glib()
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn from(code: i32) -> Option<Self> {
|
|
|
|
skip_assert_initialized!();
|
|
|
|
match code {
|
2021-05-23 16:27:13 +00:00
|
|
|
ffi::GST_GL_WINDOW_ERROR_FAILED => Some(Self::Failed),
|
|
|
|
ffi::GST_GL_WINDOW_ERROR_OLD_LIBS => Some(Self::OldLibs),
|
|
|
|
ffi::GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE => Some(Self::ResourceUnavailable),
|
2021-04-25 16:45:59 +00:00
|
|
|
_ => Some(Self::Failed),
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-23 14:32:09 +00:00
|
|
|
impl StaticType for GLWindowError {
|
|
|
|
fn static_type() -> Type {
|
2020-11-22 10:20:20 +00:00
|
|
|
unsafe { from_glib(ffi::gst_gl_window_error_get_type()) }
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
impl glib::value::ValueType for GLWindowError {
|
|
|
|
type Type = Self;
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
unsafe impl<'a> FromValue<'a> for GLWindowError {
|
|
|
|
type Checker = glib::value::GenericValueTypeChecker<Self>;
|
|
|
|
|
|
|
|
unsafe fn from_value(value: &'a glib::Value) -> Self {
|
|
|
|
skip_assert_initialized!();
|
2020-11-22 10:20:20 +00:00
|
|
|
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 16:24:43 +00:00
|
|
|
impl ToValue for GLWindowError {
|
|
|
|
fn to_value(&self) -> glib::Value {
|
2021-04-25 16:45:59 +00:00
|
|
|
let mut value = glib::Value::for_value_type::<Self>();
|
2021-04-19 16:24:43 +00:00
|
|
|
unsafe {
|
2021-04-27 15:10:39 +00:00
|
|
|
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
|
2021-04-19 16:24:43 +00:00
|
|
|
}
|
|
|
|
value
|
|
|
|
}
|
|
|
|
|
|
|
|
fn value_type(&self) -> glib::Type {
|
|
|
|
Self::static_type()
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|