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