gstreamer_video/auto/
video_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
6use crate::ffi;
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10    ///
11    ///
12    /// # Implements
13    ///
14    /// [`trait@gst::prelude::BufferPoolExt`], [`trait@gst::prelude::ObjectExt`], [`trait@glib::ObjectExt`]
15    #[doc(alias = "GstVideoBufferPool")]
16    pub struct VideoBufferPool(Object<ffi::GstVideoBufferPool, ffi::GstVideoBufferPoolClass>) @extends gst::BufferPool, gst::Object;
17
18    match fn {
19        type_ => || ffi::gst_video_buffer_pool_get_type(),
20    }
21}
22
23impl VideoBufferPool {
24    pub const NONE: Option<&'static VideoBufferPool> = None;
25
26    /// Create a new bufferpool that can allocate video frames. This bufferpool
27    /// supports all the video bufferpool options.
28    ///
29    /// # Returns
30    ///
31    /// a new [`gst::BufferPool`][crate::gst::BufferPool] to allocate video frames
32    #[doc(alias = "gst_video_buffer_pool_new")]
33    pub fn new() -> VideoBufferPool {
34        assert_initialized_main_thread!();
35        unsafe { gst::BufferPool::from_glib_full(ffi::gst_video_buffer_pool_new()).unsafe_cast() }
36    }
37}
38
39impl Default for VideoBufferPool {
40    fn default() -> Self {
41        Self::new()
42    }
43}
44
45unsafe impl Send for VideoBufferPool {}
46unsafe impl Sync for VideoBufferPool {}