gstreamer_video/auto/video_dmabuf_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
6use crate::{VideoBufferPool, ffi};
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10 /// Using `GstUdmabufAllocator`, setting defaults and implementing implicit sync.
11 ///
12 /// # Implements
13 ///
14 /// [`VideoBufferPoolExt`][trait@crate::prelude::VideoBufferPoolExt], [`trait@gst::prelude::BufferPoolExt`], [`trait@gst::prelude::ObjectExt`], [`trait@glib::ObjectExt`]
15 #[doc(alias = "GstVideoDmabufPool")]
16 pub struct VideoDmabufPool(Object<ffi::GstVideoDmabufPool, ffi::GstVideoDmabufPoolClass>) @extends VideoBufferPool, gst::BufferPool, gst::Object;
17
18 match fn {
19 type_ => || ffi::gst_video_dmabuf_pool_get_type(),
20 }
21}
22
23impl VideoDmabufPool {
24 /// Create a new [`VideoDmabufPool`][crate::VideoDmabufPool] instance.
25 ///
26 /// # Returns
27 ///
28 /// a [`VideoDmabufPool`][crate::VideoDmabufPool] or [`None`]
29 /// if dmabufs are not supported.
30 #[doc(alias = "gst_video_dmabuf_pool_new")]
31 pub fn new() -> Option<VideoDmabufPool> {
32 assert_initialized_main_thread!();
33 unsafe {
34 Option::<gst::BufferPool>::from_glib_full(ffi::gst_video_dmabuf_pool_new())
35 .map(|o| o.unsafe_cast())
36 }
37 }
38}
39
40unsafe impl Send for VideoDmabufPool {}
41unsafe impl Sync for VideoDmabufPool {}