From 68839c0e79b8af507b2189a0835284b51625190c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 20 Dec 2020 19:39:15 +0200 Subject: [PATCH] Re-export all dependency crates and their preludes This makes code in examples potentially simpler. --- gstreamer-app/src/lib.rs | 7 +++++++ gstreamer-audio/src/lib.rs | 7 +++++++ gstreamer-audio/src/subclass/mod.rs | 7 +++++++ gstreamer-base/src/lib.rs | 4 ++++ gstreamer-base/src/subclass/mod.rs | 5 +++++ gstreamer-check/src/lib.rs | 4 ++++ gstreamer-controller/src/lib.rs | 7 +++++++ gstreamer-editing-services/src/lib.rs | 16 +++++++++++++++- gstreamer-gl/src/lib.rs | 9 +++++++++ gstreamer-net/src/lib.rs | 6 ++++++ gstreamer-pbutils/src/lib.rs | 4 ++++ gstreamer-player/src/lib.rs | 6 ++++++ gstreamer-rtp/src/lib.rs | 4 ++++ gstreamer-rtsp-server/src/lib.rs | 16 ++++++++++++++++ gstreamer-rtsp-server/src/subclass/mod.rs | 5 +++++ gstreamer-rtsp/src/lib.rs | 7 +++++++ gstreamer-sdp/src/lib.rs | 4 ++++ gstreamer-video/src/lib.rs | 7 +++++++ gstreamer-video/src/subclass/mod.rs | 7 +++++++ gstreamer-webrtc/src/lib.rs | 7 +++++++ gstreamer/src/lib.rs | 3 +-- gstreamer/src/subclass/mod.rs | 4 +++- 22 files changed, 142 insertions(+), 4 deletions(-) diff --git a/gstreamer-app/src/lib.rs b/gstreamer-app/src/lib.rs index 04d73cc5d..a7d3ad833 100644 --- a/gstreamer-app/src/lib.rs +++ b/gstreamer-app/src/lib.rs @@ -3,6 +3,9 @@ #![cfg_attr(feature = "dox", feature(doc_cfg))] pub use ffi; +pub use glib; +pub use gst; +pub use gst_base; macro_rules! skip_assert_initialized { () => {}; @@ -23,8 +26,12 @@ pub use crate::app_src::AppSrcCallbacks; // Re-export all the traits in a prelude module, so that applications // can always "use gst::prelude::*" without getting conflicts pub mod prelude { + #[doc(hidden)] pub use glib::prelude::*; + #[doc(hidden)] pub use gst::prelude::*; + #[doc(hidden)] + pub use gst_base::prelude::*; pub use crate::auto::traits::*; } diff --git a/gstreamer-audio/src/lib.rs b/gstreamer-audio/src/lib.rs index 6dfdd9f8f..df1d096e2 100644 --- a/gstreamer-audio/src/lib.rs +++ b/gstreamer-audio/src/lib.rs @@ -3,6 +3,9 @@ #![cfg_attr(feature = "dox", feature(doc_cfg))] pub use ffi; +pub use glib; +pub use gst; +pub use gst_base; macro_rules! assert_initialized_main_thread { () => { @@ -55,8 +58,12 @@ pub use crate::audio_encoder::AudioEncoderExtManual; // Re-export all the traits in a prelude module, so that applications // can always "use gst::prelude::*" without getting conflicts pub mod prelude { + #[doc(hidden)] pub use glib::prelude::*; + #[doc(hidden)] pub use gst::prelude::*; + #[doc(hidden)] + pub use gst_base::prelude::*; pub use super::audio_decoder::AudioDecoderExtManual; pub use super::audio_encoder::AudioEncoderExtManual; diff --git a/gstreamer-audio/src/subclass/mod.rs b/gstreamer-audio/src/subclass/mod.rs index 0a356e7d2..92ab27bfd 100644 --- a/gstreamer-audio/src/subclass/mod.rs +++ b/gstreamer-audio/src/subclass/mod.rs @@ -8,6 +8,13 @@ mod audio_sink; mod audio_src; pub mod prelude { + #[doc(hidden)] + pub use glib::subclass::prelude::*; + #[doc(hidden)] + pub use gst::subclass::prelude::*; + #[doc(hidden)] + pub use gst_base::subclass::prelude::*; + pub use super::audio_decoder::{AudioDecoderImpl, AudioDecoderImplExt}; pub use super::audio_encoder::{AudioEncoderImpl, AudioEncoderImplExt}; pub use super::audio_sink::{AudioSinkImpl, AudioSinkImplExt}; diff --git a/gstreamer-base/src/lib.rs b/gstreamer-base/src/lib.rs index d5263e3ec..33cf3176b 100644 --- a/gstreamer-base/src/lib.rs +++ b/gstreamer-base/src/lib.rs @@ -3,6 +3,8 @@ #![cfg_attr(feature = "dox", feature(doc_cfg))] pub use ffi; +pub use glib; +pub use gst; macro_rules! assert_initialized_main_thread { () => { @@ -63,7 +65,9 @@ pub const AGGREGATOR_FLOW_NEED_DATA: gst::FlowError = gst::FlowError::CustomErro // Re-export all the traits in a prelude module, so that applications // can always "use gst::prelude::*" without getting conflicts pub mod prelude { + #[doc(hidden)] pub use glib::prelude::*; + #[doc(hidden)] pub use gst::prelude::*; #[cfg(any(feature = "v1_14", feature = "dox"))] diff --git a/gstreamer-base/src/subclass/mod.rs b/gstreamer-base/src/subclass/mod.rs index 3cedbb302..636710cd3 100644 --- a/gstreamer-base/src/subclass/mod.rs +++ b/gstreamer-base/src/subclass/mod.rs @@ -20,6 +20,11 @@ mod aggregator; mod aggregator_pad; pub mod prelude { + #[doc(hidden)] + pub use glib::subclass::prelude::*; + #[doc(hidden)] + pub use gst::subclass::prelude::*; + #[cfg(any(feature = "v1_14", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] pub use super::aggregator::{AggregatorImpl, AggregatorImplExt}; diff --git a/gstreamer-check/src/lib.rs b/gstreamer-check/src/lib.rs index c4dcf693f..2d80aa9b1 100644 --- a/gstreamer-check/src/lib.rs +++ b/gstreamer-check/src/lib.rs @@ -3,6 +3,8 @@ #![cfg_attr(feature = "dox", feature(doc_cfg))] pub use ffi; +pub use glib; +pub use gst; macro_rules! assert_initialized_main_thread { () => { @@ -27,7 +29,9 @@ pub use crate::harness::Harness; // Re-export all the traits in a prelude module, so that applications // can always "use gst::prelude::*" without getting conflicts pub mod prelude { + #[doc(hidden)] pub use glib::prelude::*; + #[doc(hidden)] pub use gst::prelude::*; pub use crate::auto::traits::*; diff --git a/gstreamer-controller/src/lib.rs b/gstreamer-controller/src/lib.rs index 333ceed38..8877bb614 100644 --- a/gstreamer-controller/src/lib.rs +++ b/gstreamer-controller/src/lib.rs @@ -3,6 +3,8 @@ #![cfg_attr(feature = "dox", feature(doc_cfg))] pub use ffi; +pub use glib; +pub use gst; macro_rules! assert_initialized_main_thread { () => { @@ -25,5 +27,10 @@ pub use crate::auto::*; use crate::control_point::*; pub mod prelude { + #[doc(hidden)] + pub use glib::prelude::*; + #[doc(hidden)] + pub use gst::prelude::*; + pub use crate::auto::traits::*; } diff --git a/gstreamer-editing-services/src/lib.rs b/gstreamer-editing-services/src/lib.rs index 7bcd0643f..f23e56c96 100644 --- a/gstreamer-editing-services/src/lib.rs +++ b/gstreamer-editing-services/src/lib.rs @@ -3,6 +3,11 @@ #![cfg_attr(feature = "dox", feature(doc_cfg))] pub use ffi; +pub use gio; +pub use glib; +pub use gst; +pub use gst_base; +pub use gst_pbutils; use std::sync::Once; @@ -56,9 +61,18 @@ pub use crate::timeline_element::TimelineElementExtManual; // 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 crate::timeline_element::TimelineElementExtManual; + #[doc(hidden)] + pub use gio::prelude::*; + #[doc(hidden)] pub use glib::prelude::*; + #[doc(hidden)] pub use gst::prelude::*; + #[doc(hidden)] + pub use gst_base::prelude::*; + #[doc(hidden)] + pub use gst_pbutils::prelude::*; + + pub use crate::timeline_element::TimelineElementExtManual; pub use crate::auto::traits::*; } diff --git a/gstreamer-gl/src/lib.rs b/gstreamer-gl/src/lib.rs index 660680be8..4ce1f86d3 100644 --- a/gstreamer-gl/src/lib.rs +++ b/gstreamer-gl/src/lib.rs @@ -3,6 +3,9 @@ #![cfg_attr(feature = "dox", feature(doc_cfg))] pub use ffi; +pub use gst; +pub use gst_base; +pub use gst_video; macro_rules! assert_initialized_main_thread { () => { @@ -38,8 +41,14 @@ pub use crate::gl_sync_meta::*; // Re-export all the traits in a prelude module, so that applications // can always "use gst::prelude::*" without getting conflicts pub mod prelude { + #[doc(hidden)] pub use glib::prelude::*; + #[doc(hidden)] pub use gst::prelude::*; + #[doc(hidden)] + pub use gst_base::prelude::*; + #[doc(hidden)] + pub use gst_video::prelude::*; pub use crate::auto::traits::*; diff --git a/gstreamer-net/src/lib.rs b/gstreamer-net/src/lib.rs index e2af3f18b..387f96763 100644 --- a/gstreamer-net/src/lib.rs +++ b/gstreamer-net/src/lib.rs @@ -3,6 +3,8 @@ #![cfg_attr(feature = "dox", feature(doc_cfg))] pub use ffi; +pub use gio; +pub use gst; macro_rules! assert_initialized_main_thread { () => { @@ -33,7 +35,11 @@ mod net_address_meta; // Re-export all the traits in a prelude module, so that applications // can always "use gst::prelude::*" without getting conflicts pub mod prelude { + #[doc(hidden)] + pub use gio::prelude::*; + #[doc(hidden)] pub use glib::prelude::*; + #[doc(hidden)] pub use gst::prelude::*; pub use crate::auto::traits::*; diff --git a/gstreamer-pbutils/src/lib.rs b/gstreamer-pbutils/src/lib.rs index 138eeb8de..b3fa6f8ab 100644 --- a/gstreamer-pbutils/src/lib.rs +++ b/gstreamer-pbutils/src/lib.rs @@ -3,6 +3,8 @@ #![cfg_attr(feature = "dox", feature(doc_cfg))] pub use ffi; +pub use glib; +pub use gst; use std::sync::Once; @@ -49,7 +51,9 @@ pub use crate::functions::*; // Re-export all the traits in a prelude module, so that applications // can always "use gst::prelude::*" without getting conflicts pub mod prelude { + #[doc(hidden)] pub use glib::prelude::*; + #[doc(hidden)] pub use gst::prelude::*; pub use crate::auto::traits::*; diff --git a/gstreamer-player/src/lib.rs b/gstreamer-player/src/lib.rs index 6f916b03a..510b693aa 100644 --- a/gstreamer-player/src/lib.rs +++ b/gstreamer-player/src/lib.rs @@ -3,6 +3,8 @@ #![cfg_attr(feature = "dox", feature(doc_cfg))] pub use ffi; +pub use gst; +pub use gst_video; macro_rules! skip_assert_initialized { () => {}; @@ -34,8 +36,12 @@ mod player_visualization; // Re-export all the traits in a prelude module, so that applications // can always "use gst::prelude::*" without getting conflicts pub mod prelude { + #[doc(hidden)] pub use glib::prelude::*; + #[doc(hidden)] pub use gst::prelude::*; + #[doc(hidden)] + pub use gst_video::prelude::*; pub use crate::auto::traits::*; } diff --git a/gstreamer-rtp/src/lib.rs b/gstreamer-rtp/src/lib.rs index 43033f90d..219ed077f 100644 --- a/gstreamer-rtp/src/lib.rs +++ b/gstreamer-rtp/src/lib.rs @@ -3,6 +3,8 @@ #![cfg_attr(feature = "dox", feature(doc_cfg))] pub use ffi; +pub use glib; +pub use gst; macro_rules! assert_initialized_main_thread { () => { @@ -29,7 +31,9 @@ pub use crate::rtp_buffer::{compare_seqnum, RTPBuffer, RTPBufferExt}; // Re-export all the traits in a prelude module, so that applications // can always "use gst::prelude::*" without getting conflicts pub mod prelude { + #[doc(hidden)] pub use glib::prelude::*; + #[doc(hidden)] pub use gst::prelude::*; pub use crate::auto::traits::*; diff --git a/gstreamer-rtsp-server/src/lib.rs b/gstreamer-rtsp-server/src/lib.rs index b4e1673db..3a90a2b4e 100644 --- a/gstreamer-rtsp-server/src/lib.rs +++ b/gstreamer-rtsp-server/src/lib.rs @@ -3,6 +3,12 @@ #![cfg_attr(feature = "dox", feature(doc_cfg))] pub use ffi; +pub use gio; +pub use glib; +pub use gst; +pub use gst_net; +pub use gst_rtsp; +pub use gst_sdp; macro_rules! assert_initialized_main_thread { () => { @@ -116,8 +122,18 @@ pub static RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS: Lazy<&'static str> = Lazy::new( // Re-export all the traits in a prelude module, so that applications // can always "use gst::prelude::*" without getting conflicts pub mod prelude { + #[doc(hidden)] + pub use gio::prelude::*; + #[doc(hidden)] pub use glib::prelude::*; + #[doc(hidden)] pub use gst::prelude::*; + #[doc(hidden)] + pub use gst_net::prelude::*; + #[doc(hidden)] + pub use gst_rtsp::prelude::*; + #[doc(hidden)] + pub use gst_sdp::prelude::*; pub use crate::auto::traits::*; diff --git a/gstreamer-rtsp-server/src/subclass/mod.rs b/gstreamer-rtsp-server/src/subclass/mod.rs index 0435c4d7b..16835f20a 100644 --- a/gstreamer-rtsp-server/src/subclass/mod.rs +++ b/gstreamer-rtsp-server/src/subclass/mod.rs @@ -10,6 +10,11 @@ mod rtsp_server; pub use self::rtsp_media::SDPInfo; pub mod prelude { + #[doc(hidden)] + pub use glib::subclass::prelude::*; + #[doc(hidden)] + pub use gst::subclass::prelude::*; + pub use super::rtsp_client::{RTSPClientImpl, RTSPClientImplExt}; pub use super::rtsp_media::{RTSPMediaImpl, RTSPMediaImplExt}; pub use super::rtsp_media_factory::{RTSPMediaFactoryImpl, RTSPMediaFactoryImplExt}; diff --git a/gstreamer-rtsp/src/lib.rs b/gstreamer-rtsp/src/lib.rs index 8dbb36a9d..4d594e887 100644 --- a/gstreamer-rtsp/src/lib.rs +++ b/gstreamer-rtsp/src/lib.rs @@ -3,6 +3,9 @@ #![cfg_attr(feature = "dox", feature(doc_cfg))] pub use ffi; +pub use glib; +pub use gst; +pub use gst_sdp; macro_rules! assert_initialized_main_thread { () => { @@ -25,8 +28,12 @@ pub use crate::auto::*; // Re-export all the traits in a prelude module, so that applications // can always "use gst::prelude::*" without getting conflicts pub mod prelude { + #[doc(hidden)] pub use glib::prelude::*; + #[doc(hidden)] pub use gst::prelude::*; + #[doc(hidden)] + pub use gst_sdp::prelude::*; pub use crate::auto::traits::*; } diff --git a/gstreamer-sdp/src/lib.rs b/gstreamer-sdp/src/lib.rs index 8938e22c9..e6c9b649b 100644 --- a/gstreamer-sdp/src/lib.rs +++ b/gstreamer-sdp/src/lib.rs @@ -3,6 +3,8 @@ #![cfg_attr(feature = "dox", feature(doc_cfg))] pub use ffi; +pub use glib; +pub use gst; macro_rules! assert_initialized_main_thread { () => { @@ -45,7 +47,9 @@ pub use crate::sdp_zone::*; // Re-export all the traits in a prelude module, so that applications // can always "use gst::prelude::*" without getting conflicts pub mod prelude { + #[doc(hidden)] pub use glib::prelude::*; + #[doc(hidden)] pub use gst::prelude::*; pub use crate::auto::traits::*; diff --git a/gstreamer-video/src/lib.rs b/gstreamer-video/src/lib.rs index 4546a852a..87a56b9d5 100644 --- a/gstreamer-video/src/lib.rs +++ b/gstreamer-video/src/lib.rs @@ -3,6 +3,9 @@ #![cfg_attr(feature = "dox", feature(doc_cfg))] pub use ffi; +pub use glib; +pub use gst; +pub use gst_base; macro_rules! assert_initialized_main_thread { () => { @@ -107,8 +110,12 @@ pub const VIDEO_DECODER_FLOW_NEED_DATA: gst::FlowSuccess = gst::FlowSuccess::Cus // Re-export all the traits in a prelude module, so that applications // can always "use gst::prelude::*" without getting conflicts pub mod prelude { + #[doc(hidden)] pub use glib::prelude::*; + #[doc(hidden)] pub use gst::prelude::*; + #[doc(hidden)] + pub use gst_base::prelude::*; pub use crate::auto::traits::*; pub use crate::video_buffer_pool::VideoBufferPoolConfig; diff --git a/gstreamer-video/src/subclass/mod.rs b/gstreamer-video/src/subclass/mod.rs index fc05b0c56..b4899ea41 100644 --- a/gstreamer-video/src/subclass/mod.rs +++ b/gstreamer-video/src/subclass/mod.rs @@ -7,6 +7,13 @@ mod video_encoder; mod video_sink; pub mod prelude { + #[doc(hidden)] + pub use glib::subclass::prelude::*; + #[doc(hidden)] + pub use gst::subclass::prelude::*; + #[doc(hidden)] + pub use gst_base::subclass::prelude::*; + pub use super::video_decoder::{VideoDecoderImpl, VideoDecoderImplExt}; pub use super::video_encoder::{VideoEncoderImpl, VideoEncoderImplExt}; pub use super::video_sink::{VideoSinkImpl, VideoSinkImplExt}; diff --git a/gstreamer-webrtc/src/lib.rs b/gstreamer-webrtc/src/lib.rs index 8417ad788..454e916f6 100644 --- a/gstreamer-webrtc/src/lib.rs +++ b/gstreamer-webrtc/src/lib.rs @@ -3,6 +3,9 @@ #![cfg_attr(feature = "dox", feature(doc_cfg))] pub use ffi; +pub use glib; +pub use gst; +pub use gst_sdp; macro_rules! assert_initialized_main_thread { () => { @@ -30,8 +33,12 @@ mod web_rtc_session_description; // Re-export all the traits in a prelude module, so that applications // can always "use gst::prelude::*" without getting conflicts pub mod prelude { + #[doc(hidden)] pub use glib::prelude::*; + #[doc(hidden)] pub use gst::prelude::*; + #[doc(hidden)] + pub use gst_sdp::prelude::*; pub use crate::auto::traits::*; } diff --git a/gstreamer/src/lib.rs b/gstreamer/src/lib.rs index bde11e7fb..6cf9db08d 100644 --- a/gstreamer/src/lib.rs +++ b/gstreamer/src/lib.rs @@ -5,9 +5,7 @@ // Re-exported for the subclass gst_plugin_define! macro pub use ffi; -#[doc(hidden)] pub use glib; -#[doc(hidden)] pub use paste; use glib::translate::{from_glib, from_glib_full}; @@ -303,6 +301,7 @@ pub const FORMAT_PERCENT_SCALE: u32 = ffi::GST_FORMAT_PERCENT_SCALE as u32; // Re-export all the traits in a prelude module, so that applications // can always "use gst::prelude::*" without getting conflicts pub mod prelude { + #[doc(hidden)] pub use glib::prelude::*; pub use crate::auto::traits::*; diff --git a/gstreamer/src/subclass/mod.rs b/gstreamer/src/subclass/mod.rs index 9f27f78d7..7c3d8729c 100644 --- a/gstreamer/src/subclass/mod.rs +++ b/gstreamer/src/subclass/mod.rs @@ -36,6 +36,9 @@ pub use self::error::FlowError; pub use self::plugin::{MAJOR_VERSION, MINOR_VERSION}; pub mod prelude { + #[doc(hidden)] + pub use glib::subclass::prelude::*; + pub use super::bin::{BinImpl, BinImplExt}; pub use super::child_proxy::ChildProxyImpl; pub use super::clock::{ClockImpl, ClockImplExt}; @@ -52,7 +55,6 @@ pub mod prelude { pub use super::tag_setter::TagSetterImpl; pub use super::uri_handler::URIHandlerImpl; pub use super::PanicPoison; - pub use glib::subclass::prelude::*; } use self::prelude::*;