gstreamer_allocators/auto/
dma_buf_allocator.rs
1use crate::{ffi, FdAllocator};
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10 #[doc(alias = "GstDmaBufAllocator")]
16 pub struct DmaBufAllocator(Object<ffi::GstDmaBufAllocator, ffi::GstDmaBufAllocatorClass>) @extends FdAllocator, gst::Allocator;
17
18 match fn {
19 type_ => || ffi::gst_dmabuf_allocator_get_type(),
20 }
21}
22
23impl DmaBufAllocator {
24 pub const NONE: Option<&'static DmaBufAllocator> = None;
25
26 #[doc(alias = "gst_dmabuf_allocator_new")]
33 pub fn new() -> DmaBufAllocator {
34 assert_initialized_main_thread!();
35 unsafe { gst::Allocator::from_glib_full(ffi::gst_dmabuf_allocator_new()).unsafe_cast() }
36 }
37}
38
39impl Default for DmaBufAllocator {
40 fn default() -> Self {
41 Self::new()
42 }
43}
44
45unsafe impl Send for DmaBufAllocator {}
46unsafe impl Sync for DmaBufAllocator {}