2017-05-12 12:24:03 +00:00
|
|
|
#[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;
|
|
|
|
|
2017-07-03 09:26:40 +00:00
|
|
|
use glib::translate::{from_glib, from_glib_full};
|
|
|
|
|
2017-05-12 12:24:03 +00:00
|
|
|
macro_rules! callback_guard {
|
|
|
|
() => (
|
|
|
|
let _guard = ::glib::CallbackGuard::new();
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
pub use glib::{
|
|
|
|
Cast,
|
|
|
|
Continue,
|
|
|
|
Error,
|
|
|
|
IsA,
|
|
|
|
StaticType,
|
|
|
|
ToValue,
|
|
|
|
Type,
|
|
|
|
TypedValue,
|
|
|
|
Value,
|
|
|
|
};
|
|
|
|
|
|
|
|
mod auto;
|
2017-07-03 15:08:43 +00:00
|
|
|
pub use auto::*;
|
2017-07-03 14:57:57 +00:00
|
|
|
pub use auto::functions::{parse_launch, parse_bin_from_description};
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2017-07-03 10:56:26 +00:00
|
|
|
pub mod miniobject;
|
|
|
|
pub use miniobject::GstRc;
|
|
|
|
pub mod message;
|
|
|
|
pub use message::Message;
|
2017-07-03 15:08:43 +00:00
|
|
|
pub use message::MessageView;
|
2017-07-03 10:56:26 +00:00
|
|
|
|
2017-05-12 12:24:03 +00:00
|
|
|
use std::ptr;
|
|
|
|
|
2017-07-03 09:26:40 +00:00
|
|
|
pub fn init() -> Result<(), glib::Error> {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2017-07-03 09:26:40 +00:00
|
|
|
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))
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|