gstreamer-gl: Generate GLBufferPool

This commit is contained in:
Jordan Petridis 2022-01-06 17:55:27 +02:00 committed by Sebastian Dröge
parent 45708832dd
commit a3875eab94
3 changed files with 64 additions and 0 deletions

View file

@ -21,6 +21,7 @@ generate = [
"GstGL.GLBaseFilter", "GstGL.GLBaseFilter",
"GstGL.GLBaseMemoryAllocator", "GstGL.GLBaseMemoryAllocator",
"GstGL.GLBaseSrc", "GstGL.GLBaseSrc",
"GstGL.GLBufferPool",
"GstGL.GLConfigCaveat", "GstGL.GLConfigCaveat",
"GstGL.GLConfigSurfaceType", "GstGL.GLConfigSurfaceType",
"GstGL.GLContextError", "GstGL.GLContextError",

View file

@ -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<ffi::GstGLBufferPool, ffi::GstGLBufferPoolClass>) @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<GLContext>) -> 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<GLAllocationParams>;
}
impl<O: IsA<GLBufferPool>> 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<GLAllocationParams> {
unsafe {
from_glib_full(ffi::gst_gl_buffer_pool_get_gl_allocation_params(
self.as_ref().to_glib_none().0,
))
}
}
}

View file

@ -16,6 +16,9 @@ mod gl_base_src;
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
pub use self::gl_base_src::GLBaseSrc; pub use self::gl_base_src::GLBaseSrc;
mod gl_buffer_pool;
pub use self::gl_buffer_pool::GLBufferPool;
mod gl_color_convert; mod gl_color_convert;
pub use self::gl_color_convert::GLColorConvert; pub use self::gl_color_convert::GLColorConvert;
@ -87,6 +90,7 @@ pub mod traits {
#[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
pub use super::gl_base_src::GLBaseSrcExt; pub use super::gl_base_src::GLBaseSrcExt;
pub use super::gl_buffer_pool::GLBufferPoolExt;
pub use super::gl_context::GLContextExt; pub use super::gl_context::GLContextExt;
pub use super::gl_display::GLDisplayExt; pub use super::gl_display::GLDisplayExt;
pub use super::gl_filter::GLFilterExt; pub use super::gl_filter::GLFilterExt;