use glib::translate::*;
use crate::{ffi, ShmAllocator};
impl ShmAllocator {
/// Get the [`ShmAllocator`][crate::ShmAllocator] singleton previously registered with
/// [`init_once()`][Self::init_once()].
///
/// # Returns
///
/// a [`gst::Allocator`][crate::gst::Allocator] or [`None`] if
/// [`init_once()`][Self::init_once()] has not been previously called.
#[doc(alias = "gst_shm_allocator_get")]
pub fn get() -> Option<gst::Allocator> {
assert_initialized_main_thread!();
unsafe {
ffi::gst_shm_allocator_init_once();
from_glib_full(ffi::gst_shm_allocator_get())
}
}
}