Skip to main content

gstreamer_allocators/
lib.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3#![cfg_attr(docsrs, feature(doc_cfg))]
4#![allow(clippy::missing_safety_doc)]
5#![allow(clippy::manual_c_str_literals)]
6#![doc = include_str!("../README.md")]
7
8pub use glib;
9pub use gst;
10pub use gstreamer_allocators_sys as ffi;
11
12macro_rules! assert_initialized_main_thread {
13    () => {
14        if !gst::INITIALIZED.load(std::sync::atomic::Ordering::SeqCst) {
15            gst::assert_initialized();
16        }
17    };
18}
19
20macro_rules! skip_assert_initialized {
21    () => {};
22}
23
24#[allow(unused_imports)]
25mod auto;
26pub use crate::auto::*;
27
28mod caps_features;
29pub use crate::caps_features::CAPS_FEATURES_MEMORY_DMABUF;
30
31#[cfg(any(unix, docsrs))]
32#[cfg_attr(docsrs, doc(cfg(unix)))]
33mod fd_allocator;
34#[cfg(any(unix, docsrs))]
35#[cfg_attr(docsrs, doc(cfg(unix)))]
36pub use fd_allocator::*;
37
38#[cfg(any(target_os = "linux", docsrs))]
39#[cfg_attr(docsrs, doc(cfg(target_os = "linux")))]
40mod dma_buf_allocator;
41#[cfg(any(target_os = "linux", docsrs))]
42#[cfg_attr(docsrs, doc(cfg(target_os = "linux")))]
43pub use dma_buf_allocator::*;
44
45#[cfg(any(all(feature = "v1_24", target_os = "linux"), docsrs))]
46#[cfg_attr(docsrs, doc(cfg(all(feature = "v1_24", target_os = "linux"))))]
47mod drm_dumb_allocator;
48#[cfg(any(all(feature = "v1_24", target_os = "linux"), docsrs))]
49#[cfg_attr(docsrs, doc(cfg(all(feature = "v1_24", target_os = "linux"))))]
50pub use drm_dumb_allocator::*;
51
52#[cfg(any(all(feature = "v1_24", unix), docsrs))]
53#[cfg_attr(docsrs, doc(cfg(all(feature = "v1_24", unix))))]
54mod shm_allocator;
55
56mod phys_memory;
57pub use phys_memory::*;
58
59// Re-export all the traits in a prelude module, so that applications
60// can always "use gst_base::prelude::*" without getting conflicts
61pub mod prelude {
62    #[doc(hidden)]
63    pub use gst::prelude::*;
64
65    pub use crate::auto::traits::*;
66    #[cfg(any(target_os = "linux", docsrs))]
67    pub use crate::dma_buf_allocator::DmaBufAllocatorExtManual;
68    #[cfg(any(all(feature = "v1_24", target_os = "linux"), docsrs))]
69    pub use crate::drm_dumb_allocator::DRMDumbAllocatorExtManual;
70    pub use crate::fd_allocator::FdAllocatorExtManual;
71}
72
73pub mod subclass;