gstreamer-rs/gstreamer-validate/src/functions.rs
Bilal Elmoussaoui 4ebec84f5e Adapt to no longer renamed ffi crates
Allows us to set all the crates in the main workspace file, so changing
their versions or branch is much simpler and reduce the amount of noise
in the diff

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1450>
2024-06-02 11:20:55 +02:00

50 lines
1.2 KiB
Rust

// Take a look at the license at the top of the repository in the LICENSE file.
use crate::ffi;
use glib::translate::*;
#[doc(alias = "gst_validate_init")]
pub fn init() {
unsafe {
ffi::gst_validate_init();
crate::INITIALIZED.store(true, std::sync::atomic::Ordering::SeqCst);
}
}
#[doc(alias = "gst_validate_init_debug")]
pub fn init_debug() {
unsafe {
ffi::gst_validate_init_debug();
}
}
#[doc(alias = "gst_validate_setup_test_file")]
pub fn setup_test_file(test_file: &str, use_fakesinks: bool) -> gst::Structure {
skip_assert_initialized!();
unsafe {
from_glib_full(ffi::gst_validate_setup_test_file(
test_file.to_glib_none().0,
use_fakesinks as i32,
))
}
}
#[doc(alias = "gst_validate_print_action_types")]
pub fn print_action_types(action_types: Vec<&str>) {
assert_initialized_main_thread!();
unsafe {
ffi::gst_validate_print_action_types(
action_types.to_glib_none().0,
action_types.len() as i32,
);
}
}
#[cfg(test)]
mod tests {
#[test]
fn test_init() {
gst::init().unwrap();
crate::init();
}
}