diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2020-04-24 14:33:21 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2020-04-24 14:37:43 +0300 |
commit | 2019cdb8cb797f3b86c730064748b203654055ad (patch) | |
tree | cfb2a2941a4b71d33c0536d487297053d1273753 /utils | |
parent | a63991e325f68f970bf4d0fe939fe6792b01fcc0 (diff) |
fallbackswitch: Clean up 1.18 aggregator compat code
Diffstat (limited to 'utils')
-rw-r--r-- | utils/fallbackswitch/Cargo.toml | 24 | ||||
-rw-r--r-- | utils/fallbackswitch/examples/gtk_fallbackswitch.rs | 8 | ||||
-rw-r--r-- | utils/fallbackswitch/src/base/sys.rs | 2 | ||||
-rw-r--r-- | utils/fallbackswitch/src/fallbacksrc.rs | 3 | ||||
-rw-r--r-- | utils/fallbackswitch/src/fallbackswitch.rs | 16 | ||||
-rw-r--r-- | utils/fallbackswitch/src/lib.rs | 25 | ||||
-rw-r--r-- | utils/fallbackswitch/tests/fallbackswitch.rs | 7 |
7 files changed, 30 insertions, 55 deletions
diff --git a/utils/fallbackswitch/Cargo.toml b/utils/fallbackswitch/Cargo.toml index 83fb4435c..dc7810506 100644 --- a/utils/fallbackswitch/Cargo.toml +++ b/utils/fallbackswitch/Cargo.toml @@ -8,22 +8,22 @@ edition = "2018" description = "Fallback Switcher Plugin" [dependencies] -libc = "0.2" +libc = { version = "0.2", optional = true } glib = { git = "https://github.com/gtk-rs/glib" } -glib-sys = { git = "https://github.com/gtk-rs/sys" } -gobject-sys = { git = "https://github.com/gtk-rs/sys" } -gstreamer = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_14"] } -gstreamer-base = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_16"] } -gstreamer-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys" } -gstreamer-audio = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_14"] } -gstreamer-video = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_14"] } +glib-sys = { git = "https://github.com/gtk-rs/sys", optional = true } +gobject-sys = { git = "https://github.com/gtk-rs/sys", optional = true } +gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_14"] } +gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_16"] } +gst-sys = { package = "gstreamer-sys", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", optional = true } +gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_14"] } +gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_14"] } gtk = { git = "https://github.com/gtk-rs/gtk", optional = true } gio = { git = "https://github.com/gtk-rs/gio", optional = true } once_cell = "1.0" [dev-dependencies] -gstreamer-check = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_14"]} -gstreamer-app = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_14"]} +gst-app = { package = "gstreamer-app", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_14"]} +gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_14"]} [lib] name = "gstfallbackswitch" @@ -41,5 +41,5 @@ cc = "1.0" pkg-config = "0.3" [features] -default = [] -#v1_18 = ["gstreamer/v1_18", "gstreamer-base"] +default = ["glib-sys", "gobject-sys", "gst-sys", "libc"] +#v1_18 = ["gstreamer-base/v1_18"] diff --git a/utils/fallbackswitch/examples/gtk_fallbackswitch.rs b/utils/fallbackswitch/examples/gtk_fallbackswitch.rs index ffb645422..7418a4bbf 100644 --- a/utils/fallbackswitch/examples/gtk_fallbackswitch.rs +++ b/utils/fallbackswitch/examples/gtk_fallbackswitch.rs @@ -15,18 +15,12 @@ // Free Software Foundation, Inc., 51 Franklin Street, Suite 500, // Boston, MA 02110-1335, USA. -extern crate glib; -use glib::prelude::*; -extern crate gio; use gio::prelude::*; -extern crate gstreamer as gst; use gst::prelude::*; -extern crate gstfallbackswitch; - -extern crate gtk; use gtk::prelude::*; + use std::cell::RefCell; use std::env; diff --git a/utils/fallbackswitch/src/base/sys.rs b/utils/fallbackswitch/src/base/sys.rs index ac3e8ffcd..9901cc0a8 100644 --- a/utils/fallbackswitch/src/base/sys.rs +++ b/utils/fallbackswitch/src/base/sys.rs @@ -5,7 +5,7 @@ clippy::unreadable_literal )] -extern crate gstreamer_sys as gst; +use gst_sys as gst; #[allow(unused_imports)] use libc::{ diff --git a/utils/fallbackswitch/src/fallbacksrc.rs b/utils/fallbackswitch/src/fallbacksrc.rs index 7217b3b42..ade237c73 100644 --- a/utils/fallbackswitch/src/fallbacksrc.rs +++ b/utils/fallbackswitch/src/fallbacksrc.rs @@ -15,14 +15,11 @@ // Free Software Foundation, Inc., 51 Franklin Street, Suite 500, // Boston, MA 02110-1335, USA. -use glib; use glib::prelude::*; use glib::subclass; use glib::subclass::prelude::*; -use gst; use gst::prelude::*; use gst::subclass::prelude::*; -use gstreamer_base as gst_base; use std::mem; use std::sync::Mutex; diff --git a/utils/fallbackswitch/src/fallbackswitch.rs b/utils/fallbackswitch/src/fallbackswitch.rs index f38f7bc1b..8934d6b81 100644 --- a/utils/fallbackswitch/src/fallbackswitch.rs +++ b/utils/fallbackswitch/src/fallbackswitch.rs @@ -16,14 +16,20 @@ // Boston, MA 02110-1335, USA. #[cfg(not(feature = "v1_18"))] -use super::base as gst_base; -use glib::prelude::*; +use self::gst_base::prelude::*; +#[cfg(not(feature = "v1_18"))] +use self::gst_base::subclass::prelude::*; +#[cfg(not(feature = "v1_18"))] +use super::gst_base_compat as gst_base; + +#[cfg(feature = "v1_18")] +use gst_base::prelude::*; +#[cfg(feature = "v1_18")] +use gst_base::subclass::prelude::*; + use glib::subclass; use glib::subclass::prelude::*; -use gst::prelude::*; use gst::subclass::prelude::*; -use gst_base::prelude::*; -use gst_base::subclass::prelude::*; use once_cell::sync::Lazy; diff --git a/utils/fallbackswitch/src/lib.rs b/utils/fallbackswitch/src/lib.rs index 21df3ebbe..370e91859 100644 --- a/utils/fallbackswitch/src/lib.rs +++ b/utils/fallbackswitch/src/lib.rs @@ -18,35 +18,18 @@ #[macro_use] extern crate glib; #[macro_use] -extern crate gstreamer as gst; +extern crate gst; -extern crate gstreamer_audio as gst_audio; -extern crate gstreamer_video as gst_video; - -#[cfg(not(feature = "v1_18"))] -extern crate glib_sys; -#[cfg(not(feature = "v1_18"))] -extern crate gobject_sys; -#[cfg(feature = "v1_18")] -extern crate gstreamer_base as gst_base; -#[cfg(not(feature = "v1_18"))] -extern crate gstreamer_sys as gst_sys; -#[cfg(not(feature = "v1_18"))] -#[allow(dead_code)] -mod base; #[cfg(not(feature = "v1_18"))] -mod gst_base { - pub use super::base::*; -} - -extern crate once_cell; +#[path = "base/mod.rs"] +pub mod gst_base_compat; mod fallbacksrc; mod fallbackswitch; fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - fallbackswitch::register(plugin)?; fallbacksrc::register(plugin)?; + fallbackswitch::register(plugin)?; Ok(()) } diff --git a/utils/fallbackswitch/tests/fallbackswitch.rs b/utils/fallbackswitch/tests/fallbackswitch.rs index e4726b919..7f6c96290 100644 --- a/utils/fallbackswitch/tests/fallbackswitch.rs +++ b/utils/fallbackswitch/tests/fallbackswitch.rs @@ -15,16 +15,11 @@ // Free Software Foundation, Inc., 51 Franklin Street, Suite 500, // Boston, MA 02110-1335, USA. -extern crate glib; use glib::prelude::*; #[macro_use] -extern crate gstreamer as gst; +extern crate gst; use gst::prelude::*; -extern crate gstreamer_app as gst_app; -extern crate gstreamer_check as gst_check; - -extern crate gstfallbackswitch; use once_cell::sync::Lazy; |