gstreamer_allocators/auto/dma_buf_allocator.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, FdAllocator};
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10 #[doc(alias = "GstDmaBufAllocator")]
11 pub struct DmaBufAllocator(Object<ffi::GstDmaBufAllocator, ffi::GstDmaBufAllocatorClass>) @extends FdAllocator, gst::Allocator;
12
13 match fn {
14 type_ => || ffi::gst_dmabuf_allocator_get_type(),
15 }
16}
17
18impl DmaBufAllocator {
19 pub const NONE: Option<&'static DmaBufAllocator> = None;
20
21 #[doc(alias = "gst_dmabuf_allocator_new")]
22 pub fn new() -> DmaBufAllocator {
23 assert_initialized_main_thread!();
24 unsafe { gst::Allocator::from_glib_full(ffi::gst_dmabuf_allocator_new()).unsafe_cast() }
25 }
26}
27
28impl Default for DmaBufAllocator {
29 fn default() -> Self {
30 Self::new()
31 }
32}
33
34unsafe impl Send for DmaBufAllocator {}
35unsafe impl Sync for DmaBufAllocator {}