From a3875eab94c171d87f2abbfb174bc935dfd8624e Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Thu, 6 Jan 2022 17:55:27 +0200 Subject: [PATCH] gstreamer-gl: Generate GLBufferPool --- gstreamer-gl/Gir.toml | 1 + gstreamer-gl/src/auto/gl_buffer_pool.rs | 59 +++++++++++++++++++++++++ gstreamer-gl/src/auto/mod.rs | 4 ++ 3 files changed, 64 insertions(+) create mode 100644 gstreamer-gl/src/auto/gl_buffer_pool.rs diff --git a/gstreamer-gl/Gir.toml b/gstreamer-gl/Gir.toml index 9344e4ab8..49b36be21 100644 --- a/gstreamer-gl/Gir.toml +++ b/gstreamer-gl/Gir.toml @@ -21,6 +21,7 @@ generate = [ "GstGL.GLBaseFilter", "GstGL.GLBaseMemoryAllocator", "GstGL.GLBaseSrc", + "GstGL.GLBufferPool", "GstGL.GLConfigCaveat", "GstGL.GLConfigSurfaceType", "GstGL.GLContextError", diff --git a/gstreamer-gl/src/auto/gl_buffer_pool.rs b/gstreamer-gl/src/auto/gl_buffer_pool.rs new file mode 100644 index 000000000..e6c623b6b --- /dev/null +++ b/gstreamer-gl/src/auto/gl_buffer_pool.rs @@ -0,0 +1,59 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +#[cfg(any(feature = "v1_20", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] +use crate::GLAllocationParams; +use crate::GLContext; +use glib::object::Cast; +use glib::object::IsA; +use glib::translate::*; + +glib::wrapper! { + #[doc(alias = "GstGLBufferPool")] + pub struct GLBufferPool(Object) @extends gst::BufferPool, gst::Object; + + match fn { + type_ => || ffi::gst_gl_buffer_pool_get_type(), + } +} + +impl GLBufferPool { + pub const NONE: Option<&'static GLBufferPool> = None; + + #[doc(alias = "gst_gl_buffer_pool_new")] + pub fn new(context: &impl IsA) -> GLBufferPool { + skip_assert_initialized!(); + unsafe { + gst::BufferPool::from_glib_none(ffi::gst_gl_buffer_pool_new( + context.as_ref().to_glib_none().0, + )) + .unsafe_cast() + } + } +} + +unsafe impl Send for GLBufferPool {} +unsafe impl Sync for GLBufferPool {} + +pub trait GLBufferPoolExt: 'static { + #[cfg(any(feature = "v1_20", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] + #[doc(alias = "gst_gl_buffer_pool_get_gl_allocation_params")] + #[doc(alias = "get_gl_allocation_params")] + fn gl_allocation_params(&self) -> Option; +} + +impl> GLBufferPoolExt for O { + #[cfg(any(feature = "v1_20", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] + fn gl_allocation_params(&self) -> Option { + unsafe { + from_glib_full(ffi::gst_gl_buffer_pool_get_gl_allocation_params( + self.as_ref().to_glib_none().0, + )) + } + } +} diff --git a/gstreamer-gl/src/auto/mod.rs b/gstreamer-gl/src/auto/mod.rs index e2ebbba23..e5bbe814e 100644 --- a/gstreamer-gl/src/auto/mod.rs +++ b/gstreamer-gl/src/auto/mod.rs @@ -16,6 +16,9 @@ mod gl_base_src; #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] pub use self::gl_base_src::GLBaseSrc; +mod gl_buffer_pool; +pub use self::gl_buffer_pool::GLBufferPool; + mod gl_color_convert; pub use self::gl_color_convert::GLColorConvert; @@ -87,6 +90,7 @@ pub mod traits { #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] pub use super::gl_base_src::GLBaseSrcExt; + pub use super::gl_buffer_pool::GLBufferPoolExt; pub use super::gl_context::GLContextExt; pub use super::gl_display::GLDisplayExt; pub use super::gl_filter::GLFilterExt;