gstreamer_gl/auto/
gl_memory_allocator.rs1use crate::{ffi, GLBaseMemoryAllocator, GLContext};
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10    #[doc(alias = "GstGLMemoryAllocator")]
16    pub struct GLMemoryAllocator(Object<ffi::GstGLMemoryAllocator, ffi::GstGLMemoryAllocatorClass>) @extends GLBaseMemoryAllocator, gst::Allocator, gst::Object;
17
18    match fn {
19        type_ => || ffi::gst_gl_memory_allocator_get_type(),
20    }
21}
22
23impl GLMemoryAllocator {
24    pub const NONE: Option<&'static GLMemoryAllocator> = None;
25
26    #[doc(alias = "gst_gl_memory_allocator_get_default")]
34    #[doc(alias = "get_default")]
35    #[allow(clippy::should_implement_trait)]
36    pub fn default(context: &impl IsA<GLContext>) -> GLMemoryAllocator {
37        skip_assert_initialized!();
38        unsafe {
39            from_glib_full(ffi::gst_gl_memory_allocator_get_default(
40                context.as_ref().to_glib_none().0,
41            ))
42        }
43    }
44}
45
46unsafe impl Send for GLMemoryAllocator {}
47unsafe impl Sync for GLMemoryAllocator {}