2017-08-10 21:41:55 +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.
|
|
|
|
|
|
|
|
#[macro_use]
|
|
|
|
extern crate bitflags;
|
|
|
|
extern crate libc;
|
2020-01-22 17:38:13 +00:00
|
|
|
extern crate once_cell;
|
2017-08-10 21:41:55 +00:00
|
|
|
|
2017-09-10 11:55:29 +00:00
|
|
|
#[macro_use]
|
|
|
|
extern crate glib;
|
2019-03-19 07:58:20 +00:00
|
|
|
extern crate glib_sys;
|
|
|
|
extern crate gobject_sys;
|
2018-09-28 14:36:50 +00:00
|
|
|
#[macro_use]
|
2017-09-10 11:55:29 +00:00
|
|
|
extern crate gstreamer as gst;
|
2020-02-09 16:53:36 +00:00
|
|
|
extern crate futures_channel;
|
|
|
|
extern crate futures_util;
|
2017-12-30 13:30:07 +00:00
|
|
|
extern crate gstreamer_base as gst_base;
|
2019-05-11 12:58:39 +00:00
|
|
|
extern crate gstreamer_base_sys as gst_base_sys;
|
2019-03-19 07:58:20 +00:00
|
|
|
extern crate gstreamer_sys as gst_sys;
|
|
|
|
extern crate gstreamer_video_sys as gst_video_sys;
|
2017-08-10 21:41:55 +00:00
|
|
|
|
2020-06-05 10:22:08 +00:00
|
|
|
#[cfg(test)]
|
|
|
|
extern crate itertools;
|
|
|
|
|
2017-08-30 09:48:01 +00:00
|
|
|
macro_rules! assert_initialized_main_thread {
|
2018-04-01 08:30:03 +00:00
|
|
|
() => {
|
2019-03-19 07:58:20 +00:00
|
|
|
if unsafe { ::gst_sys::gst_is_initialized() } != ::glib_sys::GTRUE {
|
2017-08-30 09:48:01 +00:00
|
|
|
panic!("GStreamer has not been initialized. Call `gst::init` first.");
|
|
|
|
}
|
2018-04-01 08:30:03 +00:00
|
|
|
};
|
2017-08-30 09:48:01 +00:00
|
|
|
}
|
|
|
|
|
2017-08-10 21:41:55 +00:00
|
|
|
macro_rules! skip_assert_initialized {
|
2018-04-01 08:30:03 +00:00
|
|
|
() => {};
|
2017-08-10 21:41:55 +00:00
|
|
|
}
|
|
|
|
|
2019-02-28 08:32:13 +00:00
|
|
|
#[allow(clippy::unreadable_literal)]
|
|
|
|
#[allow(clippy::too_many_arguments)]
|
|
|
|
#[allow(clippy::match_same_arms)]
|
2017-08-10 21:41:55 +00:00
|
|
|
mod auto;
|
|
|
|
pub use auto::*;
|
|
|
|
|
2020-05-22 19:27:56 +00:00
|
|
|
mod caps_features;
|
2020-07-03 09:23:52 +00:00
|
|
|
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
|
|
|
pub use caps_features::{CAPS_FEATURES_FORMAT_INTERLACED, CAPS_FEATURE_FORMAT_INTERLACED};
|
2020-05-22 19:27:56 +00:00
|
|
|
pub use caps_features::{
|
2020-07-03 09:23:52 +00:00
|
|
|
CAPS_FEATURES_META_GST_VIDEO_AFFINE_TRANSFORMATION_META,
|
2020-05-22 19:27:56 +00:00
|
|
|
CAPS_FEATURES_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META, CAPS_FEATURES_META_GST_VIDEO_META,
|
2020-07-03 09:23:52 +00:00
|
|
|
CAPS_FEATURES_META_GST_VIDEO_OVERLAY_COMPOSITION,
|
2020-05-22 19:27:56 +00:00
|
|
|
CAPS_FEATURE_META_GST_VIDEO_AFFINE_TRANSFORMATION_META,
|
|
|
|
CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META, CAPS_FEATURE_META_GST_VIDEO_META,
|
|
|
|
CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION,
|
|
|
|
};
|
2017-08-10 21:41:55 +00:00
|
|
|
mod video_format;
|
|
|
|
pub use video_format::*;
|
|
|
|
mod video_format_info;
|
|
|
|
pub use video_format_info::*;
|
2017-08-11 09:29:23 +00:00
|
|
|
mod video_info;
|
|
|
|
pub use video_info::*;
|
2018-01-01 11:26:31 +00:00
|
|
|
pub mod video_frame;
|
2019-07-16 08:30:57 +00:00
|
|
|
pub use video_frame::{VideoBufferExt, VideoFrame, VideoFrameRef};
|
2017-08-11 12:03:16 +00:00
|
|
|
mod video_overlay;
|
2019-10-29 17:40:32 +00:00
|
|
|
pub use video_overlay::{is_video_overlay_prepare_window_handle_message, VideoOverlayExtManual};
|
2020-06-25 16:22:25 +00:00
|
|
|
pub mod video_event;
|
|
|
|
pub use video_event::{
|
|
|
|
DownstreamForceKeyUnitEvent, ForceKeyUnitEvent, StillFrameEvent, UpstreamForceKeyUnitEvent,
|
|
|
|
};
|
2017-12-24 12:30:38 +00:00
|
|
|
mod functions;
|
|
|
|
pub use functions::*;
|
2017-12-26 16:55:53 +00:00
|
|
|
mod video_rectangle;
|
|
|
|
pub use video_rectangle::*;
|
2018-09-28 14:36:50 +00:00
|
|
|
mod video_overlay_composition;
|
|
|
|
pub use video_overlay_composition::*;
|
2020-06-02 08:18:42 +00:00
|
|
|
pub mod video_meta;
|
|
|
|
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
|
|
|
pub use video_meta::VideoCaptionMeta;
|
|
|
|
#[cfg(any(feature = "v1_18", feature = "dox"))]
|
|
|
|
pub use video_meta::{VideoAFDMeta, VideoBarMeta};
|
|
|
|
pub use video_meta::{
|
|
|
|
VideoAffineTransformationMeta, VideoCropMeta, VideoMeta, VideoOverlayCompositionMeta,
|
|
|
|
VideoRegionOfInterestMeta,
|
|
|
|
};
|
2018-12-15 12:50:11 +00:00
|
|
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
|
|
|
mod video_time_code;
|
|
|
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
2018-12-15 12:36:51 +00:00
|
|
|
pub use video_time_code::{ValidVideoTimeCode, VideoTimeCode, VideoTimeCodeMeta};
|
2018-12-15 12:50:11 +00:00
|
|
|
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
|
|
|
mod video_time_code_interval;
|
|
|
|
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
|
|
|
pub use video_time_code_interval::VideoTimeCodeInterval;
|
2019-05-23 13:07:02 +00:00
|
|
|
mod video_buffer_pool;
|
|
|
|
pub use video_buffer_pool::{
|
2019-10-17 10:04:29 +00:00
|
|
|
VideoAlignment, VideoBufferPoolConfig, BUFFER_POOL_OPTION_VIDEO_AFFINE_TRANSFORMATION_META,
|
2019-05-12 15:17:33 +00:00
|
|
|
BUFFER_POOL_OPTION_VIDEO_ALIGNMENT, BUFFER_POOL_OPTION_VIDEO_GL_TEXTURE_UPLOAD_META,
|
|
|
|
BUFFER_POOL_OPTION_VIDEO_META,
|
2019-05-23 13:07:02 +00:00
|
|
|
};
|
2020-01-30 21:15:08 +00:00
|
|
|
pub mod video_converter;
|
|
|
|
pub use video_converter::{VideoConverter, VideoConverterConfig};
|
2017-08-17 14:58:15 +00:00
|
|
|
|
2019-05-11 12:58:39 +00:00
|
|
|
mod video_codec_frame;
|
|
|
|
mod video_decoder;
|
2019-10-17 10:04:29 +00:00
|
|
|
pub use video_decoder::VideoDecoderExtManual;
|
2019-05-25 08:11:06 +00:00
|
|
|
mod video_encoder;
|
2019-05-11 12:58:39 +00:00
|
|
|
pub use video_codec_frame::VideoCodecFrame;
|
2019-10-17 10:04:29 +00:00
|
|
|
pub use video_encoder::VideoEncoderExtManual;
|
2019-05-11 12:58:39 +00:00
|
|
|
pub mod video_codec_state;
|
2019-10-17 10:04:29 +00:00
|
|
|
pub use video_codec_state::{VideoCodecState, VideoCodecStateContext};
|
2019-05-11 12:58:39 +00:00
|
|
|
mod utils;
|
|
|
|
|
2019-08-14 17:22:55 +00:00
|
|
|
pub const VIDEO_ENCODER_FLOW_NEED_DATA: gst::FlowSuccess = gst::FlowSuccess::CustomSuccess;
|
|
|
|
pub const VIDEO_DECODER_FLOW_NEED_DATA: gst::FlowSuccess = gst::FlowSuccess::CustomSuccess;
|
|
|
|
|
2017-08-17 14:58:15 +00:00
|
|
|
// 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::*;
|
|
|
|
|
|
|
|
pub use auto::traits::*;
|
2019-05-12 15:17:33 +00:00
|
|
|
pub use video_buffer_pool::VideoBufferPoolConfig;
|
2019-05-11 12:58:39 +00:00
|
|
|
pub use video_decoder::VideoDecoderExtManual;
|
2019-05-25 08:11:06 +00:00
|
|
|
pub use video_encoder::VideoEncoderExtManual;
|
2020-06-03 19:33:17 +00:00
|
|
|
pub use video_format::VideoFormatIteratorExt;
|
2019-07-16 08:30:57 +00:00
|
|
|
pub use video_frame::VideoBufferExt;
|
2017-08-17 14:58:15 +00:00
|
|
|
pub use video_overlay::VideoOverlayExtManual;
|
|
|
|
}
|
2019-05-11 12:58:39 +00:00
|
|
|
|
|
|
|
pub mod subclass;
|