gstreamer-gl: Regenerate

This commit is contained in:
Sebastian Dröge 2020-11-22 12:20:20 +02:00
parent 3c8e798f73
commit 01f5138e76
17 changed files with 457 additions and 593 deletions

View file

@ -11,8 +11,6 @@ use glib::value::Value;
use glib::Quark;
use glib::StaticType;
use glib::Type;
use gobject_sys;
use gst_gl_sys;
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
@ -29,26 +27,24 @@ pub enum GLContextError {
#[doc(hidden)]
impl ToGlib for GLContextError {
type GlibType = gst_gl_sys::GstGLContextError;
type GlibType = ffi::GstGLContextError;
fn to_glib(&self) -> gst_gl_sys::GstGLContextError {
fn to_glib(&self) -> ffi::GstGLContextError {
match *self {
GLContextError::Failed => gst_gl_sys::GST_GL_CONTEXT_ERROR_FAILED,
GLContextError::WrongConfig => gst_gl_sys::GST_GL_CONTEXT_ERROR_WRONG_CONFIG,
GLContextError::WrongApi => gst_gl_sys::GST_GL_CONTEXT_ERROR_WRONG_API,
GLContextError::OldLibs => gst_gl_sys::GST_GL_CONTEXT_ERROR_OLD_LIBS,
GLContextError::CreateContext => gst_gl_sys::GST_GL_CONTEXT_ERROR_CREATE_CONTEXT,
GLContextError::ResourceUnavailable => {
gst_gl_sys::GST_GL_CONTEXT_ERROR_RESOURCE_UNAVAILABLE
}
GLContextError::Failed => ffi::GST_GL_CONTEXT_ERROR_FAILED,
GLContextError::WrongConfig => ffi::GST_GL_CONTEXT_ERROR_WRONG_CONFIG,
GLContextError::WrongApi => ffi::GST_GL_CONTEXT_ERROR_WRONG_API,
GLContextError::OldLibs => ffi::GST_GL_CONTEXT_ERROR_OLD_LIBS,
GLContextError::CreateContext => ffi::GST_GL_CONTEXT_ERROR_CREATE_CONTEXT,
GLContextError::ResourceUnavailable => ffi::GST_GL_CONTEXT_ERROR_RESOURCE_UNAVAILABLE,
GLContextError::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_gl_sys::GstGLContextError> for GLContextError {
fn from_glib(value: gst_gl_sys::GstGLContextError) -> Self {
impl FromGlib<ffi::GstGLContextError> for GLContextError {
fn from_glib(value: ffi::GstGLContextError) -> Self {
skip_assert_initialized!();
match value {
0 => GLContextError::Failed,
@ -66,7 +62,7 @@ impl ErrorDomain for GLContextError {
fn domain() -> Quark {
skip_assert_initialized!();
unsafe { from_glib(gst_gl_sys::gst_gl_context_error_quark()) }
unsafe { from_glib(ffi::gst_gl_context_error_quark()) }
}
fn code(self) -> i32 {
@ -89,7 +85,7 @@ impl ErrorDomain for GLContextError {
impl StaticType for GLContextError {
fn static_type() -> Type {
unsafe { from_glib(gst_gl_sys::gst_gl_context_error_get_type()) }
unsafe { from_glib(ffi::gst_gl_context_error_get_type()) }
}
}
@ -101,13 +97,13 @@ impl<'a> FromValueOptional<'a> for GLContextError {
impl<'a> FromValue<'a> for GLContextError {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl SetValue for GLContextError {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
@ -139,37 +135,37 @@ pub enum GLFormat {
#[doc(hidden)]
impl ToGlib for GLFormat {
type GlibType = gst_gl_sys::GstGLFormat;
type GlibType = ffi::GstGLFormat;
fn to_glib(&self) -> gst_gl_sys::GstGLFormat {
fn to_glib(&self) -> ffi::GstGLFormat {
match *self {
GLFormat::Luminance => gst_gl_sys::GST_GL_LUMINANCE,
GLFormat::Alpha => gst_gl_sys::GST_GL_ALPHA,
GLFormat::LuminanceAlpha => gst_gl_sys::GST_GL_LUMINANCE_ALPHA,
GLFormat::Red => gst_gl_sys::GST_GL_RED,
GLFormat::R8 => gst_gl_sys::GST_GL_R8,
GLFormat::Rg => gst_gl_sys::GST_GL_RG,
GLFormat::Rg8 => gst_gl_sys::GST_GL_RG8,
GLFormat::Rgb => gst_gl_sys::GST_GL_RGB,
GLFormat::Rgb8 => gst_gl_sys::GST_GL_RGB8,
GLFormat::Rgb565 => gst_gl_sys::GST_GL_RGB565,
GLFormat::Rgb16 => gst_gl_sys::GST_GL_RGB16,
GLFormat::Rgba => gst_gl_sys::GST_GL_RGBA,
GLFormat::Rgba8 => gst_gl_sys::GST_GL_RGBA8,
GLFormat::Rgba16 => gst_gl_sys::GST_GL_RGBA16,
GLFormat::DepthComponent16 => gst_gl_sys::GST_GL_DEPTH_COMPONENT16,
GLFormat::Depth24Stencil8 => gst_gl_sys::GST_GL_DEPTH24_STENCIL8,
GLFormat::Rgb10A2 => gst_gl_sys::GST_GL_RGB10_A2,
GLFormat::R16 => gst_gl_sys::GST_GL_R16,
GLFormat::Rg16 => gst_gl_sys::GST_GL_RG16,
GLFormat::Luminance => ffi::GST_GL_LUMINANCE,
GLFormat::Alpha => ffi::GST_GL_ALPHA,
GLFormat::LuminanceAlpha => ffi::GST_GL_LUMINANCE_ALPHA,
GLFormat::Red => ffi::GST_GL_RED,
GLFormat::R8 => ffi::GST_GL_R8,
GLFormat::Rg => ffi::GST_GL_RG,
GLFormat::Rg8 => ffi::GST_GL_RG8,
GLFormat::Rgb => ffi::GST_GL_RGB,
GLFormat::Rgb8 => ffi::GST_GL_RGB8,
GLFormat::Rgb565 => ffi::GST_GL_RGB565,
GLFormat::Rgb16 => ffi::GST_GL_RGB16,
GLFormat::Rgba => ffi::GST_GL_RGBA,
GLFormat::Rgba8 => ffi::GST_GL_RGBA8,
GLFormat::Rgba16 => ffi::GST_GL_RGBA16,
GLFormat::DepthComponent16 => ffi::GST_GL_DEPTH_COMPONENT16,
GLFormat::Depth24Stencil8 => ffi::GST_GL_DEPTH24_STENCIL8,
GLFormat::Rgb10A2 => ffi::GST_GL_RGB10_A2,
GLFormat::R16 => ffi::GST_GL_R16,
GLFormat::Rg16 => ffi::GST_GL_RG16,
GLFormat::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_gl_sys::GstGLFormat> for GLFormat {
fn from_glib(value: gst_gl_sys::GstGLFormat) -> Self {
impl FromGlib<ffi::GstGLFormat> for GLFormat {
fn from_glib(value: ffi::GstGLFormat) -> Self {
skip_assert_initialized!();
match value {
6409 => GLFormat::Luminance,
@ -198,7 +194,7 @@ impl FromGlib<gst_gl_sys::GstGLFormat> for GLFormat {
impl StaticType for GLFormat {
fn static_type() -> Type {
unsafe { from_glib(gst_gl_sys::gst_gl_format_get_type()) }
unsafe { from_glib(ffi::gst_gl_format_get_type()) }
}
}
@ -210,13 +206,13 @@ impl<'a> FromValueOptional<'a> for GLFormat {
impl<'a> FromValue<'a> for GLFormat {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl SetValue for GLFormat {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
@ -232,21 +228,21 @@ pub enum GLQueryType {
#[doc(hidden)]
impl ToGlib for GLQueryType {
type GlibType = gst_gl_sys::GstGLQueryType;
type GlibType = ffi::GstGLQueryType;
fn to_glib(&self) -> gst_gl_sys::GstGLQueryType {
fn to_glib(&self) -> ffi::GstGLQueryType {
match *self {
GLQueryType::None => gst_gl_sys::GST_GL_QUERY_NONE,
GLQueryType::TimeElapsed => gst_gl_sys::GST_GL_QUERY_TIME_ELAPSED,
GLQueryType::Timestamp => gst_gl_sys::GST_GL_QUERY_TIMESTAMP,
GLQueryType::None => ffi::GST_GL_QUERY_NONE,
GLQueryType::TimeElapsed => ffi::GST_GL_QUERY_TIME_ELAPSED,
GLQueryType::Timestamp => ffi::GST_GL_QUERY_TIMESTAMP,
GLQueryType::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_gl_sys::GstGLQueryType> for GLQueryType {
fn from_glib(value: gst_gl_sys::GstGLQueryType) -> Self {
impl FromGlib<ffi::GstGLQueryType> for GLQueryType {
fn from_glib(value: ffi::GstGLQueryType) -> Self {
skip_assert_initialized!();
match value {
0 => GLQueryType::None,
@ -259,7 +255,7 @@ impl FromGlib<gst_gl_sys::GstGLQueryType> for GLQueryType {
impl StaticType for GLQueryType {
fn static_type() -> Type {
unsafe { from_glib(gst_gl_sys::gst_gl_query_type_get_type()) }
unsafe { from_glib(ffi::gst_gl_query_type_get_type()) }
}
}
@ -271,13 +267,13 @@ impl<'a> FromValueOptional<'a> for GLQueryType {
impl<'a> FromValue<'a> for GLQueryType {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl SetValue for GLQueryType {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
@ -293,21 +289,21 @@ pub enum GLSLError {
#[doc(hidden)]
impl ToGlib for GLSLError {
type GlibType = gst_gl_sys::GstGLSLError;
type GlibType = ffi::GstGLSLError;
fn to_glib(&self) -> gst_gl_sys::GstGLSLError {
fn to_glib(&self) -> ffi::GstGLSLError {
match *self {
GLSLError::Compile => gst_gl_sys::GST_GLSL_ERROR_COMPILE,
GLSLError::Link => gst_gl_sys::GST_GLSL_ERROR_LINK,
GLSLError::Program => gst_gl_sys::GST_GLSL_ERROR_PROGRAM,
GLSLError::Compile => ffi::GST_GLSL_ERROR_COMPILE,
GLSLError::Link => ffi::GST_GLSL_ERROR_LINK,
GLSLError::Program => ffi::GST_GLSL_ERROR_PROGRAM,
GLSLError::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_gl_sys::GstGLSLError> for GLSLError {
fn from_glib(value: gst_gl_sys::GstGLSLError) -> Self {
impl FromGlib<ffi::GstGLSLError> for GLSLError {
fn from_glib(value: ffi::GstGLSLError) -> Self {
skip_assert_initialized!();
match value {
0 => GLSLError::Compile,
@ -322,7 +318,7 @@ impl ErrorDomain for GLSLError {
fn domain() -> Quark {
skip_assert_initialized!();
unsafe { from_glib(gst_gl_sys::gst_glsl_error_quark()) }
unsafe { from_glib(ffi::gst_glsl_error_quark()) }
}
fn code(self) -> i32 {
@ -342,7 +338,7 @@ impl ErrorDomain for GLSLError {
impl StaticType for GLSLError {
fn static_type() -> Type {
unsafe { from_glib(gst_gl_sys::gst_glsl_error_get_type()) }
unsafe { from_glib(ffi::gst_glsl_error_get_type()) }
}
}
@ -354,13 +350,13 @@ impl<'a> FromValueOptional<'a> for GLSLError {
impl<'a> FromValue<'a> for GLSLError {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl SetValue for GLSLError {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
@ -390,35 +386,35 @@ pub enum GLSLVersion {
#[doc(hidden)]
impl ToGlib for GLSLVersion {
type GlibType = gst_gl_sys::GstGLSLVersion;
type GlibType = ffi::GstGLSLVersion;
fn to_glib(&self) -> gst_gl_sys::GstGLSLVersion {
fn to_glib(&self) -> ffi::GstGLSLVersion {
match *self {
GLSLVersion::None => gst_gl_sys::GST_GLSL_VERSION_NONE,
GLSLVersion::_100 => gst_gl_sys::GST_GLSL_VERSION_100,
GLSLVersion::_110 => gst_gl_sys::GST_GLSL_VERSION_110,
GLSLVersion::_120 => gst_gl_sys::GST_GLSL_VERSION_120,
GLSLVersion::_130 => gst_gl_sys::GST_GLSL_VERSION_130,
GLSLVersion::_140 => gst_gl_sys::GST_GLSL_VERSION_140,
GLSLVersion::_150 => gst_gl_sys::GST_GLSL_VERSION_150,
GLSLVersion::_300 => gst_gl_sys::GST_GLSL_VERSION_300,
GLSLVersion::_310 => gst_gl_sys::GST_GLSL_VERSION_310,
GLSLVersion::_320 => gst_gl_sys::GST_GLSL_VERSION_320,
GLSLVersion::_330 => gst_gl_sys::GST_GLSL_VERSION_330,
GLSLVersion::_400 => gst_gl_sys::GST_GLSL_VERSION_400,
GLSLVersion::_410 => gst_gl_sys::GST_GLSL_VERSION_410,
GLSLVersion::_420 => gst_gl_sys::GST_GLSL_VERSION_420,
GLSLVersion::_430 => gst_gl_sys::GST_GLSL_VERSION_430,
GLSLVersion::_440 => gst_gl_sys::GST_GLSL_VERSION_440,
GLSLVersion::_450 => gst_gl_sys::GST_GLSL_VERSION_450,
GLSLVersion::None => ffi::GST_GLSL_VERSION_NONE,
GLSLVersion::_100 => ffi::GST_GLSL_VERSION_100,
GLSLVersion::_110 => ffi::GST_GLSL_VERSION_110,
GLSLVersion::_120 => ffi::GST_GLSL_VERSION_120,
GLSLVersion::_130 => ffi::GST_GLSL_VERSION_130,
GLSLVersion::_140 => ffi::GST_GLSL_VERSION_140,
GLSLVersion::_150 => ffi::GST_GLSL_VERSION_150,
GLSLVersion::_300 => ffi::GST_GLSL_VERSION_300,
GLSLVersion::_310 => ffi::GST_GLSL_VERSION_310,
GLSLVersion::_320 => ffi::GST_GLSL_VERSION_320,
GLSLVersion::_330 => ffi::GST_GLSL_VERSION_330,
GLSLVersion::_400 => ffi::GST_GLSL_VERSION_400,
GLSLVersion::_410 => ffi::GST_GLSL_VERSION_410,
GLSLVersion::_420 => ffi::GST_GLSL_VERSION_420,
GLSLVersion::_430 => ffi::GST_GLSL_VERSION_430,
GLSLVersion::_440 => ffi::GST_GLSL_VERSION_440,
GLSLVersion::_450 => ffi::GST_GLSL_VERSION_450,
GLSLVersion::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_gl_sys::GstGLSLVersion> for GLSLVersion {
fn from_glib(value: gst_gl_sys::GstGLSLVersion) -> Self {
impl FromGlib<ffi::GstGLSLVersion> for GLSLVersion {
fn from_glib(value: ffi::GstGLSLVersion) -> Self {
skip_assert_initialized!();
match value {
0 => GLSLVersion::None,
@ -445,7 +441,7 @@ impl FromGlib<gst_gl_sys::GstGLSLVersion> for GLSLVersion {
impl StaticType for GLSLVersion {
fn static_type() -> Type {
unsafe { from_glib(gst_gl_sys::gst_glsl_version_get_type()) }
unsafe { from_glib(ffi::gst_glsl_version_get_type()) }
}
}
@ -457,13 +453,13 @@ impl<'a> FromValueOptional<'a> for GLSLVersion {
impl<'a> FromValue<'a> for GLSLVersion {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl SetValue for GLSLVersion {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
@ -479,18 +475,16 @@ pub enum GLStereoDownmix {
#[doc(hidden)]
impl ToGlib for GLStereoDownmix {
type GlibType = gst_gl_sys::GstGLStereoDownmix;
type GlibType = ffi::GstGLStereoDownmix;
fn to_glib(&self) -> gst_gl_sys::GstGLStereoDownmix {
fn to_glib(&self) -> ffi::GstGLStereoDownmix {
match *self {
GLStereoDownmix::GreenMagentaDubois => {
gst_gl_sys::GST_GL_STEREO_DOWNMIX_ANAGLYPH_GREEN_MAGENTA_DUBOIS
}
GLStereoDownmix::RedCyanDubois => {
gst_gl_sys::GST_GL_STEREO_DOWNMIX_ANAGLYPH_RED_CYAN_DUBOIS
ffi::GST_GL_STEREO_DOWNMIX_ANAGLYPH_GREEN_MAGENTA_DUBOIS
}
GLStereoDownmix::RedCyanDubois => ffi::GST_GL_STEREO_DOWNMIX_ANAGLYPH_RED_CYAN_DUBOIS,
GLStereoDownmix::AmberBlueDubois => {
gst_gl_sys::GST_GL_STEREO_DOWNMIX_ANAGLYPH_AMBER_BLUE_DUBOIS
ffi::GST_GL_STEREO_DOWNMIX_ANAGLYPH_AMBER_BLUE_DUBOIS
}
GLStereoDownmix::__Unknown(value) => value,
}
@ -498,8 +492,8 @@ impl ToGlib for GLStereoDownmix {
}
#[doc(hidden)]
impl FromGlib<gst_gl_sys::GstGLStereoDownmix> for GLStereoDownmix {
fn from_glib(value: gst_gl_sys::GstGLStereoDownmix) -> Self {
impl FromGlib<ffi::GstGLStereoDownmix> for GLStereoDownmix {
fn from_glib(value: ffi::GstGLStereoDownmix) -> Self {
skip_assert_initialized!();
match value {
0 => GLStereoDownmix::GreenMagentaDubois,
@ -512,7 +506,7 @@ impl FromGlib<gst_gl_sys::GstGLStereoDownmix> for GLStereoDownmix {
impl StaticType for GLStereoDownmix {
fn static_type() -> Type {
unsafe { from_glib(gst_gl_sys::gst_gl_stereo_downmix_get_type()) }
unsafe { from_glib(ffi::gst_gl_stereo_downmix_get_type()) }
}
}
@ -524,13 +518,13 @@ impl<'a> FromValueOptional<'a> for GLStereoDownmix {
impl<'a> FromValue<'a> for GLStereoDownmix {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl SetValue for GLStereoDownmix {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
@ -547,22 +541,22 @@ pub enum GLTextureTarget {
#[doc(hidden)]
impl ToGlib for GLTextureTarget {
type GlibType = gst_gl_sys::GstGLTextureTarget;
type GlibType = ffi::GstGLTextureTarget;
fn to_glib(&self) -> gst_gl_sys::GstGLTextureTarget {
fn to_glib(&self) -> ffi::GstGLTextureTarget {
match *self {
GLTextureTarget::None => gst_gl_sys::GST_GL_TEXTURE_TARGET_NONE,
GLTextureTarget::_2d => gst_gl_sys::GST_GL_TEXTURE_TARGET_2D,
GLTextureTarget::Rectangle => gst_gl_sys::GST_GL_TEXTURE_TARGET_RECTANGLE,
GLTextureTarget::ExternalOes => gst_gl_sys::GST_GL_TEXTURE_TARGET_EXTERNAL_OES,
GLTextureTarget::None => ffi::GST_GL_TEXTURE_TARGET_NONE,
GLTextureTarget::_2d => ffi::GST_GL_TEXTURE_TARGET_2D,
GLTextureTarget::Rectangle => ffi::GST_GL_TEXTURE_TARGET_RECTANGLE,
GLTextureTarget::ExternalOes => ffi::GST_GL_TEXTURE_TARGET_EXTERNAL_OES,
GLTextureTarget::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_gl_sys::GstGLTextureTarget> for GLTextureTarget {
fn from_glib(value: gst_gl_sys::GstGLTextureTarget) -> Self {
impl FromGlib<ffi::GstGLTextureTarget> for GLTextureTarget {
fn from_glib(value: ffi::GstGLTextureTarget) -> Self {
skip_assert_initialized!();
match value {
0 => GLTextureTarget::None,
@ -576,7 +570,7 @@ impl FromGlib<gst_gl_sys::GstGLTextureTarget> for GLTextureTarget {
impl StaticType for GLTextureTarget {
fn static_type() -> Type {
unsafe { from_glib(gst_gl_sys::gst_gl_texture_target_get_type()) }
unsafe { from_glib(ffi::gst_gl_texture_target_get_type()) }
}
}
@ -588,13 +582,13 @@ impl<'a> FromValueOptional<'a> for GLTextureTarget {
impl<'a> FromValue<'a> for GLTextureTarget {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl SetValue for GLTextureTarget {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
@ -612,23 +606,23 @@ pub enum GLUploadReturn {
#[doc(hidden)]
impl ToGlib for GLUploadReturn {
type GlibType = gst_gl_sys::GstGLUploadReturn;
type GlibType = ffi::GstGLUploadReturn;
fn to_glib(&self) -> gst_gl_sys::GstGLUploadReturn {
fn to_glib(&self) -> ffi::GstGLUploadReturn {
match *self {
GLUploadReturn::Done => gst_gl_sys::GST_GL_UPLOAD_DONE,
GLUploadReturn::Error => gst_gl_sys::GST_GL_UPLOAD_ERROR,
GLUploadReturn::Unsupported => gst_gl_sys::GST_GL_UPLOAD_UNSUPPORTED,
GLUploadReturn::Reconfigure => gst_gl_sys::GST_GL_UPLOAD_RECONFIGURE,
GLUploadReturn::UnsharedGlContext => gst_gl_sys::GST_GL_UPLOAD_UNSHARED_GL_CONTEXT,
GLUploadReturn::Done => ffi::GST_GL_UPLOAD_DONE,
GLUploadReturn::Error => ffi::GST_GL_UPLOAD_ERROR,
GLUploadReturn::Unsupported => ffi::GST_GL_UPLOAD_UNSUPPORTED,
GLUploadReturn::Reconfigure => ffi::GST_GL_UPLOAD_RECONFIGURE,
GLUploadReturn::UnsharedGlContext => ffi::GST_GL_UPLOAD_UNSHARED_GL_CONTEXT,
GLUploadReturn::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_gl_sys::GstGLUploadReturn> for GLUploadReturn {
fn from_glib(value: gst_gl_sys::GstGLUploadReturn) -> Self {
impl FromGlib<ffi::GstGLUploadReturn> for GLUploadReturn {
fn from_glib(value: ffi::GstGLUploadReturn) -> Self {
skip_assert_initialized!();
match value {
1 => GLUploadReturn::Done,
@ -643,7 +637,7 @@ impl FromGlib<gst_gl_sys::GstGLUploadReturn> for GLUploadReturn {
impl StaticType for GLUploadReturn {
fn static_type() -> Type {
unsafe { from_glib(gst_gl_sys::gst_gl_upload_return_get_type()) }
unsafe { from_glib(ffi::gst_gl_upload_return_get_type()) }
}
}
@ -655,13 +649,13 @@ impl<'a> FromValueOptional<'a> for GLUploadReturn {
impl<'a> FromValue<'a> for GLUploadReturn {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl SetValue for GLUploadReturn {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
@ -677,23 +671,21 @@ pub enum GLWindowError {
#[doc(hidden)]
impl ToGlib for GLWindowError {
type GlibType = gst_gl_sys::GstGLWindowError;
type GlibType = ffi::GstGLWindowError;
fn to_glib(&self) -> gst_gl_sys::GstGLWindowError {
fn to_glib(&self) -> ffi::GstGLWindowError {
match *self {
GLWindowError::Failed => gst_gl_sys::GST_GL_WINDOW_ERROR_FAILED,
GLWindowError::OldLibs => gst_gl_sys::GST_GL_WINDOW_ERROR_OLD_LIBS,
GLWindowError::ResourceUnavailable => {
gst_gl_sys::GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE
}
GLWindowError::Failed => ffi::GST_GL_WINDOW_ERROR_FAILED,
GLWindowError::OldLibs => ffi::GST_GL_WINDOW_ERROR_OLD_LIBS,
GLWindowError::ResourceUnavailable => ffi::GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE,
GLWindowError::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_gl_sys::GstGLWindowError> for GLWindowError {
fn from_glib(value: gst_gl_sys::GstGLWindowError) -> Self {
impl FromGlib<ffi::GstGLWindowError> for GLWindowError {
fn from_glib(value: ffi::GstGLWindowError) -> Self {
skip_assert_initialized!();
match value {
0 => GLWindowError::Failed,
@ -708,7 +700,7 @@ impl ErrorDomain for GLWindowError {
fn domain() -> Quark {
skip_assert_initialized!();
unsafe { from_glib(gst_gl_sys::gst_gl_window_error_quark()) }
unsafe { from_glib(ffi::gst_gl_window_error_quark()) }
}
fn code(self) -> i32 {
@ -728,7 +720,7 @@ impl ErrorDomain for GLWindowError {
impl StaticType for GLWindowError {
fn static_type() -> Type {
unsafe { from_glib(gst_gl_sys::gst_gl_window_error_get_type()) }
unsafe { from_glib(ffi::gst_gl_window_error_get_type()) }
}
}
@ -740,12 +732,12 @@ impl<'a> FromValueOptional<'a> for GLWindowError {
impl<'a> FromValue<'a> for GLWindowError {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl SetValue for GLWindowError {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}

View file

@ -2,6 +2,7 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use bitflags::bitflags;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
@ -9,8 +10,6 @@ use glib::value::SetValue;
use glib::value::Value;
use glib::StaticType;
use glib::Type;
use gobject_sys;
use gst_gl_sys;
bitflags! {
pub struct GLAPI: u32 {
@ -23,16 +22,16 @@ bitflags! {
#[doc(hidden)]
impl ToGlib for GLAPI {
type GlibType = gst_gl_sys::GstGLAPI;
type GlibType = ffi::GstGLAPI;
fn to_glib(&self) -> gst_gl_sys::GstGLAPI {
fn to_glib(&self) -> ffi::GstGLAPI {
self.bits()
}
}
#[doc(hidden)]
impl FromGlib<gst_gl_sys::GstGLAPI> for GLAPI {
fn from_glib(value: gst_gl_sys::GstGLAPI) -> GLAPI {
impl FromGlib<ffi::GstGLAPI> for GLAPI {
fn from_glib(value: ffi::GstGLAPI) -> GLAPI {
skip_assert_initialized!();
GLAPI::from_bits_truncate(value)
}
@ -40,7 +39,7 @@ impl FromGlib<gst_gl_sys::GstGLAPI> for GLAPI {
impl StaticType for GLAPI {
fn static_type() -> Type {
unsafe { from_glib(gst_gl_sys::gst_gl_api_get_type()) }
unsafe { from_glib(ffi::gst_gl_api_get_type()) }
}
}
@ -52,13 +51,13 @@ impl<'a> FromValueOptional<'a> for GLAPI {
impl<'a> FromValue<'a> for GLAPI {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
}
}
impl SetValue for GLAPI {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
}
}
@ -80,16 +79,16 @@ bitflags! {
#[doc(hidden)]
impl ToGlib for GLDisplayType {
type GlibType = gst_gl_sys::GstGLDisplayType;
type GlibType = ffi::GstGLDisplayType;
fn to_glib(&self) -> gst_gl_sys::GstGLDisplayType {
fn to_glib(&self) -> ffi::GstGLDisplayType {
self.bits()
}
}
#[doc(hidden)]
impl FromGlib<gst_gl_sys::GstGLDisplayType> for GLDisplayType {
fn from_glib(value: gst_gl_sys::GstGLDisplayType) -> GLDisplayType {
impl FromGlib<ffi::GstGLDisplayType> for GLDisplayType {
fn from_glib(value: ffi::GstGLDisplayType) -> GLDisplayType {
skip_assert_initialized!();
GLDisplayType::from_bits_truncate(value)
}
@ -97,7 +96,7 @@ impl FromGlib<gst_gl_sys::GstGLDisplayType> for GLDisplayType {
impl StaticType for GLDisplayType {
fn static_type() -> Type {
unsafe { from_glib(gst_gl_sys::gst_gl_display_type_get_type()) }
unsafe { from_glib(ffi::gst_gl_display_type_get_type()) }
}
}
@ -109,13 +108,13 @@ impl<'a> FromValueOptional<'a> for GLDisplayType {
impl<'a> FromValue<'a> for GLDisplayType {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
}
}
impl SetValue for GLDisplayType {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
}
}
@ -131,16 +130,16 @@ bitflags! {
#[doc(hidden)]
impl ToGlib for GLPlatform {
type GlibType = gst_gl_sys::GstGLPlatform;
type GlibType = ffi::GstGLPlatform;
fn to_glib(&self) -> gst_gl_sys::GstGLPlatform {
fn to_glib(&self) -> ffi::GstGLPlatform {
self.bits()
}
}
#[doc(hidden)]
impl FromGlib<gst_gl_sys::GstGLPlatform> for GLPlatform {
fn from_glib(value: gst_gl_sys::GstGLPlatform) -> GLPlatform {
impl FromGlib<ffi::GstGLPlatform> for GLPlatform {
fn from_glib(value: ffi::GstGLPlatform) -> GLPlatform {
skip_assert_initialized!();
GLPlatform::from_bits_truncate(value)
}
@ -148,7 +147,7 @@ impl FromGlib<gst_gl_sys::GstGLPlatform> for GLPlatform {
impl StaticType for GLPlatform {
fn static_type() -> Type {
unsafe { from_glib(gst_gl_sys::gst_gl_platform_get_type()) }
unsafe { from_glib(ffi::gst_gl_platform_get_type()) }
}
}
@ -160,13 +159,13 @@ impl<'a> FromValueOptional<'a> for GLPlatform {
impl<'a> FromValue<'a> for GLPlatform {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
}
}
impl SetValue for GLPlatform {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
}
}
@ -180,16 +179,16 @@ bitflags! {
#[doc(hidden)]
impl ToGlib for GLSLProfile {
type GlibType = gst_gl_sys::GstGLSLProfile;
type GlibType = ffi::GstGLSLProfile;
fn to_glib(&self) -> gst_gl_sys::GstGLSLProfile {
fn to_glib(&self) -> ffi::GstGLSLProfile {
self.bits()
}
}
#[doc(hidden)]
impl FromGlib<gst_gl_sys::GstGLSLProfile> for GLSLProfile {
fn from_glib(value: gst_gl_sys::GstGLSLProfile) -> GLSLProfile {
impl FromGlib<ffi::GstGLSLProfile> for GLSLProfile {
fn from_glib(value: ffi::GstGLSLProfile) -> GLSLProfile {
skip_assert_initialized!();
GLSLProfile::from_bits_truncate(value)
}
@ -197,7 +196,7 @@ impl FromGlib<gst_gl_sys::GstGLSLProfile> for GLSLProfile {
impl StaticType for GLSLProfile {
fn static_type() -> Type {
unsafe { from_glib(gst_gl_sys::gst_glsl_profile_get_type()) }
unsafe { from_glib(ffi::gst_glsl_profile_get_type()) }
}
}
@ -209,12 +208,12 @@ impl<'a> FromValueOptional<'a> for GLSLProfile {
impl<'a> FromValue<'a> for GLSLProfile {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
}
}
impl SetValue for GLSLProfile {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
}
}

View file

@ -2,6 +2,7 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use crate::GLContext;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::connect_raw;
@ -9,19 +10,14 @@ use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::Value;
use glib_sys;
use gobject_sys;
use gst;
use gst_gl_sys;
use std::boxed::Box as Box_;
use std::mem::transmute;
use GLContext;
glib_wrapper! {
pub struct GLBaseFilter(Object<gst_gl_sys::GstGLBaseFilter, gst_gl_sys::GstGLBaseFilterClass>) @extends gst::Object;
glib::glib_wrapper! {
pub struct GLBaseFilter(Object<ffi::GstGLBaseFilter, ffi::GstGLBaseFilterClass>) @extends gst::Object;
match fn {
get_type => || gst_gl_sys::gst_gl_base_filter_get_type(),
get_type => || ffi::gst_gl_base_filter_get_type(),
}
}
@ -52,7 +48,7 @@ impl<O: IsA<GLBaseFilter>> GLBaseFilterExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn find_gl_context(&self) -> bool {
unsafe {
from_glib(gst_gl_sys::gst_gl_base_filter_find_gl_context(
from_glib(ffi::gst_gl_base_filter_find_gl_context(
self.as_ref().to_glib_none().0,
))
}
@ -62,7 +58,7 @@ impl<O: IsA<GLBaseFilter>> GLBaseFilterExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
fn get_gl_context(&self) -> Option<GLContext> {
unsafe {
from_glib_full(gst_gl_sys::gst_gl_base_filter_get_gl_context(
from_glib_full(ffi::gst_gl_base_filter_get_gl_context(
self.as_ref().to_glib_none().0,
))
}
@ -71,8 +67,8 @@ impl<O: IsA<GLBaseFilter>> GLBaseFilterExt for O {
fn get_property_context(&self) -> Option<GLContext> {
unsafe {
let mut value = Value::from_type(<GLContext as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"context\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
@ -87,9 +83,9 @@ impl<O: IsA<GLBaseFilter>> GLBaseFilterExt for O {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_context_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_gl_sys::GstGLBaseFilter,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstGLBaseFilter,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<GLBaseFilter>,
{

View file

@ -2,18 +2,15 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib;
use crate::GLContext;
use glib::object::IsA;
use glib::translate::*;
use gst;
use gst_gl_sys;
use GLContext;
glib_wrapper! {
pub struct GLColorConvert(Object<gst_gl_sys::GstGLColorConvert, gst_gl_sys::GstGLColorConvertClass>) @extends gst::Object;
glib::glib_wrapper! {
pub struct GLColorConvert(Object<ffi::GstGLColorConvert, ffi::GstGLColorConvertClass>) @extends gst::Object;
match fn {
get_type => || gst_gl_sys::gst_gl_color_convert_get_type(),
get_type => || ffi::gst_gl_color_convert_get_type(),
}
}
@ -21,7 +18,7 @@ impl GLColorConvert {
pub fn new<P: IsA<GLContext>>(context: &P) -> GLColorConvert {
skip_assert_initialized!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_color_convert_new(
from_glib_full(ffi::gst_gl_color_convert_new(
context.as_ref().to_glib_none().0,
))
}
@ -33,8 +30,8 @@ impl GLColorConvert {
out_caps: &gst::Caps,
) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(
gst_gl_sys::gst_gl_color_convert_set_caps(
glib::glib_result_from_gboolean!(
ffi::gst_gl_color_convert_set_caps(
self.to_glib_none().0,
in_caps.to_glib_none().0,
out_caps.to_glib_none().0
@ -52,7 +49,7 @@ impl GLColorConvert {
) -> Option<gst::Caps> {
skip_assert_initialized!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_color_convert_transform_caps(
from_glib_full(ffi::gst_gl_color_convert_transform_caps(
context.as_ref().to_glib_none().0,
direction.to_glib(),
caps.to_glib_none().0,

View file

@ -2,41 +2,34 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib;
use crate::GLDisplay;
use crate::GLPlatform;
use crate::GLSLProfile;
use crate::GLSLVersion;
use crate::GLWindow;
use crate::GLAPI;
use glib::object::IsA;
use glib::translate::*;
use gst;
use gst_gl_sys;
use std::mem;
use std::ptr;
use GLDisplay;
use GLPlatform;
use GLSLProfile;
use GLSLVersion;
use GLWindow;
use GLAPI;
glib_wrapper! {
pub struct GLContext(Object<gst_gl_sys::GstGLContext, gst_gl_sys::GstGLContextClass>) @extends gst::Object;
glib::glib_wrapper! {
pub struct GLContext(Object<ffi::GstGLContext, ffi::GstGLContextClass>) @extends gst::Object;
match fn {
get_type => || gst_gl_sys::gst_gl_context_get_type(),
get_type => || ffi::gst_gl_context_get_type(),
}
}
impl GLContext {
pub fn new<P: IsA<GLDisplay>>(display: &P) -> GLContext {
skip_assert_initialized!();
unsafe {
from_glib_none(gst_gl_sys::gst_gl_context_new(
display.as_ref().to_glib_none().0,
))
}
unsafe { from_glib_none(ffi::gst_gl_context_new(display.as_ref().to_glib_none().0)) }
}
pub fn get_current() -> Option<GLContext> {
assert_initialized_main_thread!();
unsafe { from_glib_none(gst_gl_sys::gst_gl_context_get_current()) }
unsafe { from_glib_none(ffi::gst_gl_context_get_current()) }
}
pub fn get_current_gl_api(platform: GLPlatform) -> (GLAPI, u32, u32) {
@ -44,7 +37,7 @@ impl GLContext {
unsafe {
let mut major = mem::MaybeUninit::uninit();
let mut minor = mem::MaybeUninit::uninit();
let ret = from_glib(gst_gl_sys::gst_gl_context_get_current_gl_api(
let ret = from_glib(ffi::gst_gl_context_get_current_gl_api(
platform.to_glib(),
major.as_mut_ptr(),
minor.as_mut_ptr(),
@ -116,11 +109,8 @@ pub trait GLContextExt: 'static {
impl<O: IsA<GLContext>> GLContextExt for O {
fn activate(&self, activate: bool) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(
gst_gl_sys::gst_gl_context_activate(
self.as_ref().to_glib_none().0,
activate.to_glib()
),
glib::glib_result_from_gboolean!(
ffi::gst_gl_context_activate(self.as_ref().to_glib_none().0, activate.to_glib()),
"Failed to activate OpenGL context"
)
}
@ -128,7 +118,7 @@ impl<O: IsA<GLContext>> GLContextExt for O {
fn can_share<P: IsA<GLContext>>(&self, other_context: &P) -> bool {
unsafe {
from_glib(gst_gl_sys::gst_gl_context_can_share(
from_glib(ffi::gst_gl_context_can_share(
self.as_ref().to_glib_none().0,
other_context.as_ref().to_glib_none().0,
))
@ -137,7 +127,7 @@ impl<O: IsA<GLContext>> GLContextExt for O {
fn check_feature(&self, feature: &str) -> bool {
unsafe {
from_glib(gst_gl_sys::gst_gl_context_check_feature(
from_glib(ffi::gst_gl_context_check_feature(
self.as_ref().to_glib_none().0,
feature.to_glib_none().0,
))
@ -146,7 +136,7 @@ impl<O: IsA<GLContext>> GLContextExt for O {
fn check_framebuffer_status(&self, fbo_target: u32) -> bool {
unsafe {
from_glib(gst_gl_sys::gst_gl_context_check_framebuffer_status(
from_glib(ffi::gst_gl_context_check_framebuffer_status(
self.as_ref().to_glib_none().0,
fbo_target,
))
@ -155,7 +145,7 @@ impl<O: IsA<GLContext>> GLContextExt for O {
fn check_gl_version(&self, api: GLAPI, maj: i32, min: i32) -> bool {
unsafe {
from_glib(gst_gl_sys::gst_gl_context_check_gl_version(
from_glib(ffi::gst_gl_context_check_gl_version(
self.as_ref().to_glib_none().0,
api.to_glib(),
maj,
@ -166,20 +156,20 @@ impl<O: IsA<GLContext>> GLContextExt for O {
fn clear_framebuffer(&self) {
unsafe {
gst_gl_sys::gst_gl_context_clear_framebuffer(self.as_ref().to_glib_none().0);
ffi::gst_gl_context_clear_framebuffer(self.as_ref().to_glib_none().0);
}
}
fn clear_shader(&self) {
unsafe {
gst_gl_sys::gst_gl_context_clear_shader(self.as_ref().to_glib_none().0);
ffi::gst_gl_context_clear_shader(self.as_ref().to_glib_none().0);
}
}
fn create<P: IsA<GLContext>>(&self, other_context: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = gst_gl_sys::gst_gl_context_create(
let _ = ffi::gst_gl_context_create(
self.as_ref().to_glib_none().0,
other_context.map(|p| p.as_ref()).to_glib_none().0,
&mut error,
@ -194,15 +184,14 @@ impl<O: IsA<GLContext>> GLContextExt for O {
fn destroy(&self) {
unsafe {
gst_gl_sys::gst_gl_context_destroy(self.as_ref().to_glib_none().0);
ffi::gst_gl_context_destroy(self.as_ref().to_glib_none().0);
}
}
fn fill_info(&self) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ =
gst_gl_sys::gst_gl_context_fill_info(self.as_ref().to_glib_none().0, &mut error);
let _ = ffi::gst_gl_context_fill_info(self.as_ref().to_glib_none().0, &mut error);
if error.is_null() {
Ok(())
} else {
@ -213,7 +202,7 @@ impl<O: IsA<GLContext>> GLContextExt for O {
fn get_display(&self) -> GLDisplay {
unsafe {
from_glib_full(gst_gl_sys::gst_gl_context_get_display(
from_glib_full(ffi::gst_gl_context_get_display(
self.as_ref().to_glib_none().0,
))
}
@ -221,7 +210,7 @@ impl<O: IsA<GLContext>> GLContextExt for O {
fn get_gl_api(&self) -> GLAPI {
unsafe {
from_glib(gst_gl_sys::gst_gl_context_get_gl_api(
from_glib(ffi::gst_gl_context_get_gl_api(
self.as_ref().to_glib_none().0,
))
}
@ -229,7 +218,7 @@ impl<O: IsA<GLContext>> GLContextExt for O {
fn get_gl_platform(&self) -> GLPlatform {
unsafe {
from_glib(gst_gl_sys::gst_gl_context_get_gl_platform(
from_glib(ffi::gst_gl_context_get_gl_platform(
self.as_ref().to_glib_none().0,
))
}
@ -239,7 +228,7 @@ impl<O: IsA<GLContext>> GLContextExt for O {
unsafe {
let mut major = mem::MaybeUninit::uninit();
let mut minor = mem::MaybeUninit::uninit();
gst_gl_sys::gst_gl_context_get_gl_platform_version(
ffi::gst_gl_context_get_gl_platform_version(
self.as_ref().to_glib_none().0,
major.as_mut_ptr(),
minor.as_mut_ptr(),
@ -254,7 +243,7 @@ impl<O: IsA<GLContext>> GLContextExt for O {
unsafe {
let mut maj = mem::MaybeUninit::uninit();
let mut min = mem::MaybeUninit::uninit();
gst_gl_sys::gst_gl_context_get_gl_version(
ffi::gst_gl_context_get_gl_version(
self.as_ref().to_glib_none().0,
maj.as_mut_ptr(),
min.as_mut_ptr(),
@ -267,7 +256,7 @@ impl<O: IsA<GLContext>> GLContextExt for O {
fn get_window(&self) -> Option<GLWindow> {
unsafe {
from_glib_full(gst_gl_sys::gst_gl_context_get_window(
from_glib_full(ffi::gst_gl_context_get_window(
self.as_ref().to_glib_none().0,
))
}
@ -275,7 +264,7 @@ impl<O: IsA<GLContext>> GLContextExt for O {
fn is_shared(&self) -> bool {
unsafe {
from_glib(gst_gl_sys::gst_gl_context_is_shared(
from_glib(ffi::gst_gl_context_is_shared(
self.as_ref().to_glib_none().0,
))
}
@ -283,7 +272,7 @@ impl<O: IsA<GLContext>> GLContextExt for O {
fn set_shared_with<P: IsA<GLContext>>(&self, share: &P) {
unsafe {
gst_gl_sys::gst_gl_context_set_shared_with(
ffi::gst_gl_context_set_shared_with(
self.as_ref().to_glib_none().0,
share.as_ref().to_glib_none().0,
);
@ -292,8 +281,8 @@ impl<O: IsA<GLContext>> GLContextExt for O {
fn set_window<P: IsA<GLWindow>>(&self, window: &P) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(
gst_gl_sys::gst_gl_context_set_window(
glib::glib_result_from_gboolean!(
ffi::gst_gl_context_set_window(
self.as_ref().to_glib_none().0,
window.as_ref().to_glib_full()
),
@ -304,7 +293,7 @@ impl<O: IsA<GLContext>> GLContextExt for O {
fn supports_glsl_profile_version(&self, version: GLSLVersion, profile: GLSLProfile) -> bool {
unsafe {
from_glib(gst_gl_sys::gst_gl_context_supports_glsl_profile_version(
from_glib(ffi::gst_gl_context_supports_glsl_profile_version(
self.as_ref().to_glib_none().0,
version.to_glib(),
profile.to_glib(),
@ -316,7 +305,7 @@ impl<O: IsA<GLContext>> GLContextExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn supports_precision(&self, version: GLSLVersion, profile: GLSLProfile) -> bool {
unsafe {
from_glib(gst_gl_sys::gst_gl_context_supports_precision(
from_glib(ffi::gst_gl_context_supports_precision(
self.as_ref().to_glib_none().0,
version.to_glib(),
profile.to_glib(),
@ -328,7 +317,7 @@ impl<O: IsA<GLContext>> GLContextExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn supports_precision_highp(&self, version: GLSLVersion, profile: GLSLProfile) -> bool {
unsafe {
from_glib(gst_gl_sys::gst_gl_context_supports_precision_highp(
from_glib(ffi::gst_gl_context_supports_precision_highp(
self.as_ref().to_glib_none().0,
version.to_glib(),
profile.to_glib(),
@ -338,7 +327,7 @@ impl<O: IsA<GLContext>> GLContextExt for O {
fn swap_buffers(&self) {
unsafe {
gst_gl_sys::gst_gl_context_swap_buffers(self.as_ref().to_glib_none().0);
ffi::gst_gl_context_swap_buffers(self.as_ref().to_glib_none().0);
}
}
}

View file

@ -2,35 +2,31 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib;
use crate::GLContext;
use crate::GLDisplayType;
use crate::GLWindow;
use crate::GLAPI;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib_sys;
use gst;
use gst_gl_sys;
use std::boxed::Box as Box_;
use std::mem::transmute;
use std::ptr;
use GLContext;
use GLDisplayType;
use GLWindow;
use GLAPI;
glib_wrapper! {
pub struct GLDisplay(Object<gst_gl_sys::GstGLDisplay, gst_gl_sys::GstGLDisplayClass>) @extends gst::Object;
glib::glib_wrapper! {
pub struct GLDisplay(Object<ffi::GstGLDisplay, ffi::GstGLDisplayClass>) @extends gst::Object;
match fn {
get_type => || gst_gl_sys::gst_gl_display_get_type(),
get_type => || ffi::gst_gl_display_get_type(),
}
}
impl GLDisplay {
pub fn new() -> GLDisplay {
assert_initialized_main_thread!();
unsafe { from_glib_full(gst_gl_sys::gst_gl_display_new()) }
unsafe { from_glib_full(ffi::gst_gl_display_new()) }
}
}
@ -82,8 +78,8 @@ pub trait GLDisplayExt: 'static {
impl<O: IsA<GLDisplay>> GLDisplayExt for O {
fn add_context<P: IsA<GLContext>>(&self, context: &P) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(
gst_gl_sys::gst_gl_display_add_context(
glib::glib_result_from_gboolean!(
ffi::gst_gl_display_add_context(
self.as_ref().to_glib_none().0,
context.as_ref().to_glib_none().0
),
@ -99,7 +95,7 @@ impl<O: IsA<GLDisplay>> GLDisplayExt for O {
unsafe {
let mut p_context = ptr::null_mut();
let mut error = ptr::null_mut();
let _ = gst_gl_sys::gst_gl_display_create_context(
let _ = ffi::gst_gl_display_create_context(
self.as_ref().to_glib_none().0,
other_context.as_ref().to_glib_none().0,
&mut p_context,
@ -115,25 +111,22 @@ impl<O: IsA<GLDisplay>> GLDisplayExt for O {
fn create_window(&self) -> Result<GLWindow, glib::BoolError> {
unsafe {
Option::<_>::from_glib_full(gst_gl_sys::gst_gl_display_create_window(
Option::<_>::from_glib_full(ffi::gst_gl_display_create_window(
self.as_ref().to_glib_none().0,
))
.ok_or_else(|| glib_bool_error!("Failed to create window"))
.ok_or_else(|| glib::glib_bool_error!("Failed to create window"))
}
}
fn filter_gl_api(&self, gl_api: GLAPI) {
unsafe {
gst_gl_sys::gst_gl_display_filter_gl_api(
self.as_ref().to_glib_none().0,
gl_api.to_glib(),
);
ffi::gst_gl_display_filter_gl_api(self.as_ref().to_glib_none().0, gl_api.to_glib());
}
}
fn get_gl_api(&self) -> GLAPI {
unsafe {
from_glib(gst_gl_sys::gst_gl_display_get_gl_api(
from_glib(ffi::gst_gl_display_get_gl_api(
self.as_ref().to_glib_none().0,
))
}
@ -141,7 +134,7 @@ impl<O: IsA<GLDisplay>> GLDisplayExt for O {
fn get_gl_api_unlocked(&self) -> GLAPI {
unsafe {
from_glib(gst_gl_sys::gst_gl_display_get_gl_api_unlocked(
from_glib(ffi::gst_gl_display_get_gl_api_unlocked(
self.as_ref().to_glib_none().0,
))
}
@ -149,7 +142,7 @@ impl<O: IsA<GLDisplay>> GLDisplayExt for O {
fn get_handle_type(&self) -> GLDisplayType {
unsafe {
from_glib(gst_gl_sys::gst_gl_display_get_handle_type(
from_glib(ffi::gst_gl_display_get_handle_type(
self.as_ref().to_glib_none().0,
))
}
@ -159,7 +152,7 @@ impl<O: IsA<GLDisplay>> GLDisplayExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
fn remove_context<P: IsA<GLContext>>(&self, context: &P) {
unsafe {
gst_gl_sys::gst_gl_display_remove_context(
ffi::gst_gl_display_remove_context(
self.as_ref().to_glib_none().0,
context.as_ref().to_glib_none().0,
);
@ -168,8 +161,8 @@ impl<O: IsA<GLDisplay>> GLDisplayExt for O {
fn remove_window<P: IsA<GLWindow>>(&self, window: &P) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(
gst_gl_sys::gst_gl_display_remove_window(
glib::glib_result_from_gboolean!(
ffi::gst_gl_display_remove_window(
self.as_ref().to_glib_none().0,
window.as_ref().to_glib_none().0
),
@ -181,7 +174,7 @@ impl<O: IsA<GLDisplay>> GLDisplayExt for O {
//#[cfg(any(feature = "v1_18", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
//fn retrieve_window(&self, data: /*Unimplemented*/Option<Fundamental: Pointer>, compare_func: /*Unimplemented*/FnMut(/*Unimplemented*/Option<Fundamental: Pointer>, /*Unimplemented*/Option<Fundamental: Pointer>) -> i32) -> Option<GLWindow> {
// unsafe { TODO: call gst_gl_sys:gst_gl_display_retrieve_window() }
// unsafe { TODO: call ffi:gst_gl_display_retrieve_window() }
//}
fn connect_create_context<F: Fn(&Self, &GLContext) -> GLContext + Send + Sync + 'static>(
@ -192,10 +185,10 @@ impl<O: IsA<GLDisplay>> GLDisplayExt for O {
P,
F: Fn(&P, &GLContext) -> GLContext + Send + Sync + 'static,
>(
this: *mut gst_gl_sys::GstGLDisplay,
context: *mut gst_gl_sys::GstGLContext,
f: glib_sys::gpointer,
) -> *mut gst_gl_sys::GstGLContext
this: *mut ffi::GstGLDisplay,
context: *mut ffi::GstGLContext,
f: glib::ffi::gpointer,
) -> *mut ffi::GstGLContext
where
P: IsA<GLDisplay>,
{

View file

@ -2,41 +2,39 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use crate::GLDisplay;
use glib::object::IsA;
use glib::translate::*;
use gst;
use gst_gl_sys;
use GLDisplay;
glib_wrapper! {
pub struct GLDisplayEGL(Object<gst_gl_sys::GstGLDisplayEGL, gst_gl_sys::GstGLDisplayEGLClass>) @extends GLDisplay, gst::Object;
glib::glib_wrapper! {
pub struct GLDisplayEGL(Object<ffi::GstGLDisplayEGL, ffi::GstGLDisplayEGLClass>) @extends GLDisplay, gst::Object;
match fn {
get_type => || gst_gl_sys::gst_gl_display_egl_get_type(),
get_type => || ffi::gst_gl_display_egl_get_type(),
}
}
impl GLDisplayEGL {
pub fn new() -> GLDisplayEGL {
assert_initialized_main_thread!();
unsafe { from_glib_full(gst_gl_sys::gst_gl_display_egl_new()) }
unsafe { from_glib_full(ffi::gst_gl_display_egl_new()) }
}
//pub fn with_egl_display(display: /*Unimplemented*/Option<Fundamental: Pointer>) -> GLDisplayEGL {
// unsafe { TODO: call gst_gl_sys:gst_gl_display_egl_new_with_egl_display() }
// unsafe { TODO: call ffi:gst_gl_display_egl_new_with_egl_display() }
//}
pub fn from_gl_display<P: IsA<GLDisplay>>(display: &P) -> Option<GLDisplayEGL> {
skip_assert_initialized!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_display_egl_from_gl_display(
from_glib_full(ffi::gst_gl_display_egl_from_gl_display(
display.as_ref().to_glib_none().0,
))
}
}
//pub fn get_from_native(type_: GLDisplayType, display: /*Unimplemented*/Fundamental: UIntPtr) -> /*Unimplemented*/Option<Fundamental: Pointer> {
// unsafe { TODO: call gst_gl_sys:gst_gl_display_egl_get_from_native() }
// unsafe { TODO: call ffi:gst_gl_display_egl_get_from_native() }
//}
}

View file

@ -2,31 +2,25 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use crate::GLDisplay;
use glib::translate::*;
use gst;
use gst_gl_sys;
use GLDisplay;
glib_wrapper! {
pub struct GLDisplayWayland(Object<gst_gl_sys::GstGLDisplayWayland, gst_gl_sys::GstGLDisplayWaylandClass>) @extends GLDisplay, gst::Object;
glib::glib_wrapper! {
pub struct GLDisplayWayland(Object<ffi::GstGLDisplayWayland, ffi::GstGLDisplayWaylandClass>) @extends GLDisplay, gst::Object;
match fn {
get_type => || gst_gl_sys::gst_gl_display_wayland_get_type(),
get_type => || ffi::gst_gl_display_wayland_get_type(),
}
}
impl GLDisplayWayland {
pub fn new(name: Option<&str>) -> GLDisplayWayland {
assert_initialized_main_thread!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_display_wayland_new(
name.to_glib_none().0,
))
}
unsafe { from_glib_full(ffi::gst_gl_display_wayland_new(name.to_glib_none().0)) }
}
//pub fn with_display(display: /*Unimplemented*/Option<Fundamental: Pointer>) -> GLDisplayWayland {
// unsafe { TODO: call gst_gl_sys:gst_gl_display_wayland_new_with_display() }
// unsafe { TODO: call ffi:gst_gl_display_wayland_new_with_display() }
//}
}

View file

@ -2,27 +2,25 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use crate::GLDisplay;
use glib::translate::*;
use gst;
use gst_gl_sys;
use GLDisplay;
glib_wrapper! {
pub struct GLDisplayX11(Object<gst_gl_sys::GstGLDisplayX11, gst_gl_sys::GstGLDisplayX11Class>) @extends GLDisplay, gst::Object;
glib::glib_wrapper! {
pub struct GLDisplayX11(Object<ffi::GstGLDisplayX11, ffi::GstGLDisplayX11Class>) @extends GLDisplay, gst::Object;
match fn {
get_type => || gst_gl_sys::gst_gl_display_x11_get_type(),
get_type => || ffi::gst_gl_display_x11_get_type(),
}
}
impl GLDisplayX11 {
pub fn new(name: Option<&str>) -> GLDisplayX11 {
assert_initialized_main_thread!();
unsafe { from_glib_full(gst_gl_sys::gst_gl_display_x11_new(name.to_glib_none().0)) }
unsafe { from_glib_full(ffi::gst_gl_display_x11_new(name.to_glib_none().0)) }
}
//pub fn with_display(display: /*Unimplemented*/Fundamental: Pointer) -> GLDisplayX11 {
// unsafe { TODO: call gst_gl_sys:gst_gl_display_x11_new_with_display() }
// unsafe { TODO: call ffi:gst_gl_display_x11_new_with_display() }
//}
}

View file

@ -2,18 +2,16 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use crate::GLContext;
use glib::object::IsA;
use glib::translate::*;
use gst;
use gst_gl_sys;
use std::mem;
use GLContext;
glib_wrapper! {
pub struct GLFramebuffer(Object<gst_gl_sys::GstGLFramebuffer, gst_gl_sys::GstGLFramebufferClass>) @extends gst::Object;
glib::glib_wrapper! {
pub struct GLFramebuffer(Object<ffi::GstGLFramebuffer, ffi::GstGLFramebufferClass>) @extends gst::Object;
match fn {
get_type => || gst_gl_sys::gst_gl_framebuffer_get_type(),
get_type => || ffi::gst_gl_framebuffer_get_type(),
}
}
@ -21,7 +19,7 @@ impl GLFramebuffer {
pub fn new<P: IsA<GLContext>>(context: &P) -> GLFramebuffer {
skip_assert_initialized!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_framebuffer_new(
from_glib_full(ffi::gst_gl_framebuffer_new(
context.as_ref().to_glib_none().0,
))
}
@ -34,7 +32,7 @@ impl GLFramebuffer {
) -> GLFramebuffer {
skip_assert_initialized!();
unsafe {
from_glib_none(gst_gl_sys::gst_gl_framebuffer_new_with_default_depth(
from_glib_none(ffi::gst_gl_framebuffer_new_with_default_depth(
context.as_ref().to_glib_none().0,
width,
height,
@ -62,24 +60,24 @@ pub trait GLFramebufferExt: 'static {
impl<O: IsA<GLFramebuffer>> GLFramebufferExt for O {
//fn attach(&self, attachment_point: u32, mem: /*Ignored*/&mut GLBaseMemory) {
// unsafe { TODO: call gst_gl_sys:gst_gl_framebuffer_attach() }
// unsafe { TODO: call ffi:gst_gl_framebuffer_attach() }
//}
fn bind(&self) {
unsafe {
gst_gl_sys::gst_gl_framebuffer_bind(self.as_ref().to_glib_none().0);
ffi::gst_gl_framebuffer_bind(self.as_ref().to_glib_none().0);
}
}
//fn draw_to_texture(&self, mem: /*Ignored*/&mut GLMemory, func: /*Unimplemented*/FnMut(/*Unimplemented*/Option<Fundamental: Pointer>) -> bool, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> bool {
// unsafe { TODO: call gst_gl_sys:gst_gl_framebuffer_draw_to_texture() }
// unsafe { TODO: call ffi:gst_gl_framebuffer_draw_to_texture() }
//}
fn get_effective_dimensions(&self) -> (u32, u32) {
unsafe {
let mut width = mem::MaybeUninit::uninit();
let mut height = mem::MaybeUninit::uninit();
gst_gl_sys::gst_gl_framebuffer_get_effective_dimensions(
ffi::gst_gl_framebuffer_get_effective_dimensions(
self.as_ref().to_glib_none().0,
width.as_mut_ptr(),
height.as_mut_ptr(),
@ -91,6 +89,6 @@ impl<O: IsA<GLFramebuffer>> GLFramebufferExt for O {
}
fn get_id(&self) -> u32 {
unsafe { gst_gl_sys::gst_gl_framebuffer_get_id(self.as_ref().to_glib_none().0) }
unsafe { ffi::gst_gl_framebuffer_get_id(self.as_ref().to_glib_none().0) }
}
}

View file

@ -2,6 +2,7 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use crate::GLContext;
use glib::object::IsA;
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
@ -21,25 +22,16 @@ use glib::StaticType;
use glib::Value;
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
use glib_sys;
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
use gobject_sys;
use gst;
use gst_gl_sys;
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
use std::boxed::Box as Box_;
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
use std::mem::transmute;
use GLContext;
glib_wrapper! {
pub struct GLOverlayCompositor(Object<gst_gl_sys::GstGLOverlayCompositor, gst_gl_sys::GstGLOverlayCompositorClass>) @extends gst::Object;
glib::glib_wrapper! {
pub struct GLOverlayCompositor(Object<ffi::GstGLOverlayCompositor, ffi::GstGLOverlayCompositorClass>) @extends gst::Object;
match fn {
get_type => || gst_gl_sys::gst_gl_overlay_compositor_get_type(),
get_type => || ffi::gst_gl_overlay_compositor_get_type(),
}
}
@ -47,7 +39,7 @@ impl GLOverlayCompositor {
pub fn new<P: IsA<GLContext>>(context: &P) -> GLOverlayCompositor {
skip_assert_initialized!();
unsafe {
from_glib_none(gst_gl_sys::gst_gl_overlay_compositor_new(
from_glib_none(ffi::gst_gl_overlay_compositor_new(
context.as_ref().to_glib_none().0,
))
}
@ -55,13 +47,13 @@ impl GLOverlayCompositor {
pub fn draw_overlays(&self) {
unsafe {
gst_gl_sys::gst_gl_overlay_compositor_draw_overlays(self.to_glib_none().0);
ffi::gst_gl_overlay_compositor_draw_overlays(self.to_glib_none().0);
}
}
pub fn free_overlays(&self) {
unsafe {
gst_gl_sys::gst_gl_overlay_compositor_free_overlays(self.to_glib_none().0);
ffi::gst_gl_overlay_compositor_free_overlays(self.to_glib_none().0);
}
}
@ -70,8 +62,8 @@ impl GLOverlayCompositor {
pub fn get_property_yinvert(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"yinvert\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
@ -86,8 +78,8 @@ impl GLOverlayCompositor {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
pub fn set_property_yinvert(&self, yinvert: bool) {
unsafe {
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"yinvert\0".as_ptr() as *const _,
Value::from(&yinvert).to_glib_none().0,
);
@ -97,7 +89,7 @@ impl GLOverlayCompositor {
pub fn add_caps(caps: &gst::Caps) -> Option<gst::Caps> {
assert_initialized_main_thread!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_overlay_compositor_add_caps(
from_glib_full(ffi::gst_gl_overlay_compositor_add_caps(
caps.to_glib_none().0,
))
}
@ -112,9 +104,9 @@ impl GLOverlayCompositor {
unsafe extern "C" fn notify_yinvert_trampoline<
F: Fn(&GLOverlayCompositor) + Send + Sync + 'static,
>(
this: *mut gst_gl_sys::GstGLOverlayCompositor,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstGLOverlayCompositor,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))

View file

@ -2,59 +2,44 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib;
use crate::GLContext;
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
use crate::GLSLProfile;
use crate::GLSLStage;
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
use crate::GLSLVersion;
use glib::object::IsA;
use glib::object::ObjectType as ObjectType_;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
use glib::GString;
use glib::StaticType;
use glib::Value;
use glib_sys;
use gobject_sys;
use gst;
use gst_gl_sys;
use std::boxed::Box as Box_;
use std::mem::transmute;
use std::ptr;
use GLContext;
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
use GLSLProfile;
use GLSLStage;
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
use GLSLVersion;
glib_wrapper! {
pub struct GLShader(Object<gst_gl_sys::GstGLShader, gst_gl_sys::GstGLShaderClass>) @extends gst::Object;
glib::glib_wrapper! {
pub struct GLShader(Object<ffi::GstGLShader, ffi::GstGLShaderClass>) @extends gst::Object;
match fn {
get_type => || gst_gl_sys::gst_gl_shader_get_type(),
get_type => || ffi::gst_gl_shader_get_type(),
}
}
impl GLShader {
pub fn new<P: IsA<GLContext>>(context: &P) -> GLShader {
skip_assert_initialized!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_shader_new(
context.as_ref().to_glib_none().0,
))
}
unsafe { from_glib_full(ffi::gst_gl_shader_new(context.as_ref().to_glib_none().0)) }
}
pub fn new_default<P: IsA<GLContext>>(context: &P) -> Result<GLShader, glib::Error> {
skip_assert_initialized!();
unsafe {
let mut error = ptr::null_mut();
let ret = gst_gl_sys::gst_gl_shader_new_default(
context.as_ref().to_glib_none().0,
&mut error,
);
let ret = ffi::gst_gl_shader_new_default(context.as_ref().to_glib_none().0, &mut error);
if error.is_null() {
Ok(from_glib_full(ret))
} else {
@ -64,17 +49,17 @@ impl GLShader {
}
//pub fn new_link_with_stages<P: IsA<GLContext>>(context: &P, error: &mut glib::Error, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> GLShader {
// unsafe { TODO: call gst_gl_sys:gst_gl_shader_new_link_with_stages() }
// unsafe { TODO: call ffi:gst_gl_shader_new_link_with_stages() }
//}
//pub fn with_stages<P: IsA<GLContext>>(context: &P, error: &mut glib::Error, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> GLShader {
// unsafe { TODO: call gst_gl_sys:gst_gl_shader_new_with_stages() }
// unsafe { TODO: call ffi:gst_gl_shader_new_with_stages() }
//}
pub fn attach(&self, stage: &GLSLStage) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(
gst_gl_sys::gst_gl_shader_attach(self.to_glib_none().0, stage.to_glib_none().0),
glib::glib_result_from_gboolean!(
ffi::gst_gl_shader_attach(self.to_glib_none().0, stage.to_glib_none().0),
"Failed to attach stage to shader"
)
}
@ -82,11 +67,8 @@ impl GLShader {
pub fn attach_unlocked(&self, stage: &GLSLStage) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(
gst_gl_sys::gst_gl_shader_attach_unlocked(
self.to_glib_none().0,
stage.to_glib_none().0
),
glib::glib_result_from_gboolean!(
ffi::gst_gl_shader_attach_unlocked(self.to_glib_none().0, stage.to_glib_none().0),
"Failed to attach stage to shader"
)
}
@ -94,7 +76,7 @@ impl GLShader {
pub fn bind_attribute_location(&self, index: u32, name: &str) {
unsafe {
gst_gl_sys::gst_gl_shader_bind_attribute_location(
ffi::gst_gl_shader_bind_attribute_location(
self.to_glib_none().0,
index,
name.to_glib_none().0,
@ -104,7 +86,7 @@ impl GLShader {
pub fn bind_frag_data_location(&self, index: u32, name: &str) {
unsafe {
gst_gl_sys::gst_gl_shader_bind_frag_data_location(
ffi::gst_gl_shader_bind_frag_data_location(
self.to_glib_none().0,
index,
name.to_glib_none().0,
@ -115,7 +97,7 @@ impl GLShader {
pub fn compile_attach_stage(&self, stage: &GLSLStage) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = gst_gl_sys::gst_gl_shader_compile_attach_stage(
let _ = ffi::gst_gl_shader_compile_attach_stage(
self.to_glib_none().0,
stage.to_glib_none().0,
&mut error,
@ -130,40 +112,34 @@ impl GLShader {
pub fn detach(&self, stage: &GLSLStage) {
unsafe {
gst_gl_sys::gst_gl_shader_detach(self.to_glib_none().0, stage.to_glib_none().0);
ffi::gst_gl_shader_detach(self.to_glib_none().0, stage.to_glib_none().0);
}
}
pub fn detach_unlocked(&self, stage: &GLSLStage) {
unsafe {
gst_gl_sys::gst_gl_shader_detach_unlocked(
self.to_glib_none().0,
stage.to_glib_none().0,
);
ffi::gst_gl_shader_detach_unlocked(self.to_glib_none().0, stage.to_glib_none().0);
}
}
pub fn get_attribute_location(&self, name: &str) -> i32 {
unsafe {
gst_gl_sys::gst_gl_shader_get_attribute_location(
self.to_glib_none().0,
name.to_glib_none().0,
)
ffi::gst_gl_shader_get_attribute_location(self.to_glib_none().0, name.to_glib_none().0)
}
}
pub fn get_program_handle(&self) -> i32 {
unsafe { gst_gl_sys::gst_gl_shader_get_program_handle(self.to_glib_none().0) }
unsafe { ffi::gst_gl_shader_get_program_handle(self.to_glib_none().0) }
}
pub fn is_linked(&self) -> bool {
unsafe { from_glib(gst_gl_sys::gst_gl_shader_is_linked(self.to_glib_none().0)) }
unsafe { from_glib(ffi::gst_gl_shader_is_linked(self.to_glib_none().0)) }
}
pub fn link(&self) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = gst_gl_sys::gst_gl_shader_link(self.to_glib_none().0, &mut error);
let _ = ffi::gst_gl_shader_link(self.to_glib_none().0, &mut error);
if error.is_null() {
Ok(())
} else {
@ -174,30 +150,26 @@ impl GLShader {
pub fn release(&self) {
unsafe {
gst_gl_sys::gst_gl_shader_release(self.to_glib_none().0);
ffi::gst_gl_shader_release(self.to_glib_none().0);
}
}
pub fn release_unlocked(&self) {
unsafe {
gst_gl_sys::gst_gl_shader_release_unlocked(self.to_glib_none().0);
ffi::gst_gl_shader_release_unlocked(self.to_glib_none().0);
}
}
pub fn set_uniform_1f(&self, name: &str, value: f32) {
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_1f(
self.to_glib_none().0,
name.to_glib_none().0,
value,
);
ffi::gst_gl_shader_set_uniform_1f(self.to_glib_none().0, name.to_glib_none().0, value);
}
}
pub fn set_uniform_1fv(&self, name: &str, value: &[f32]) {
let count = value.len() as u32;
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_1fv(
ffi::gst_gl_shader_set_uniform_1fv(
self.to_glib_none().0,
name.to_glib_none().0,
count,
@ -208,18 +180,14 @@ impl GLShader {
pub fn set_uniform_1i(&self, name: &str, value: i32) {
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_1i(
self.to_glib_none().0,
name.to_glib_none().0,
value,
);
ffi::gst_gl_shader_set_uniform_1i(self.to_glib_none().0, name.to_glib_none().0, value);
}
}
pub fn set_uniform_1iv(&self, name: &str, value: &[i32]) {
let count = value.len() as u32;
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_1iv(
ffi::gst_gl_shader_set_uniform_1iv(
self.to_glib_none().0,
name.to_glib_none().0,
count,
@ -230,19 +198,14 @@ impl GLShader {
pub fn set_uniform_2f(&self, name: &str, v0: f32, v1: f32) {
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_2f(
self.to_glib_none().0,
name.to_glib_none().0,
v0,
v1,
);
ffi::gst_gl_shader_set_uniform_2f(self.to_glib_none().0, name.to_glib_none().0, v0, v1);
}
}
pub fn set_uniform_2fv(&self, name: &str, value: &[f32]) {
let count = value.len() as u32;
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_2fv(
ffi::gst_gl_shader_set_uniform_2fv(
self.to_glib_none().0,
name.to_glib_none().0,
count,
@ -253,19 +216,14 @@ impl GLShader {
pub fn set_uniform_2i(&self, name: &str, v0: i32, v1: i32) {
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_2i(
self.to_glib_none().0,
name.to_glib_none().0,
v0,
v1,
);
ffi::gst_gl_shader_set_uniform_2i(self.to_glib_none().0, name.to_glib_none().0, v0, v1);
}
}
pub fn set_uniform_2iv(&self, name: &str, value: &[i32]) {
let count = value.len() as u32;
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_2iv(
ffi::gst_gl_shader_set_uniform_2iv(
self.to_glib_none().0,
name.to_glib_none().0,
count,
@ -276,7 +234,7 @@ impl GLShader {
pub fn set_uniform_3f(&self, name: &str, v0: f32, v1: f32, v2: f32) {
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_3f(
ffi::gst_gl_shader_set_uniform_3f(
self.to_glib_none().0,
name.to_glib_none().0,
v0,
@ -289,7 +247,7 @@ impl GLShader {
pub fn set_uniform_3fv(&self, name: &str, value: &[f32]) {
let count = value.len() as u32;
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_3fv(
ffi::gst_gl_shader_set_uniform_3fv(
self.to_glib_none().0,
name.to_glib_none().0,
count,
@ -300,7 +258,7 @@ impl GLShader {
pub fn set_uniform_3i(&self, name: &str, v0: i32, v1: i32, v2: i32) {
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_3i(
ffi::gst_gl_shader_set_uniform_3i(
self.to_glib_none().0,
name.to_glib_none().0,
v0,
@ -313,7 +271,7 @@ impl GLShader {
pub fn set_uniform_3iv(&self, name: &str, value: &[i32]) {
let count = value.len() as u32;
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_3iv(
ffi::gst_gl_shader_set_uniform_3iv(
self.to_glib_none().0,
name.to_glib_none().0,
count,
@ -324,7 +282,7 @@ impl GLShader {
pub fn set_uniform_4f(&self, name: &str, v0: f32, v1: f32, v2: f32, v3: f32) {
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_4f(
ffi::gst_gl_shader_set_uniform_4f(
self.to_glib_none().0,
name.to_glib_none().0,
v0,
@ -338,7 +296,7 @@ impl GLShader {
pub fn set_uniform_4fv(&self, name: &str, value: &[f32]) {
let count = value.len() as u32;
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_4fv(
ffi::gst_gl_shader_set_uniform_4fv(
self.to_glib_none().0,
name.to_glib_none().0,
count,
@ -349,7 +307,7 @@ impl GLShader {
pub fn set_uniform_4i(&self, name: &str, v0: i32, v1: i32, v2: i32, v3: i32) {
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_4i(
ffi::gst_gl_shader_set_uniform_4i(
self.to_glib_none().0,
name.to_glib_none().0,
v0,
@ -363,7 +321,7 @@ impl GLShader {
pub fn set_uniform_4iv(&self, name: &str, value: &[i32]) {
let count = value.len() as u32;
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_4iv(
ffi::gst_gl_shader_set_uniform_4iv(
self.to_glib_none().0,
name.to_glib_none().0,
count,
@ -374,15 +332,15 @@ impl GLShader {
pub fn use_(&self) {
unsafe {
gst_gl_sys::gst_gl_shader_use(self.to_glib_none().0);
ffi::gst_gl_shader_use(self.to_glib_none().0);
}
}
pub fn get_property_linked(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"linked\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
@ -399,16 +357,14 @@ impl GLShader {
context: &P,
version: GLSLVersion,
profile: GLSLProfile,
) -> Option<GString> {
) -> Option<glib::GString> {
skip_assert_initialized!();
unsafe {
from_glib_full(
gst_gl_sys::gst_gl_shader_string_fragment_external_oes_get_default(
context.as_ref().to_glib_none().0,
version.to_glib(),
profile.to_glib(),
),
)
from_glib_full(ffi::gst_gl_shader_string_fragment_external_oes_get_default(
context.as_ref().to_glib_none().0,
version.to_glib(),
profile.to_glib(),
))
}
}
@ -418,10 +374,10 @@ impl GLShader {
context: &P,
version: GLSLVersion,
profile: GLSLProfile,
) -> Option<GString> {
) -> Option<glib::GString> {
skip_assert_initialized!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_shader_string_fragment_get_default(
from_glib_full(ffi::gst_gl_shader_string_fragment_get_default(
context.as_ref().to_glib_none().0,
version.to_glib(),
profile.to_glib(),
@ -435,10 +391,10 @@ impl GLShader {
context: &P,
version: GLSLVersion,
profile: GLSLProfile,
) -> Option<GString> {
) -> Option<glib::GString> {
skip_assert_initialized!();
unsafe {
from_glib_none(gst_gl_sys::gst_gl_shader_string_get_highest_precision(
from_glib_none(ffi::gst_gl_shader_string_get_highest_precision(
context.as_ref().to_glib_none().0,
version.to_glib(),
profile.to_glib(),
@ -451,9 +407,9 @@ impl GLShader {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_linked_trampoline<F: Fn(&GLShader) + Send + Sync + 'static>(
this: *mut gst_gl_sys::GstGLShader,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstGLShader,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))

View file

@ -2,37 +2,30 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib;
use crate::GLContext;
use glib::object::IsA;
use glib::translate::*;
use gst;
use gst_gl_sys;
use std::ptr;
use GLContext;
glib_wrapper! {
pub struct GLUpload(Object<gst_gl_sys::GstGLUpload, gst_gl_sys::GstGLUploadClass>) @extends gst::Object;
glib::glib_wrapper! {
pub struct GLUpload(Object<ffi::GstGLUpload, ffi::GstGLUploadClass>) @extends gst::Object;
match fn {
get_type => || gst_gl_sys::gst_gl_upload_get_type(),
get_type => || ffi::gst_gl_upload_get_type(),
}
}
impl GLUpload {
pub fn new<P: IsA<GLContext>>(context: &P) -> GLUpload {
skip_assert_initialized!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_upload_new(
context.as_ref().to_glib_none().0,
))
}
unsafe { from_glib_full(ffi::gst_gl_upload_new(context.as_ref().to_glib_none().0)) }
}
pub fn get_caps(&self) -> (gst::Caps, gst::Caps) {
unsafe {
let mut in_caps = ptr::null_mut();
let mut out_caps = ptr::null_mut();
gst_gl_sys::gst_gl_upload_get_caps(self.to_glib_none().0, &mut in_caps, &mut out_caps);
ffi::gst_gl_upload_get_caps(self.to_glib_none().0, &mut in_caps, &mut out_caps);
(from_glib_full(in_caps), from_glib_full(out_caps))
}
}
@ -43,8 +36,8 @@ impl GLUpload {
out_caps: &gst::Caps,
) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(
gst_gl_sys::gst_gl_upload_set_caps(
glib::glib_result_from_gboolean!(
ffi::gst_gl_upload_set_caps(
self.to_glib_none().0,
in_caps.to_glib_none().0,
out_caps.to_glib_none().0
@ -56,7 +49,7 @@ impl GLUpload {
pub fn set_context<P: IsA<GLContext>>(&self, context: &P) {
unsafe {
gst_gl_sys::gst_gl_upload_set_context(
ffi::gst_gl_upload_set_context(
self.to_glib_none().0,
context.as_ref().to_glib_none().0,
);
@ -71,7 +64,7 @@ impl GLUpload {
filter: &gst::Caps,
) -> Option<gst::Caps> {
unsafe {
from_glib_full(gst_gl_sys::gst_gl_upload_transform_caps(
from_glib_full(ffi::gst_gl_upload_transform_caps(
self.to_glib_none().0,
context.as_ref().to_glib_none().0,
direction.to_glib(),
@ -83,7 +76,7 @@ impl GLUpload {
pub fn get_input_template_caps() -> gst::Caps {
assert_initialized_main_thread!();
unsafe { from_glib_full(gst_gl_sys::gst_gl_upload_get_input_template_caps()) }
unsafe { from_glib_full(ffi::gst_gl_upload_get_input_template_caps()) }
}
}

View file

@ -2,7 +2,8 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib;
use crate::GLContext;
use crate::GLStereoDownmix;
use glib::object::IsA;
use glib::object::ObjectType as ObjectType_;
use glib::signal::connect_raw;
@ -10,33 +11,26 @@ use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::Value;
use glib_sys;
use gobject_sys;
use gst;
use gst_gl_sys;
use gst_video;
use std::boxed::Box as Box_;
use std::mem::transmute;
use GLContext;
use GLStereoDownmix;
glib_wrapper! {
pub struct GLViewConvert(Object<gst_gl_sys::GstGLViewConvert, gst_gl_sys::GstGLViewConvertClass>) @extends gst::Object;
glib::glib_wrapper! {
pub struct GLViewConvert(Object<ffi::GstGLViewConvert, ffi::GstGLViewConvertClass>) @extends gst::Object;
match fn {
get_type => || gst_gl_sys::gst_gl_view_convert_get_type(),
get_type => || ffi::gst_gl_view_convert_get_type(),
}
}
impl GLViewConvert {
pub fn new() -> GLViewConvert {
assert_initialized_main_thread!();
unsafe { from_glib_full(gst_gl_sys::gst_gl_view_convert_new()) }
unsafe { from_glib_full(ffi::gst_gl_view_convert_new()) }
}
pub fn perform(&self, inbuf: &gst::Buffer) -> Option<gst::Buffer> {
unsafe {
from_glib_full(gst_gl_sys::gst_gl_view_convert_perform(
from_glib_full(ffi::gst_gl_view_convert_perform(
self.to_glib_none().0,
inbuf.to_glib_none().0,
))
@ -45,7 +39,7 @@ impl GLViewConvert {
pub fn reset(&self) {
unsafe {
gst_gl_sys::gst_gl_view_convert_reset(self.to_glib_none().0);
ffi::gst_gl_view_convert_reset(self.to_glib_none().0);
}
}
@ -55,8 +49,8 @@ impl GLViewConvert {
out_caps: &gst::Caps,
) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(
gst_gl_sys::gst_gl_view_convert_set_caps(
glib::glib_result_from_gboolean!(
ffi::gst_gl_view_convert_set_caps(
self.to_glib_none().0,
in_caps.to_glib_none().0,
out_caps.to_glib_none().0
@ -68,7 +62,7 @@ impl GLViewConvert {
pub fn set_context<P: IsA<GLContext>>(&self, context: &P) {
unsafe {
gst_gl_sys::gst_gl_view_convert_set_context(
ffi::gst_gl_view_convert_set_context(
self.to_glib_none().0,
context.as_ref().to_glib_none().0,
);
@ -82,7 +76,7 @@ impl GLViewConvert {
filter: &gst::Caps,
) -> Option<gst::Caps> {
unsafe {
from_glib_full(gst_gl_sys::gst_gl_view_convert_transform_caps(
from_glib_full(ffi::gst_gl_view_convert_transform_caps(
self.to_glib_none().0,
direction.to_glib(),
caps.to_glib_none().0,
@ -94,8 +88,8 @@ impl GLViewConvert {
pub fn get_property_downmix_mode(&self) -> GLStereoDownmix {
unsafe {
let mut value = Value::from_type(<GLStereoDownmix as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"downmix-mode\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
@ -108,8 +102,8 @@ impl GLViewConvert {
pub fn set_property_downmix_mode(&self, downmix_mode: GLStereoDownmix) {
unsafe {
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"downmix-mode\0".as_ptr() as *const _,
Value::from(&downmix_mode).to_glib_none().0,
);
@ -120,8 +114,8 @@ impl GLViewConvert {
unsafe {
let mut value =
Value::from_type(<gst_video::VideoMultiviewFlags as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"input-flags-override\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
@ -137,8 +131,8 @@ impl GLViewConvert {
input_flags_override: gst_video::VideoMultiviewFlags,
) {
unsafe {
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"input-flags-override\0".as_ptr() as *const _,
Value::from(&input_flags_override).to_glib_none().0,
);
@ -149,8 +143,8 @@ impl GLViewConvert {
unsafe {
let mut value =
Value::from_type(<gst_video::VideoMultiviewMode as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"input-mode-override\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
@ -166,8 +160,8 @@ impl GLViewConvert {
input_mode_override: gst_video::VideoMultiviewMode,
) {
unsafe {
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"input-mode-override\0".as_ptr() as *const _,
Value::from(&input_mode_override).to_glib_none().0,
);
@ -178,8 +172,8 @@ impl GLViewConvert {
unsafe {
let mut value =
Value::from_type(<gst_video::VideoMultiviewFlags as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"output-flags-override\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
@ -195,8 +189,8 @@ impl GLViewConvert {
output_flags_override: gst_video::VideoMultiviewFlags,
) {
unsafe {
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"output-flags-override\0".as_ptr() as *const _,
Value::from(&output_flags_override).to_glib_none().0,
);
@ -207,8 +201,8 @@ impl GLViewConvert {
unsafe {
let mut value =
Value::from_type(<gst_video::VideoMultiviewMode as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"output-mode-override\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
@ -224,8 +218,8 @@ impl GLViewConvert {
output_mode_override: gst_video::VideoMultiviewMode,
) {
unsafe {
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"output-mode-override\0".as_ptr() as *const _,
Value::from(&output_mode_override).to_glib_none().0,
);
@ -239,9 +233,9 @@ impl GLViewConvert {
unsafe extern "C" fn notify_downmix_mode_trampoline<
F: Fn(&GLViewConvert) + Send + Sync + 'static,
>(
this: *mut gst_gl_sys::GstGLViewConvert,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstGLViewConvert,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
@ -268,9 +262,9 @@ impl GLViewConvert {
unsafe extern "C" fn notify_input_flags_override_trampoline<
F: Fn(&GLViewConvert) + Send + Sync + 'static,
>(
this: *mut gst_gl_sys::GstGLViewConvert,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstGLViewConvert,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
@ -297,9 +291,9 @@ impl GLViewConvert {
unsafe extern "C" fn notify_input_mode_override_trampoline<
F: Fn(&GLViewConvert) + Send + Sync + 'static,
>(
this: *mut gst_gl_sys::GstGLViewConvert,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstGLViewConvert,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
@ -326,9 +320,9 @@ impl GLViewConvert {
unsafe extern "C" fn notify_output_flags_override_trampoline<
F: Fn(&GLViewConvert) + Send + Sync + 'static,
>(
this: *mut gst_gl_sys::GstGLViewConvert,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstGLViewConvert,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
@ -355,9 +349,9 @@ impl GLViewConvert {
unsafe extern "C" fn notify_output_mode_override_trampoline<
F: Fn(&GLViewConvert) + Send + Sync + 'static,
>(
this: *mut gst_gl_sys::GstGLViewConvert,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstGLViewConvert,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))

View file

@ -2,39 +2,29 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib;
use crate::GLContext;
use crate::GLDisplay;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::GString;
use glib_sys;
use gst;
use gst_gl_sys;
use libc;
use std::boxed::Box as Box_;
use std::mem;
use std::mem::transmute;
use GLContext;
use GLDisplay;
glib_wrapper! {
pub struct GLWindow(Object<gst_gl_sys::GstGLWindow, gst_gl_sys::GstGLWindowClass>) @extends gst::Object;
glib::glib_wrapper! {
pub struct GLWindow(Object<ffi::GstGLWindow, ffi::GstGLWindowClass>) @extends gst::Object;
match fn {
get_type => || gst_gl_sys::gst_gl_window_get_type(),
get_type => || ffi::gst_gl_window_get_type(),
}
}
impl GLWindow {
pub fn new<P: IsA<GLDisplay>>(display: &P) -> GLWindow {
skip_assert_initialized!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_window_new(
display.as_ref().to_glib_none().0,
))
}
unsafe { from_glib_full(ffi::gst_gl_window_new(display.as_ref().to_glib_none().0)) }
}
}
@ -111,7 +101,7 @@ impl<O: IsA<GLWindow>> GLWindowExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn controls_viewport(&self) -> bool {
unsafe {
from_glib(gst_gl_sys::gst_gl_window_controls_viewport(
from_glib(ffi::gst_gl_window_controls_viewport(
self.as_ref().to_glib_none().0,
))
}
@ -119,13 +109,13 @@ impl<O: IsA<GLWindow>> GLWindowExt for O {
fn draw(&self) {
unsafe {
gst_gl_sys::gst_gl_window_draw(self.as_ref().to_glib_none().0);
ffi::gst_gl_window_draw(self.as_ref().to_glib_none().0);
}
}
fn get_context(&self) -> Option<GLContext> {
unsafe {
from_glib_full(gst_gl_sys::gst_gl_window_get_context(
from_glib_full(ffi::gst_gl_window_get_context(
self.as_ref().to_glib_none().0,
))
}
@ -135,7 +125,7 @@ impl<O: IsA<GLWindow>> GLWindowExt for O {
unsafe {
let mut width = mem::MaybeUninit::uninit();
let mut height = mem::MaybeUninit::uninit();
gst_gl_sys::gst_gl_window_get_surface_dimensions(
ffi::gst_gl_window_get_surface_dimensions(
self.as_ref().to_glib_none().0,
width.as_mut_ptr(),
height.as_mut_ptr(),
@ -148,7 +138,7 @@ impl<O: IsA<GLWindow>> GLWindowExt for O {
fn handle_events(&self, handle_events: bool) {
unsafe {
gst_gl_sys::gst_gl_window_handle_events(
ffi::gst_gl_window_handle_events(
self.as_ref().to_glib_none().0,
handle_events.to_glib(),
);
@ -159,7 +149,7 @@ impl<O: IsA<GLWindow>> GLWindowExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
fn has_output_surface(&self) -> bool {
unsafe {
from_glib(gst_gl_sys::gst_gl_window_has_output_surface(
from_glib(ffi::gst_gl_window_has_output_surface(
self.as_ref().to_glib_none().0,
))
}
@ -167,31 +157,31 @@ impl<O: IsA<GLWindow>> GLWindowExt for O {
fn queue_resize(&self) {
unsafe {
gst_gl_sys::gst_gl_window_queue_resize(self.as_ref().to_glib_none().0);
ffi::gst_gl_window_queue_resize(self.as_ref().to_glib_none().0);
}
}
fn quit(&self) {
unsafe {
gst_gl_sys::gst_gl_window_quit(self.as_ref().to_glib_none().0);
ffi::gst_gl_window_quit(self.as_ref().to_glib_none().0);
}
}
fn resize(&self, width: u32, height: u32) {
unsafe {
gst_gl_sys::gst_gl_window_resize(self.as_ref().to_glib_none().0, width, height);
ffi::gst_gl_window_resize(self.as_ref().to_glib_none().0, width, height);
}
}
fn run(&self) {
unsafe {
gst_gl_sys::gst_gl_window_run(self.as_ref().to_glib_none().0);
ffi::gst_gl_window_run(self.as_ref().to_glib_none().0);
}
}
fn send_key_event(&self, event_type: &str, key_str: &str) {
unsafe {
gst_gl_sys::gst_gl_window_send_key_event(
ffi::gst_gl_window_send_key_event(
self.as_ref().to_glib_none().0,
event_type.to_glib_none().0,
key_str.to_glib_none().0,
@ -201,7 +191,7 @@ impl<O: IsA<GLWindow>> GLWindowExt for O {
fn send_mouse_event(&self, event_type: &str, button: i32, posx: f64, posy: f64) {
unsafe {
gst_gl_sys::gst_gl_window_send_mouse_event(
ffi::gst_gl_window_send_mouse_event(
self.as_ref().to_glib_none().0,
event_type.to_glib_none().0,
button,
@ -215,7 +205,7 @@ impl<O: IsA<GLWindow>> GLWindowExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
fn send_scroll_event(&self, posx: f64, posy: f64, delta_x: f64, delta_y: f64) {
unsafe {
gst_gl_sys::gst_gl_window_send_scroll_event(
ffi::gst_gl_window_send_scroll_event(
self.as_ref().to_glib_none().0,
posx,
posy,
@ -227,11 +217,7 @@ impl<O: IsA<GLWindow>> GLWindowExt for O {
fn set_preferred_size(&self, width: i32, height: i32) {
unsafe {
gst_gl_sys::gst_gl_window_set_preferred_size(
self.as_ref().to_glib_none().0,
width,
height,
);
ffi::gst_gl_window_set_preferred_size(self.as_ref().to_glib_none().0, width, height);
}
}
@ -243,8 +229,8 @@ impl<O: IsA<GLWindow>> GLWindowExt for O {
height: i32,
) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(
gst_gl_sys::gst_gl_window_set_render_rectangle(
glib::glib_result_from_gboolean!(
ffi::gst_gl_window_set_render_rectangle(
self.as_ref().to_glib_none().0,
x,
y,
@ -258,7 +244,7 @@ impl<O: IsA<GLWindow>> GLWindowExt for O {
fn show(&self) {
unsafe {
gst_gl_sys::gst_gl_window_show(self.as_ref().to_glib_none().0);
ffi::gst_gl_window_show(self.as_ref().to_glib_none().0);
}
}
@ -270,18 +256,18 @@ impl<O: IsA<GLWindow>> GLWindowExt for O {
P,
F: Fn(&P, &str, &str) + Send + Sync + 'static,
>(
this: *mut gst_gl_sys::GstGLWindow,
this: *mut ffi::GstGLWindow,
id: *mut libc::c_char,
key: *mut libc::c_char,
f: glib_sys::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<GLWindow>,
{
let f: &F = &*(f as *const F);
f(
&GLWindow::from_glib_borrow(this).unsafe_cast_ref(),
&GString::from_glib_borrow(id),
&GString::from_glib_borrow(key),
&glib::GString::from_glib_borrow(id),
&glib::GString::from_glib_borrow(key),
)
}
unsafe {
@ -305,19 +291,19 @@ impl<O: IsA<GLWindow>> GLWindowExt for O {
P,
F: Fn(&P, &str, i32, f64, f64) + Send + Sync + 'static,
>(
this: *mut gst_gl_sys::GstGLWindow,
this: *mut ffi::GstGLWindow,
id: *mut libc::c_char,
button: libc::c_int,
x: libc::c_double,
y: libc::c_double,
f: glib_sys::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<GLWindow>,
{
let f: &F = &*(f as *const F);
f(
&GLWindow::from_glib_borrow(this).unsafe_cast_ref(),
&GString::from_glib_borrow(id),
&glib::GString::from_glib_borrow(id),
button,
x,
y,
@ -346,12 +332,12 @@ impl<O: IsA<GLWindow>> GLWindowExt for O {
P,
F: Fn(&P, f64, f64, f64, f64) + Send + Sync + 'static,
>(
this: *mut gst_gl_sys::GstGLWindow,
this: *mut ffi::GstGLWindow,
x: libc::c_double,
y: libc::c_double,
delta_x: libc::c_double,
delta_y: libc::c_double,
f: glib_sys::gpointer,
f: glib::ffi::gpointer,
) where
P: IsA<GLWindow>,
{

View file

@ -2,21 +2,18 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib;
use crate::GLContext;
use crate::GLSLProfile;
use crate::GLSLVersion;
use glib::object::IsA;
use glib::translate::*;
use gst;
use gst_gl_sys;
use std::ptr;
use GLContext;
use GLSLProfile;
use GLSLVersion;
glib_wrapper! {
pub struct GLSLStage(Object<gst_gl_sys::GstGLSLStage, gst_gl_sys::GstGLSLStageClass>) @extends gst::Object;
glib::glib_wrapper! {
pub struct GLSLStage(Object<ffi::GstGLSLStage, ffi::GstGLSLStageClass>) @extends gst::Object;
match fn {
get_type => || gst_gl_sys::gst_glsl_stage_get_type(),
get_type => || ffi::gst_glsl_stage_get_type(),
}
}
@ -24,7 +21,7 @@ impl GLSLStage {
pub fn new<P: IsA<GLContext>>(context: &P, type_: u32) -> GLSLStage {
skip_assert_initialized!();
unsafe {
from_glib_none(gst_gl_sys::gst_glsl_stage_new(
from_glib_none(ffi::gst_glsl_stage_new(
context.as_ref().to_glib_none().0,
type_,
))
@ -34,7 +31,7 @@ impl GLSLStage {
pub fn new_default_fragment<P: IsA<GLContext>>(context: &P) -> GLSLStage {
skip_assert_initialized!();
unsafe {
from_glib_none(gst_gl_sys::gst_glsl_stage_new_default_fragment(
from_glib_none(ffi::gst_glsl_stage_new_default_fragment(
context.as_ref().to_glib_none().0,
))
}
@ -43,7 +40,7 @@ impl GLSLStage {
pub fn new_default_vertex<P: IsA<GLContext>>(context: &P) -> GLSLStage {
skip_assert_initialized!();
unsafe {
from_glib_none(gst_gl_sys::gst_glsl_stage_new_default_vertex(
from_glib_none(ffi::gst_glsl_stage_new_default_vertex(
context.as_ref().to_glib_none().0,
))
}
@ -58,7 +55,7 @@ impl GLSLStage {
) -> GLSLStage {
skip_assert_initialized!();
unsafe {
from_glib_none(gst_gl_sys::gst_glsl_stage_new_with_string(
from_glib_none(ffi::gst_glsl_stage_new_with_string(
context.as_ref().to_glib_none().0,
type_,
version.to_glib(),
@ -78,7 +75,7 @@ impl GLSLStage {
skip_assert_initialized!();
let n_strings = str.len() as i32;
unsafe {
from_glib_none(gst_gl_sys::gst_glsl_stage_new_with_strings(
from_glib_none(ffi::gst_glsl_stage_new_with_strings(
context.as_ref().to_glib_none().0,
type_,
version.to_glib(),
@ -92,7 +89,7 @@ impl GLSLStage {
pub fn compile(&self) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = gst_gl_sys::gst_glsl_stage_compile(self.to_glib_none().0, &mut error);
let _ = ffi::gst_glsl_stage_compile(self.to_glib_none().0, &mut error);
if error.is_null() {
Ok(())
} else {
@ -102,27 +99,19 @@ impl GLSLStage {
}
pub fn get_handle(&self) -> u32 {
unsafe { gst_gl_sys::gst_glsl_stage_get_handle(self.to_glib_none().0) }
unsafe { ffi::gst_glsl_stage_get_handle(self.to_glib_none().0) }
}
pub fn get_profile(&self) -> GLSLProfile {
unsafe {
from_glib(gst_gl_sys::gst_glsl_stage_get_profile(
self.to_glib_none().0,
))
}
unsafe { from_glib(ffi::gst_glsl_stage_get_profile(self.to_glib_none().0)) }
}
pub fn get_shader_type(&self) -> u32 {
unsafe { gst_gl_sys::gst_glsl_stage_get_shader_type(self.to_glib_none().0) }
unsafe { ffi::gst_glsl_stage_get_shader_type(self.to_glib_none().0) }
}
pub fn get_version(&self) -> GLSLVersion {
unsafe {
from_glib(gst_gl_sys::gst_glsl_stage_get_version(
self.to_glib_none().0,
))
}
unsafe { from_glib(ffi::gst_glsl_stage_get_version(self.to_glib_none().0)) }
}
pub fn set_strings(
@ -133,8 +122,8 @@ impl GLSLStage {
) -> Result<(), glib::error::BoolError> {
let n_strings = str.len() as i32;
unsafe {
glib_result_from_gboolean!(
gst_gl_sys::gst_glsl_stage_set_strings(
glib::glib_result_from_gboolean!(
ffi::gst_glsl_stage_set_strings(
self.to_glib_none().0,
version.to_glib(),
profile.to_glib(),

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 062b3d6)
from gir-files (https://github.com/gtk-rs/gir-files @ b84cead5)
Generated by gir (https://github.com/gtk-rs/gir @ 694b4b8)
from gir-files (https://github.com/gtk-rs/gir-files @ 135fd08b)