forked from mirrors/gstreamer-rs
gl: Regenerate
This commit is contained in:
parent
43d7238b44
commit
bf1941beee
10 changed files with 651 additions and 30 deletions
|
@ -13,25 +13,67 @@ OpenGL ES 1.x
|
|||
OpenGL ES 2.x and 3.x
|
||||
<!-- struct GLAPI::const ANY -->
|
||||
Any OpenGL API
|
||||
<!-- struct GLAllocationParams -->
|
||||
<!-- impl GLAllocationParams::fn copy -->
|
||||
|
||||
# Returns
|
||||
|
||||
a copy of the `GLAllocationParams` specified by
|
||||
`self` or `None` on failure
|
||||
<!-- impl GLAllocationParams::fn copy_data -->
|
||||
Copies the dynamically allocated data from `self` to `dest`. Direct subclasses
|
||||
should call this function in their own overridden copy function.
|
||||
## `dest`
|
||||
the destination `GLAllocationParams`
|
||||
<!-- impl GLAllocationParams::fn free -->
|
||||
Frees the `GLAllocationParams` and all associated data.
|
||||
<!-- impl GLAllocationParams::fn free_data -->
|
||||
Frees the dynamically allocated data in `self`. Direct subclasses
|
||||
should call this function in their own overridden free function.
|
||||
<!-- impl GLAllocationParams::fn init -->
|
||||
`notify` will be called once for each allocated memory using these `self`
|
||||
when freeing the memory.
|
||||
## `struct_size`
|
||||
the struct size of the implementation
|
||||
## `alloc_flags`
|
||||
some alloc flags
|
||||
## `copy`
|
||||
a copy function
|
||||
## `free`
|
||||
a free function
|
||||
## `context`
|
||||
a `GLContext`
|
||||
## `alloc_size`
|
||||
the number of bytes to allocate.
|
||||
## `alloc_params`
|
||||
a `gst::AllocationParams` to apply
|
||||
## `wrapped_data`
|
||||
a sysmem data pointer to initialize the allocation with
|
||||
## `gl_handle`
|
||||
a GL handle to initialize the allocation with
|
||||
## `user_data`
|
||||
user data to call `notify` with
|
||||
## `notify`
|
||||
a `GDestroyNotify`
|
||||
|
||||
# Returns
|
||||
|
||||
whether the parameters could be initialized
|
||||
<!-- struct GLBaseFilter -->
|
||||
`GLBaseFilter` handles the nitty gritty details of retrieving an OpenGL
|
||||
context. It also provided some wrappers around `gst_base::BaseTransform`'s
|
||||
`start()`, `stop()` and `set_caps()` virtual methods that ensure an OpenGL
|
||||
context is available and current in the calling thread.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
# Implements
|
||||
|
||||
[`GLBaseFilterExt`](trait.GLBaseFilterExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
|
||||
[`GLBaseFilterExt`](trait.GLBaseFilterExt.html), [`gst_base::BaseTransformExt`](../gst_base/trait.BaseTransformExt.html), [`gst::ElementExt`](../gst/trait.ElementExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
|
||||
<!-- trait GLBaseFilterExt -->
|
||||
Trait containing all `GLBaseFilter` methods.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
# Implementors
|
||||
|
||||
[`GLBaseFilter`](struct.GLBaseFilter.html)
|
||||
[`GLBaseFilter`](struct.GLBaseFilter.html), [`GLFilter`](struct.GLFilter.html)
|
||||
<!-- trait GLBaseFilterExt::fn find_gl_context -->
|
||||
|
||||
Feature: `v1_16`
|
||||
|
@ -48,6 +90,66 @@ Feature: `v1_18`
|
|||
# Returns
|
||||
|
||||
the `GLContext` found by `self`
|
||||
<!-- struct GLBaseMemory -->
|
||||
GstGLBaseMemory is a `gst::Memory` subclass providing the basis of support
|
||||
for the mapping of GL buffers.
|
||||
|
||||
Data is uploaded or downloaded from the GPU as is necessary.
|
||||
<!-- impl GLBaseMemory::fn alloc_data -->
|
||||
Note: only intended for subclass usage to allocate the system memory buffer
|
||||
on demand. If there is already a non-NULL data pointer in `self`->data,
|
||||
then this function imply returns TRUE.
|
||||
|
||||
# Returns
|
||||
|
||||
whether the system memory could be allocated
|
||||
<!-- impl GLBaseMemory::fn init -->
|
||||
Initializes `self` with the required parameters
|
||||
## `allocator`
|
||||
the `gst::Allocator` to initialize with
|
||||
## `parent`
|
||||
the parent `gst::Memory` to initialize with
|
||||
## `context`
|
||||
the `GLContext` to initialize with
|
||||
## `params`
|
||||
the [`crate::gst::AllocationParams`] (XXX: @-reference does not belong to GLBaseMemory!) to initialize with
|
||||
## `size`
|
||||
the number of bytes to be allocated
|
||||
## `user_data`
|
||||
user data to call `notify` with
|
||||
## `notify`
|
||||
a `GDestroyNotify`
|
||||
<!-- impl GLBaseMemory::fn memcpy -->
|
||||
## `dest`
|
||||
the destination `GLBaseMemory`
|
||||
## `offset`
|
||||
the offset to start at
|
||||
## `size`
|
||||
the number of bytes to copy
|
||||
|
||||
# Returns
|
||||
|
||||
whether the copy succeeded.
|
||||
<!-- impl GLBaseMemory::fn alloc -->
|
||||
## `allocator`
|
||||
a `GLBaseMemoryAllocator`
|
||||
## `params`
|
||||
the `GLAllocationParams` to allocate the memory with
|
||||
|
||||
# Returns
|
||||
|
||||
a new `GLBaseMemory` from `allocator` with the requested `params`.
|
||||
<!-- impl GLBaseMemory::fn init_once -->
|
||||
Initializes the GL Base Memory allocator. It is safe to call this function
|
||||
multiple times. This must be called before any other GstGLBaseMemory operation.
|
||||
<!-- struct GLBaseMemoryAllocator -->
|
||||
Opaque `GLBaseMemoryAllocator` struct
|
||||
|
||||
This is an Abstract Base Class, you cannot instantiate it.
|
||||
|
||||
# Implements
|
||||
|
||||
[`gst::AllocatorExt`](../gst/trait.AllocatorExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
|
||||
<!-- struct GLColorConvert -->
|
||||
`GLColorConvert` is an object that converts between color spaces and/or
|
||||
formats using OpenGL Shaders.
|
||||
|
@ -629,6 +731,58 @@ Mesa3D GBM display
|
|||
EGLDevice display (Since: 1.18)
|
||||
<!-- struct GLDisplayType::const ANY -->
|
||||
any display type
|
||||
<!-- struct GLFilter -->
|
||||
`GLFilter` helps to implement simple OpenGL filter elements taking a
|
||||
single input and producing a single output with a `GLFramebuffer`
|
||||
|
||||
# Implements
|
||||
|
||||
[`GLFilterExt`](trait.GLFilterExt.html), [`GLBaseFilterExt`](trait.GLBaseFilterExt.html), [`gst_base::BaseTransformExt`](../gst_base/trait.BaseTransformExt.html), [`gst::ElementExt`](../gst/trait.ElementExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
|
||||
<!-- trait GLFilterExt -->
|
||||
Trait containing all `GLFilter` methods.
|
||||
|
||||
# Implementors
|
||||
|
||||
[`GLFilter`](struct.GLFilter.html)
|
||||
<!-- trait GLFilterExt::fn draw_fullscreen_quad -->
|
||||
Render a fullscreen quad using the current GL state. The only GL state this
|
||||
modifies is the necessary vertex/index buffers and, if necessary, a
|
||||
Vertex Array Object for drawing a fullscreen quad. Framebuffer state,
|
||||
any shaders, viewport state, etc must be setup by the caller.
|
||||
<!-- trait GLFilterExt::fn filter_texture -->
|
||||
Calls filter_texture vfunc with correctly mapped `GstGLMemorys`
|
||||
## `input`
|
||||
an input buffer
|
||||
## `output`
|
||||
an output buffer
|
||||
|
||||
# Returns
|
||||
|
||||
whether the transformation succeeded
|
||||
<!-- trait GLFilterExt::fn render_to_target -->
|
||||
Transforms `input` into `output` using `func` on through FBO.
|
||||
## `input`
|
||||
the input texture
|
||||
## `output`
|
||||
the output texture
|
||||
## `func`
|
||||
the function to transform `input` into `output`. called with `data`
|
||||
## `data`
|
||||
the data associated with `func`
|
||||
|
||||
# Returns
|
||||
|
||||
the return value of `func`
|
||||
<!-- trait GLFilterExt::fn render_to_target_with_shader -->
|
||||
Transforms `input` into `output` using `shader` with a FBO.
|
||||
|
||||
See also: `GLFilterExt::render_to_target`
|
||||
## `input`
|
||||
the input texture
|
||||
## `output`
|
||||
the output texture
|
||||
## `shader`
|
||||
the shader to use.
|
||||
<!-- enum GLFormat -->
|
||||
<!-- enum GLFormat::variant Luminance -->
|
||||
Single component replicated across R, G, and B textures
|
||||
|
@ -746,6 +900,20 @@ output height
|
|||
# Returns
|
||||
|
||||
the OpenGL id for `self`
|
||||
<!-- struct GLMemoryAllocator -->
|
||||
Opaque `GLMemoryAllocator` struct
|
||||
|
||||
# Implements
|
||||
|
||||
[`GLBaseMemoryAllocatorExt`](trait.GLBaseMemoryAllocatorExt.html), [`gst::AllocatorExt`](../gst/trait.AllocatorExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
|
||||
<!-- impl GLMemoryAllocator::fn get_default -->
|
||||
## `context`
|
||||
a `GLContext`
|
||||
|
||||
# Returns
|
||||
|
||||
the default `GLMemoryAllocator` supported by
|
||||
`context`
|
||||
<!-- struct GLOverlayCompositor -->
|
||||
Opaque `GLOverlayCompositor` object
|
||||
|
||||
|
@ -1421,6 +1589,148 @@ The configuration is unsupported.
|
|||
This element requires a reconfiguration.
|
||||
<!-- enum GLUploadReturn::variant UnsharedGlContext -->
|
||||
private return value.
|
||||
<!-- struct GLVideoAllocationParams -->
|
||||
<!-- impl GLVideoAllocationParams::fn new -->
|
||||
## `context`
|
||||
a `GLContext`
|
||||
## `alloc_params`
|
||||
the `gst::AllocationParams` for sysmem mappings of the texture
|
||||
## `v_info`
|
||||
the `gst_video::VideoInfo` for the texture
|
||||
## `plane`
|
||||
the video plane of `v_info` to allocate
|
||||
## `valign`
|
||||
any `gst_video::VideoAlignment` applied to symem mappings of the texture
|
||||
## `target`
|
||||
the `GLTextureTarget` for the created textures
|
||||
## `tex_format`
|
||||
the `GLFormat` for the created textures
|
||||
|
||||
# Returns
|
||||
|
||||
a new `GLVideoAllocationParams` for allocating `GLMemory`'s
|
||||
<!-- impl GLVideoAllocationParams::fn new_wrapped_data -->
|
||||
## `context`
|
||||
a `GLContext`
|
||||
## `alloc_params`
|
||||
the `gst::AllocationParams` for `wrapped_data`
|
||||
## `v_info`
|
||||
the `gst_video::VideoInfo` for `wrapped_data`
|
||||
## `plane`
|
||||
the video plane `wrapped_data` represents
|
||||
## `valign`
|
||||
any `gst_video::VideoAlignment` applied to symem mappings of `wrapped_data`
|
||||
## `target`
|
||||
the `GLTextureTarget` for `wrapped_data`
|
||||
## `tex_format`
|
||||
the `GLFormat` for `wrapped_data`
|
||||
## `wrapped_data`
|
||||
the data pointer to wrap
|
||||
## `user_data`
|
||||
user data to call `notify` with
|
||||
## `notify`
|
||||
a `GDestroyNotify`
|
||||
|
||||
# Returns
|
||||
|
||||
a new `GLVideoAllocationParams` for wrapping `wrapped_data`
|
||||
<!-- impl GLVideoAllocationParams::fn new_wrapped_gl_handle -->
|
||||
`gl_handle` is defined by the specific OpenGL handle being wrapped
|
||||
For `GLMemory` and `GLMemoryPBO` it is an OpenGL texture id.
|
||||
Other memory types may define it to require a different type of parameter.
|
||||
## `context`
|
||||
a `GLContext`
|
||||
## `alloc_params`
|
||||
the `gst::AllocationParams` for `tex_id`
|
||||
## `v_info`
|
||||
the `gst_video::VideoInfo` for `tex_id`
|
||||
## `plane`
|
||||
the video plane `tex_id` represents
|
||||
## `valign`
|
||||
any `gst_video::VideoAlignment` applied to symem mappings of `tex_id`
|
||||
## `target`
|
||||
the `GLTextureTarget` for `tex_id`
|
||||
## `tex_format`
|
||||
the `GLFormat` for `tex_id`
|
||||
## `gl_handle`
|
||||
the GL handle to wrap
|
||||
## `user_data`
|
||||
user data to call `notify` with
|
||||
## `notify`
|
||||
a `GDestroyNotify`
|
||||
|
||||
# Returns
|
||||
|
||||
a new `GLVideoAllocationParams` for wrapping `gl_handle`
|
||||
<!-- impl GLVideoAllocationParams::fn new_wrapped_texture -->
|
||||
## `context`
|
||||
a `GLContext`
|
||||
## `alloc_params`
|
||||
the `gst::AllocationParams` for `tex_id`
|
||||
## `v_info`
|
||||
the `gst_video::VideoInfo` for `tex_id`
|
||||
## `plane`
|
||||
the video plane `tex_id` represents
|
||||
## `valign`
|
||||
any `gst_video::VideoAlignment` applied to symem mappings of `tex_id`
|
||||
## `target`
|
||||
the `GLTextureTarget` for `tex_id`
|
||||
## `tex_format`
|
||||
the `GLFormat` for `tex_id`
|
||||
## `tex_id`
|
||||
the GL texture to wrap
|
||||
## `user_data`
|
||||
user data to call `notify` with
|
||||
## `notify`
|
||||
a `GDestroyNotify`
|
||||
|
||||
# Returns
|
||||
|
||||
a new `GLVideoAllocationParams` for wrapping `tex_id`
|
||||
<!-- impl GLVideoAllocationParams::fn copy_data -->
|
||||
Copy and set any dynamically allocated resources in `dest_vid`. Intended
|
||||
for subclass usage only to chain up at the end of a subclass copy function.
|
||||
## `dest_vid`
|
||||
destination `GLVideoAllocationParams` to copy into
|
||||
<!-- impl GLVideoAllocationParams::fn free_data -->
|
||||
Unset and free any dynamically allocated resources. Intended for subclass
|
||||
usage only to chain up at the end of a subclass free function.
|
||||
<!-- impl GLVideoAllocationParams::fn init_full -->
|
||||
Intended for subclass usage
|
||||
## `struct_size`
|
||||
the size of the struct in `self`
|
||||
## `alloc_flags`
|
||||
some allocation flags
|
||||
## `copy`
|
||||
a copy function
|
||||
## `free`
|
||||
a free function
|
||||
## `context`
|
||||
a `GLContext`
|
||||
## `alloc_params`
|
||||
the `gst::AllocationParams` for `wrapped_data`
|
||||
## `v_info`
|
||||
the `gst_video::VideoInfo` for `wrapped_data`
|
||||
## `plane`
|
||||
the video plane `wrapped_data` represents
|
||||
## `valign`
|
||||
any `gst_video::VideoAlignment` applied to symem mappings of `wrapped_data`
|
||||
## `target`
|
||||
the `GLTextureTarget`
|
||||
## `tex_format`
|
||||
the `GLFormat`
|
||||
## `wrapped_data`
|
||||
the optional data pointer to wrap
|
||||
## `gl_handle`
|
||||
the optional OpenGL handle to wrap or 0
|
||||
## `user_data`
|
||||
user data to call `notify` with
|
||||
## `notify`
|
||||
a `GDestroyNotify`
|
||||
|
||||
# Returns
|
||||
|
||||
initializes `self` with the parameters specified
|
||||
<!-- struct GLViewConvert -->
|
||||
Convert stereoscopic/multiview video using fragment shaders.
|
||||
|
||||
|
|
|
@ -3,13 +3,9 @@
|
|||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
||||
use crate::GLContext;
|
||||
use crate::GLSLProfile;
|
||||
use glib::error::ErrorDomain;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib::value::FromValue;
|
||||
|
@ -169,10 +165,21 @@ pub enum GLFormat {
|
|||
}
|
||||
|
||||
impl GLFormat {
|
||||
//#[doc(alias = "gst_gl_format_from_video_info")]
|
||||
//pub fn from_video_info<P: IsA<GLContext>>(context: &P, vinfo: /*Ignored*/&mut gst_video::VideoInfo, plane: u32) -> GLFormat {
|
||||
// unsafe { TODO: call ffi:gst_gl_format_from_video_info() }
|
||||
//}
|
||||
#[doc(alias = "gst_gl_format_from_video_info")]
|
||||
pub fn from_video_info<P: IsA<GLContext>>(
|
||||
context: &P,
|
||||
vinfo: &gst_video::VideoInfo,
|
||||
plane: u32,
|
||||
) -> GLFormat {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
from_glib(ffi::gst_gl_format_from_video_info(
|
||||
context.as_ref().to_glib_none().0,
|
||||
mut_override(vinfo.to_glib_none().0),
|
||||
plane,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
||||
|
|
37
gstreamer-gl/src/auto/gl_allocation_params.rs
Normal file
37
gstreamer-gl/src/auto/gl_allocation_params.rs
Normal file
|
@ -0,0 +1,37 @@
|
|||
// 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
|
||||
|
||||
use glib::translate::*;
|
||||
|
||||
glib::wrapper! {
|
||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct GLAllocationParams(Boxed<ffi::GstGLAllocationParams>);
|
||||
|
||||
match fn {
|
||||
copy => |ptr| ffi::gst_gl_allocation_params_copy(mut_override(ptr)),
|
||||
free => |ptr| ffi::gst_gl_allocation_params_free(ptr),
|
||||
get_type => || ffi::gst_gl_allocation_params_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl GLAllocationParams {
|
||||
#[doc(alias = "gst_gl_allocation_params_copy_data")]
|
||||
pub fn copy_data(&self, dest: &mut GLAllocationParams) {
|
||||
unsafe {
|
||||
ffi::gst_gl_allocation_params_copy_data(
|
||||
mut_override(self.to_glib_none().0),
|
||||
dest.to_glib_none_mut().0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "gst_gl_allocation_params_init")]
|
||||
//pub fn init<P: Fn(&GLAllocationParams, &GLAllocationParams) + Send + Sync + 'static, Q: IsA<GLContext>>(&mut self, struct_size: usize, alloc_flags: u32, copy: P, free: /*Unimplemented*/Fn(/*Unimplemented*/Option<Fundamental: Pointer>), context: &Q, alloc_size: usize, alloc_params: Option<&mut gst::AllocationParams>, wrapped_data: /*Unimplemented*/Option<Fundamental: Pointer>, gl_handle: /*Unimplemented*/Option<Fundamental: Pointer>, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> bool {
|
||||
// unsafe { TODO: call ffi:gst_gl_allocation_params_init() }
|
||||
//}
|
||||
}
|
||||
|
||||
unsafe impl Send for GLAllocationParams {}
|
||||
unsafe impl Sync for GLAllocationParams {}
|
|
@ -14,7 +14,7 @@ use std::boxed::Box as Box_;
|
|||
use std::mem::transmute;
|
||||
|
||||
glib::wrapper! {
|
||||
pub struct GLBaseFilter(Object<ffi::GstGLBaseFilter, ffi::GstGLBaseFilterClass>) @extends gst::Object;
|
||||
pub struct GLBaseFilter(Object<ffi::GstGLBaseFilter, ffi::GstGLBaseFilterClass>) @extends gst_base::BaseTransform, gst::Element, gst::Object;
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::gst_gl_base_filter_get_type(),
|
||||
|
@ -27,6 +27,8 @@ unsafe impl Sync for GLBaseFilter {}
|
|||
pub const NONE_GL_BASE_FILTER: Option<&GLBaseFilter> = None;
|
||||
|
||||
pub trait GLBaseFilterExt: 'static {
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
||||
#[doc(alias = "gst_gl_base_filter_find_gl_context")]
|
||||
fn find_gl_context(&self) -> bool;
|
||||
|
||||
|
@ -45,6 +47,8 @@ pub trait GLBaseFilterExt: 'static {
|
|||
}
|
||||
|
||||
impl<O: IsA<GLBaseFilter>> GLBaseFilterExt for O {
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
||||
fn find_gl_context(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_gl_base_filter_find_gl_context(
|
||||
|
|
19
gstreamer-gl/src/auto/gl_base_memory_allocator.rs
Normal file
19
gstreamer-gl/src/auto/gl_base_memory_allocator.rs
Normal file
|
@ -0,0 +1,19 @@
|
|||
// 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
|
||||
|
||||
glib::wrapper! {
|
||||
pub struct GLBaseMemoryAllocator(Object<ffi::GstGLBaseMemoryAllocator, ffi::GstGLBaseMemoryAllocatorClass>) @extends gst::Allocator, gst::Object;
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::gst_gl_base_memory_allocator_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl GLBaseMemoryAllocator {}
|
||||
|
||||
unsafe impl Send for GLBaseMemoryAllocator {}
|
||||
unsafe impl Sync for GLBaseMemoryAllocator {}
|
||||
|
||||
pub const NONE_GL_BASE_MEMORY_ALLOCATOR: Option<&GLBaseMemoryAllocator> = None;
|
116
gstreamer-gl/src/auto/gl_filter.rs
Normal file
116
gstreamer-gl/src/auto/gl_filter.rs
Normal file
|
@ -0,0 +1,116 @@
|
|||
// 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
|
||||
|
||||
use crate::GLBaseFilter;
|
||||
use crate::GLMemory;
|
||||
use crate::GLShader;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
|
||||
glib::wrapper! {
|
||||
pub struct GLFilter(Object<ffi::GstGLFilter, ffi::GstGLFilterClass>) @extends GLBaseFilter, gst_base::BaseTransform, gst::Element, gst::Object;
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::gst_gl_filter_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for GLFilter {}
|
||||
unsafe impl Sync for GLFilter {}
|
||||
|
||||
pub const NONE_GL_FILTER: Option<&GLFilter> = None;
|
||||
|
||||
pub trait GLFilterExt: 'static {
|
||||
#[doc(alias = "gst_gl_filter_draw_fullscreen_quad")]
|
||||
fn draw_fullscreen_quad(&self);
|
||||
|
||||
#[doc(alias = "gst_gl_filter_filter_texture")]
|
||||
fn filter_texture(
|
||||
&self,
|
||||
input: &gst::Buffer,
|
||||
output: &gst::Buffer,
|
||||
) -> Result<(), glib::error::BoolError>;
|
||||
|
||||
#[doc(alias = "gst_gl_filter_render_to_target")]
|
||||
fn render_to_target<P: FnMut(&GLFilter, &GLMemory) -> bool>(
|
||||
&self,
|
||||
input: &GLMemory,
|
||||
output: &GLMemory,
|
||||
func: P,
|
||||
) -> Result<(), glib::error::BoolError>;
|
||||
|
||||
#[doc(alias = "gst_gl_filter_render_to_target_with_shader")]
|
||||
fn render_to_target_with_shader(&self, input: &GLMemory, output: &GLMemory, shader: &GLShader);
|
||||
}
|
||||
|
||||
impl<O: IsA<GLFilter>> GLFilterExt for O {
|
||||
fn draw_fullscreen_quad(&self) {
|
||||
unsafe {
|
||||
ffi::gst_gl_filter_draw_fullscreen_quad(self.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn filter_texture(
|
||||
&self,
|
||||
input: &gst::Buffer,
|
||||
output: &gst::Buffer,
|
||||
) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib::result_from_gboolean!(
|
||||
ffi::gst_gl_filter_filter_texture(
|
||||
self.as_ref().to_glib_none().0,
|
||||
input.to_glib_none().0,
|
||||
output.to_glib_none().0
|
||||
),
|
||||
"Failed to transform texture"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fn render_to_target<P: FnMut(&GLFilter, &GLMemory) -> bool>(
|
||||
&self,
|
||||
input: &GLMemory,
|
||||
output: &GLMemory,
|
||||
func: P,
|
||||
) -> Result<(), glib::error::BoolError> {
|
||||
let func_data: P = func;
|
||||
unsafe extern "C" fn func_func<P: FnMut(&GLFilter, &GLMemory) -> bool>(
|
||||
filter: *mut ffi::GstGLFilter,
|
||||
in_tex: *mut ffi::GstGLMemory,
|
||||
user_data: glib::ffi::gpointer,
|
||||
) -> glib::ffi::gboolean {
|
||||
let filter = from_glib_borrow(filter);
|
||||
let in_tex = from_glib_borrow(in_tex);
|
||||
let callback: *mut P = user_data as *const _ as usize as *mut P;
|
||||
let res = (*callback)(&filter, &in_tex);
|
||||
res.to_glib()
|
||||
}
|
||||
let func = Some(func_func::<P> as _);
|
||||
let super_callback0: &P = &func_data;
|
||||
unsafe {
|
||||
glib::result_from_gboolean!(
|
||||
ffi::gst_gl_filter_render_to_target(
|
||||
self.as_ref().to_glib_none().0,
|
||||
mut_override(input.to_glib_none().0),
|
||||
mut_override(output.to_glib_none().0),
|
||||
func,
|
||||
super_callback0 as *const _ as usize as *mut _
|
||||
),
|
||||
"`func` returned `false`"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fn render_to_target_with_shader(&self, input: &GLMemory, output: &GLMemory, shader: &GLShader) {
|
||||
unsafe {
|
||||
ffi::gst_gl_filter_render_to_target_with_shader(
|
||||
self.as_ref().to_glib_none().0,
|
||||
mut_override(input.to_glib_none().0),
|
||||
mut_override(output.to_glib_none().0),
|
||||
shader.to_glib_none().0,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::GLBaseMemory;
|
||||
use crate::GLContext;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
|
@ -50,14 +51,14 @@ unsafe impl Sync for GLFramebuffer {}
|
|||
pub const NONE_GL_FRAMEBUFFER: Option<&GLFramebuffer> = None;
|
||||
|
||||
pub trait GLFramebufferExt: 'static {
|
||||
//#[doc(alias = "gst_gl_framebuffer_attach")]
|
||||
//fn attach(&self, attachment_point: u32, mem: /*Ignored*/&mut GLBaseMemory);
|
||||
#[doc(alias = "gst_gl_framebuffer_attach")]
|
||||
unsafe fn attach(&self, attachment_point: u32, mem: &mut GLBaseMemory);
|
||||
|
||||
#[doc(alias = "gst_gl_framebuffer_bind")]
|
||||
fn bind(&self);
|
||||
|
||||
//#[doc(alias = "gst_gl_framebuffer_draw_to_texture")]
|
||||
//fn draw_to_texture(&self, mem: /*Ignored*/&mut GLMemory, func: /*Unimplemented*/FnMut(/*Unimplemented*/Option<Fundamental: Pointer>) -> bool, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> bool;
|
||||
//fn draw_to_texture(&self, mem: &mut GLMemory, func: /*Unimplemented*/FnMut(/*Unimplemented*/Option<Fundamental: Pointer>) -> bool, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> bool;
|
||||
|
||||
#[doc(alias = "gst_gl_framebuffer_get_effective_dimensions")]
|
||||
fn effective_dimensions(&self) -> (u32, u32);
|
||||
|
@ -67,9 +68,13 @@ pub trait GLFramebufferExt: 'static {
|
|||
}
|
||||
|
||||
impl<O: IsA<GLFramebuffer>> GLFramebufferExt for O {
|
||||
//fn attach(&self, attachment_point: u32, mem: /*Ignored*/&mut GLBaseMemory) {
|
||||
// unsafe { TODO: call ffi:gst_gl_framebuffer_attach() }
|
||||
//}
|
||||
unsafe fn attach(&self, attachment_point: u32, mem: &mut GLBaseMemory) {
|
||||
ffi::gst_gl_framebuffer_attach(
|
||||
self.as_ref().to_glib_none().0,
|
||||
attachment_point,
|
||||
mem.to_glib_none_mut().0,
|
||||
);
|
||||
}
|
||||
|
||||
fn bind(&self) {
|
||||
unsafe {
|
||||
|
@ -77,7 +82,7 @@ impl<O: IsA<GLFramebuffer>> GLFramebufferExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
//fn draw_to_texture(&self, mem: /*Ignored*/&mut GLMemory, func: /*Unimplemented*/FnMut(/*Unimplemented*/Option<Fundamental: Pointer>) -> bool, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> bool {
|
||||
//fn draw_to_texture(&self, mem: &mut GLMemory, func: /*Unimplemented*/FnMut(/*Unimplemented*/Option<Fundamental: Pointer>) -> bool, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> bool {
|
||||
// unsafe { TODO: call ffi:gst_gl_framebuffer_draw_to_texture() }
|
||||
//}
|
||||
|
||||
|
|
34
gstreamer-gl/src/auto/gl_memory_allocator.rs
Normal file
34
gstreamer-gl/src/auto/gl_memory_allocator.rs
Normal file
|
@ -0,0 +1,34 @@
|
|||
// 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
|
||||
|
||||
use crate::GLBaseMemoryAllocator;
|
||||
use crate::GLContext;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
|
||||
glib::wrapper! {
|
||||
pub struct GLMemoryAllocator(Object<ffi::GstGLMemoryAllocator, ffi::GstGLMemoryAllocatorClass>) @extends GLBaseMemoryAllocator, gst::Allocator, gst::Object;
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::gst_gl_memory_allocator_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl GLMemoryAllocator {
|
||||
#[doc(alias = "gst_gl_memory_allocator_get_default")]
|
||||
pub fn get_default<P: IsA<GLContext>>(context: &P) -> Option<GLMemoryAllocator> {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_gl_memory_allocator_get_default(
|
||||
context.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for GLMemoryAllocator {}
|
||||
unsafe impl Sync for GLMemoryAllocator {}
|
||||
|
||||
pub const NONE_GL_MEMORY_ALLOCATOR: Option<&GLMemoryAllocator> = None;
|
80
gstreamer-gl/src/auto/gl_video_allocation_params.rs
Normal file
80
gstreamer-gl/src/auto/gl_video_allocation_params.rs
Normal file
|
@ -0,0 +1,80 @@
|
|||
// 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
|
||||
|
||||
use crate::GLContext;
|
||||
use crate::GLFormat;
|
||||
use crate::GLTextureTarget;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
|
||||
glib::wrapper! {
|
||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct GLVideoAllocationParams(Boxed<ffi::GstGLVideoAllocationParams>);
|
||||
|
||||
match fn {
|
||||
copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::gst_gl_video_allocation_params_get_type(), ptr as *mut _) as *mut ffi::GstGLVideoAllocationParams,
|
||||
free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::gst_gl_video_allocation_params_get_type(), ptr as *mut _),
|
||||
get_type => || ffi::gst_gl_video_allocation_params_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl GLVideoAllocationParams {
|
||||
#[doc(alias = "gst_gl_video_allocation_params_new")]
|
||||
pub fn new<P: IsA<GLContext>>(
|
||||
context: &P,
|
||||
alloc_params: Option<&gst::AllocationParams>,
|
||||
v_info: &gst_video::VideoInfo,
|
||||
plane: u32,
|
||||
valign: Option<&gst_video::VideoAlignment>,
|
||||
target: GLTextureTarget,
|
||||
tex_format: GLFormat,
|
||||
) -> GLVideoAllocationParams {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_gl_video_allocation_params_new(
|
||||
context.as_ref().to_glib_none().0,
|
||||
mut_override(alloc_params.to_glib_none().0),
|
||||
mut_override(v_info.to_glib_none().0),
|
||||
plane,
|
||||
mut_override(valign.to_glib_none().0),
|
||||
target.to_glib(),
|
||||
tex_format.to_glib(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "gst_gl_video_allocation_params_new_wrapped_data")]
|
||||
//pub fn new_wrapped_data<P: IsA<GLContext>>(context: &P, alloc_params: Option<&mut gst::AllocationParams>, v_info: &mut gst_video::VideoInfo, plane: u32, valign: Option<&mut gst_video::VideoAlignment>, target: GLTextureTarget, tex_format: GLFormat, wrapped_data: /*Unimplemented*/Option<Fundamental: Pointer>, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> GLVideoAllocationParams {
|
||||
// unsafe { TODO: call ffi:gst_gl_video_allocation_params_new_wrapped_data() }
|
||||
//}
|
||||
|
||||
//#[doc(alias = "gst_gl_video_allocation_params_new_wrapped_gl_handle")]
|
||||
//pub fn new_wrapped_gl_handle<P: IsA<GLContext>>(context: &P, alloc_params: Option<&mut gst::AllocationParams>, v_info: &mut gst_video::VideoInfo, plane: u32, valign: Option<&mut gst_video::VideoAlignment>, target: GLTextureTarget, tex_format: GLFormat, gl_handle: /*Unimplemented*/Option<Fundamental: Pointer>, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> GLVideoAllocationParams {
|
||||
// unsafe { TODO: call ffi:gst_gl_video_allocation_params_new_wrapped_gl_handle() }
|
||||
//}
|
||||
|
||||
//#[doc(alias = "gst_gl_video_allocation_params_new_wrapped_texture")]
|
||||
//pub fn new_wrapped_texture<P: IsA<GLContext>>(context: &P, alloc_params: Option<&mut gst::AllocationParams>, v_info: &mut gst_video::VideoInfo, plane: u32, valign: Option<&mut gst_video::VideoAlignment>, target: GLTextureTarget, tex_format: GLFormat, tex_id: u32, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> GLVideoAllocationParams {
|
||||
// unsafe { TODO: call ffi:gst_gl_video_allocation_params_new_wrapped_texture() }
|
||||
//}
|
||||
|
||||
#[doc(alias = "gst_gl_video_allocation_params_copy_data")]
|
||||
pub fn copy_data(&self, dest_vid: &mut GLVideoAllocationParams) {
|
||||
unsafe {
|
||||
ffi::gst_gl_video_allocation_params_copy_data(
|
||||
mut_override(self.to_glib_none().0),
|
||||
dest_vid.to_glib_none_mut().0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "gst_gl_video_allocation_params_init_full")]
|
||||
//pub fn init_full<P: Fn(&GLAllocationParams, &GLAllocationParams) + Send + Sync + 'static, Q: IsA<GLContext>>(&mut self, struct_size: usize, alloc_flags: u32, copy: P, free: /*Unimplemented*/Fn(/*Unimplemented*/Option<Fundamental: Pointer>), context: &Q, alloc_params: Option<&mut gst::AllocationParams>, v_info: &mut gst_video::VideoInfo, plane: u32, valign: Option<&mut gst_video::VideoAlignment>, target: GLTextureTarget, tex_format: GLFormat, wrapped_data: /*Unimplemented*/Option<Fundamental: Pointer>, gl_handle: /*Unimplemented*/Option<Fundamental: Pointer>, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> bool {
|
||||
// unsafe { TODO: call ffi:gst_gl_video_allocation_params_init_full() }
|
||||
//}
|
||||
}
|
||||
|
||||
unsafe impl Send for GLVideoAllocationParams {}
|
||||
unsafe impl Sync for GLVideoAllocationParams {}
|
|
@ -3,16 +3,13 @@
|
|||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
||||
mod gl_base_filter;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
||||
pub use self::gl_base_filter::GLBaseFilterExt;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
||||
pub use self::gl_base_filter::{GLBaseFilter, NONE_GL_BASE_FILTER};
|
||||
|
||||
mod gl_base_memory_allocator;
|
||||
pub use self::gl_base_memory_allocator::{GLBaseMemoryAllocator, NONE_GL_BASE_MEMORY_ALLOCATOR};
|
||||
|
||||
mod gl_color_convert;
|
||||
pub use self::gl_color_convert::GLColorConvert;
|
||||
|
||||
|
@ -24,10 +21,17 @@ mod gl_display;
|
|||
pub use self::gl_display::GLDisplayExt;
|
||||
pub use self::gl_display::{GLDisplay, NONE_GL_DISPLAY};
|
||||
|
||||
mod gl_filter;
|
||||
pub use self::gl_filter::GLFilterExt;
|
||||
pub use self::gl_filter::{GLFilter, NONE_GL_FILTER};
|
||||
|
||||
mod gl_framebuffer;
|
||||
pub use self::gl_framebuffer::GLFramebufferExt;
|
||||
pub use self::gl_framebuffer::{GLFramebuffer, NONE_GL_FRAMEBUFFER};
|
||||
|
||||
mod gl_memory_allocator;
|
||||
pub use self::gl_memory_allocator::{GLMemoryAllocator, NONE_GL_MEMORY_ALLOCATOR};
|
||||
|
||||
mod gl_overlay_compositor;
|
||||
pub use self::gl_overlay_compositor::GLOverlayCompositor;
|
||||
|
||||
|
@ -47,6 +51,12 @@ mod gl_window;
|
|||
pub use self::gl_window::GLWindowExt;
|
||||
pub use self::gl_window::{GLWindow, NONE_GL_WINDOW};
|
||||
|
||||
mod gl_allocation_params;
|
||||
pub use self::gl_allocation_params::GLAllocationParams;
|
||||
|
||||
mod gl_video_allocation_params;
|
||||
pub use self::gl_video_allocation_params::GLVideoAllocationParams;
|
||||
|
||||
mod enums;
|
||||
pub use self::enums::GLContextError;
|
||||
pub use self::enums::GLFormat;
|
||||
|
@ -66,11 +76,10 @@ pub use self::flags::GLAPI;
|
|||
|
||||
#[doc(hidden)]
|
||||
pub mod traits {
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
||||
pub use super::GLBaseFilterExt;
|
||||
pub use super::GLContextExt;
|
||||
pub use super::GLDisplayExt;
|
||||
pub use super::GLFilterExt;
|
||||
pub use super::GLFramebufferExt;
|
||||
pub use super::GLWindowExt;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue