gstreamer_gl/auto/
gl_buffer_pool.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
4// DO NOT EDIT
5
6#[cfg(feature = "v1_20")]
7#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
8use crate::GLAllocationParams;
9use crate::{ffi, GLContext};
10use glib::{prelude::*, translate::*};
11
12glib::wrapper! {
13    #[doc(alias = "GstGLBufferPool")]
14    pub struct GLBufferPool(Object<ffi::GstGLBufferPool, ffi::GstGLBufferPoolClass>) @extends gst::BufferPool, gst::Object;
15
16    match fn {
17        type_ => || ffi::gst_gl_buffer_pool_get_type(),
18    }
19}
20
21impl GLBufferPool {
22    pub const NONE: Option<&'static GLBufferPool> = None;
23
24    #[doc(alias = "gst_gl_buffer_pool_new")]
25    pub fn new(context: &impl IsA<GLContext>) -> GLBufferPool {
26        skip_assert_initialized!();
27        unsafe {
28            gst::BufferPool::from_glib_none(ffi::gst_gl_buffer_pool_new(
29                context.as_ref().to_glib_none().0,
30            ))
31            .unsafe_cast()
32        }
33    }
34}
35
36unsafe impl Send for GLBufferPool {}
37unsafe impl Sync for GLBufferPool {}
38
39mod sealed {
40    pub trait Sealed {}
41    impl<T: super::IsA<super::GLBufferPool>> Sealed for T {}
42}
43
44pub trait GLBufferPoolExt: IsA<GLBufferPool> + sealed::Sealed + 'static {
45    #[cfg(feature = "v1_20")]
46    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
47    #[doc(alias = "gst_gl_buffer_pool_get_gl_allocation_params")]
48    #[doc(alias = "get_gl_allocation_params")]
49    fn gl_allocation_params(&self) -> Option<GLAllocationParams> {
50        unsafe {
51            from_glib_full(ffi::gst_gl_buffer_pool_get_gl_allocation_params(
52                self.as_ref().to_glib_none().0,
53            ))
54        }
55    }
56}
57
58impl<O: IsA<GLBufferPool>> GLBufferPoolExt for O {}