1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// 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(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
use crate::GLAllocationParams;
use crate::GLContext;
use glib::{prelude::*, 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 {}

mod sealed {
    pub trait Sealed {}
    impl<T: super::IsA<super::GLBufferPool>> Sealed for T {}
}

pub trait GLBufferPoolExt: IsA<GLBufferPool> + sealed::Sealed + 'static {
    #[cfg(feature = "v1_20")]
    #[cfg_attr(docsrs, 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> {
        unsafe {
            from_glib_full(ffi::gst_gl_buffer_pool_get_gl_allocation_params(
                self.as_ref().to_glib_none().0,
            ))
        }
    }
}

impl<O: IsA<GLBufferPool>> GLBufferPoolExt for O {}