gstreamer_allocators/shm_allocator.rs
1use glib::translate::*;
2
3use crate::{ffi, ShmAllocator};
4
5impl ShmAllocator {
6 #[doc(alias = "gst_shm_allocator_get")]
7 pub fn get() -> Option<gst::Allocator> {
8 assert_initialized_main_thread!();
9 unsafe {
10 ffi::gst_shm_allocator_init_once();
11 from_glib_full(ffi::gst_shm_allocator_get())
12 }
13 }
14}