2017-07-07 11:47:28 +00:00
|
|
|
// Copyright (C) 2017 Sebastian Dröge <sebastian@centricular.com>
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
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-12 10:25:11 +00:00
|
|
|
extern crate num_rational;
|
|
|
|
|
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();
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2017-07-10 09:36:15 +00:00
|
|
|
macro_rules! assert_initialized_main_thread {
|
|
|
|
() => (
|
|
|
|
assert_eq!(unsafe {ffi::gst_is_initialized()}, ::glib_ffi::GTRUE)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! skip_assert_initialized {
|
|
|
|
() => (
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2017-07-10 21:33:24 +00:00
|
|
|
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
mod auto;
|
2017-07-03 15:08:43 +00:00
|
|
|
pub use auto::*;
|
2017-07-05 08:09:49 +00:00
|
|
|
pub use auto::traits::*;
|
2017-07-03 14:57:57 +00:00
|
|
|
pub use auto::functions::{parse_launch, parse_bin_from_description};
|
2017-07-13 07:36:38 +00:00
|
|
|
pub use auto::traits::ObjectExt as GstObjectExt;
|
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;
|
2017-07-24 22:17:50 +00:00
|
|
|
pub use message::{Message, MessageRef, MessageView};
|
2017-07-07 13:04:54 +00:00
|
|
|
pub mod structure;
|
2017-07-24 22:17:50 +00:00
|
|
|
pub use structure::{Structure, StructureRef};
|
2017-07-10 21:02:08 +00:00
|
|
|
pub mod caps;
|
2017-07-24 22:17:50 +00:00
|
|
|
pub use caps::{Caps, CapsRef};
|
2017-07-12 07:27:43 +00:00
|
|
|
pub mod tags;
|
|
|
|
pub use tags::*;
|
2017-07-25 12:01:24 +00:00
|
|
|
pub mod buffer;
|
|
|
|
pub use buffer::{Buffer, BufferRef, ReadBufferMap, ReadWriteBufferMap, ReadMappedBuffer, ReadWriteMappedBuffer};
|
2017-07-28 17:04:15 +00:00
|
|
|
pub mod sample;
|
|
|
|
pub use sample::{Sample, SampleRef};
|
2017-07-28 17:20:11 +00:00
|
|
|
pub mod bufferlist;
|
|
|
|
pub use bufferlist::{BufferList, BufferListRef};
|
2017-07-03 10:56:26 +00:00
|
|
|
|
2017-07-05 08:09:49 +00:00
|
|
|
mod element;
|
|
|
|
mod bin;
|
2017-07-11 16:29:16 +00:00
|
|
|
mod bus;
|
2017-07-24 08:51:14 +00:00
|
|
|
mod pad;
|
2017-07-20 08:39:44 +00:00
|
|
|
mod gobject;
|
2017-07-28 16:47:23 +00:00
|
|
|
mod segment;
|
2017-07-05 08:09:49 +00:00
|
|
|
pub use bin::BinExtManual;
|
2017-07-24 22:17:50 +00:00
|
|
|
pub use pad::{PadExtManual, PadProbeId, PadProbeInfo, PadProbeData, PAD_PROBE_ID_INVALID};
|
2017-07-20 08:39:44 +00:00
|
|
|
pub use gobject::GObjectExtManualGst;
|
2017-07-05 08:09:49 +00:00
|
|
|
|
2017-07-12 10:25:11 +00:00
|
|
|
mod value;
|
|
|
|
pub use value::*;
|
|
|
|
|
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();
|
2017-07-10 21:33:24 +00:00
|
|
|
if from_glib(ffi::gst_init_check(
|
|
|
|
ptr::null_mut(),
|
|
|
|
ptr::null_mut(),
|
|
|
|
&mut error,
|
|
|
|
)) {
|
2017-07-03 09:26:40 +00:00
|
|
|
Ok(())
|
|
|
|
} else {
|
|
|
|
Err(from_glib_full(error))
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
2017-07-25 12:31:45 +00:00
|
|
|
|
|
|
|
pub const BUFFER_OFFSET_NONE: u64 = ffi::GST_BUFFER_OFFSET_NONE;
|
|
|
|
pub const CLOCK_TIME_NONE: u64 = ffi::GST_CLOCK_TIME_NONE;
|