lib.rs 2.72 KB
Newer Older
1 2 3 4 5 6 7 8
// 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.

Sebastian Dröge's avatar
Sebastian Dröge committed
9 10
extern crate glib_sys;
extern crate gobject_sys;
11
#[macro_use]
12
extern crate gstreamer as gst;
Sebastian Dröge's avatar
Sebastian Dröge committed
13 14
extern crate gstreamer_base_sys as gst_base_sys;
extern crate gstreamer_sys as gst_sys;
15

Sebastian Dröge's avatar
Sebastian Dröge committed
16
extern crate libc;
17 18
#[macro_use]
extern crate bitflags;
Sebastian Dröge's avatar
Sebastian Dröge committed
19

20 21 22 23
#[macro_use]
extern crate glib;

macro_rules! assert_initialized_main_thread {
24
    () => {
Sebastian Dröge's avatar
Sebastian Dröge committed
25
        if unsafe { ::gst_sys::gst_is_initialized() } != ::glib_sys::GTRUE {
26 27
            panic!("GStreamer has not been initialized. Call `gst::init` first.");
        }
28
    };
29 30
}

31 32 33 34
macro_rules! skip_assert_initialized {
    () => {};
}

35 36 37 38
#[allow(clippy::unreadable_literal)]
#[allow(clippy::too_many_arguments)]
#[allow(clippy::match_same_arms)]
#[allow(clippy::type_complexity)]
39
mod auto;
40
pub use auto::functions::*;
41
pub use auto::*;
42 43 44

pub mod functions;
pub use functions::*;
45 46

mod adapter;
47
pub use adapter::*;
48 49
mod flow_combiner;
pub use flow_combiner::*;
50
#[cfg(any(feature = "v1_14", feature = "dox"))]
51
mod aggregator;
52
#[cfg(any(feature = "v1_14", feature = "dox"))]
53 54
pub use aggregator::AggregatorExtManual;
#[cfg(any(feature = "v1_14", feature = "dox"))]
55
mod aggregator_pad;
56 57
#[cfg(any(feature = "v1_14", feature = "dox"))]
pub use aggregator_pad::AggregatorPadExtManual;
58
mod base_parse;
59
pub use base_parse::BaseParseExtManual;
60
mod base_sink;
61
pub use base_sink::BaseSinkExtManual;
62
mod base_src;
63
pub use base_src::BaseSrcExtManual;
64
mod base_transform;
65
pub use base_transform::BaseTransformExtManual;
66

67 68 69
pub mod base_parse_frame;
pub use base_parse_frame::BaseParseFrame;

70 71 72 73
pub const BASE_TRANSFORM_FLOW_DROPPED: gst::FlowSuccess = gst::FlowSuccess::CustomSuccess;
pub const BASE_PARSE_FLOW_DROPPED: gst::FlowSuccess = gst::FlowSuccess::CustomSuccess;
pub const AGGREGATOR_FLOW_NEED_DATA: gst::FlowError = gst::FlowError::CustomError;

74 75 76 77 78 79
// Re-export all the traits in a prelude module, so that applications
// can always "use gst::prelude::*" without getting conflicts
pub mod prelude {
    pub use glib::prelude::*;
    pub use gst::prelude::*;

80
    #[cfg(any(feature = "v1_14", feature = "dox"))]
81
    pub use aggregator::AggregatorExtManual;
82 83
    #[cfg(any(feature = "v1_14", feature = "dox"))]
    pub use aggregator_pad::AggregatorPadExtManual;
84
    pub use auto::traits::*;
85
    pub use base_parse::BaseParseExtManual;
86
    pub use base_sink::BaseSinkExtManual;
87
    pub use base_src::BaseSrcExtManual;
88
    pub use base_transform::BaseTransformExtManual;
89
}
90 91

mod utils;
Sebastian Dröge's avatar
Sebastian Dröge committed
92 93

pub mod subclass;