gstreamer-rs/gstreamer/src/lib.rs

47 lines
807 B
Rust
Raw Normal View History

#[macro_use]
extern crate bitflags;
extern crate libc;
extern crate glib_sys as glib_ffi;
extern crate gobject_sys as gobject_ffi;
extern crate gstreamer_sys as ffi;
#[macro_use]
extern crate glib;
use glib::translate::{from_glib, from_glib_full};
macro_rules! callback_guard {
() => (
let _guard = ::glib::CallbackGuard::new();
)
}
pub use glib::{
Cast,
Continue,
Error,
IsA,
StaticType,
ToValue,
Type,
TypedValue,
Value,
};
pub use auto::*;
mod auto;
use std::ptr;
pub fn init() -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
if from_glib(ffi::gst_init_check(ptr::null_mut(), ptr::null_mut(), &mut error)) {
Ok(())
} else {
Err(from_glib_full(error))
}
}
}