mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-06-11 02:39:24 +00:00
ba1d8c5ce6
This keeps the number of duplicated panics all over the codebase lower and reduces generated code size. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1184>
28 lines
604 B
Rust
28 lines
604 B
Rust
#![cfg_attr(feature = "dox", feature(doc_cfg))]
|
|
#![allow(clippy::missing_safety_doc)]
|
|
#![allow(clippy::non_send_fields_in_send_ty)]
|
|
|
|
use std::sync::Once;
|
|
|
|
pub use ffi::*;
|
|
pub use glib;
|
|
pub use gst;
|
|
|
|
static MPEGTS_INIT: Once = Once::new();
|
|
|
|
macro_rules! assert_initialized_main_thread {
|
|
() => {
|
|
if !gst::INITIALIZED.load(std::sync::atomic::Ordering::SeqCst) {
|
|
gst::assert_initialized();
|
|
}
|
|
crate::MPEGTS_INIT.call_once(|| unsafe { ffi::gst_mpegts_initialize() });
|
|
};
|
|
}
|
|
|
|
pub fn init() {
|
|
assert_initialized_main_thread!();
|
|
}
|
|
|
|
mod auto;
|
|
pub use crate::auto::*;
|