1// Take a look at the license at the top of the repository in the LICENSE file.
23#![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")]
78pub use gstreamer_validate_sys as ffi;
910#[doc(hidden)]
11pub static INITIALIZED: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
1213#[cold]
14#[inline(never)]
15#[track_caller]
16pub fn assert_initialized() {
17if unsafe { ffi::gst_validate_is_initialized() } != glib::ffi::GTRUE {
18panic!("GStreamer Validate has not been initialized. Call `gst_validate::init` first.");
19 } else {
20crate::INITIALIZED.store(true, std::sync::atomic::Ordering::SeqCst);
21 }
22}
2324macro_rules! assert_initialized_main_thread {
25 () => {
26if !gst::INITIALIZED.load(std::sync::atomic::Ordering::SeqCst) {
27 gst::assert_initialized();
28 }
2930if !crate::INITIALIZED.load(std::sync::atomic::Ordering::SeqCst) {
31$crate::assert_initialized();
32 }
33 };
34}
3536macro_rules! skip_assert_initialized {
37 () => {};
38}
3940#[allow(clippy::needless_borrow)]
41#[allow(unused_imports)]
42mod auto;
43pub use crate::auto::*;
4445mod functions;
46pub use functions::*;
4748mod action_type;
49pub use action_type::*;
5051mod enums;
52pub use enums::*;
5354mod action;
55pub use action::{Action, ActionRef};
5657mod reporter;
5859// Re-export all the traits in a prelude module, so that applications
60// can always "use gst_validate::prelude::*" without getting conflicts
61pub mod prelude {
62#[doc(hidden)]
63pub use gst::prelude::*;
6465pub use crate::action_type::ActionTypeExtManual;
66pub use crate::auto::traits::*;
67}