diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2020-11-22 14:16:10 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2020-11-22 20:34:25 +0300 |
commit | 684f52b7d4b262079d819bf61ddc287ae325151c (patch) | |
tree | 2d45650c14597a9e9ac735120519ee014d36153a /audio/lewton | |
parent | 5f11c0d603bef970f6c206b6612aa3dc70f471d4 (diff) |
audio: Update to 2018 edition
Diffstat (limited to 'audio/lewton')
-rw-r--r-- | audio/lewton/Cargo.toml | 10 | ||||
-rw-r--r-- | audio/lewton/src/lewtondec/imp.rs | 13 | ||||
-rw-r--r-- | audio/lewton/src/lewtondec/mod.rs | 2 | ||||
-rw-r--r-- | audio/lewton/src/lib.rs | 11 | ||||
-rw-r--r-- | audio/lewton/tests/lewtondec.rs | 6 |
5 files changed, 16 insertions, 26 deletions
diff --git a/audio/lewton/Cargo.toml b/audio/lewton/Cargo.toml index 444c9e7d..59022f62 100644 --- a/audio/lewton/Cargo.toml +++ b/audio/lewton/Cargo.toml @@ -9,13 +9,15 @@ edition = "2018" [dependencies] glib = { git = "https://github.com/gtk-rs/gtk-rs" } -gstreamer = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } -gstreamer-audio = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } -gstreamer-check = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } +gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } +gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } lewton = { version = "0.10", default-features = false } byte-slice-cast = "1.0" atomic_refcell = "0.1" -lazy_static = "1.0" +once_cell = "1.0" + +[dev-dependencies] +gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } [lib] name = "gstlewton" diff --git a/audio/lewton/src/lewtondec/imp.rs b/audio/lewton/src/lewtondec/imp.rs index 6108f1f6..5d6d5d9a 100644 --- a/audio/lewton/src/lewtondec/imp.rs +++ b/audio/lewton/src/lewtondec/imp.rs @@ -9,6 +9,8 @@ use glib::subclass; use glib::subclass::prelude::*; use gst::subclass::prelude::*; +use gst::{gst_debug, gst_element_error, gst_error, gst_warning}; +use gst_audio::gst_audio_decoder_error; use gst_audio::prelude::*; use gst_audio::subclass::prelude::*; @@ -32,13 +34,14 @@ pub struct LewtonDec { state: AtomicRefCell<Option<State>>, } -lazy_static! { - static ref CAT: gst::DebugCategory = gst::DebugCategory::new( +use once_cell::sync::Lazy; +static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { + gst::DebugCategory::new( "lewtondec", gst::DebugColorFlags::empty(), Some("lewton Vorbis decoder"), - ); -} + ) +}); impl ObjectSubclass for LewtonDec { const NAME: &'static str = "LewtonDec"; @@ -47,7 +50,7 @@ impl ObjectSubclass for LewtonDec { type Instance = gst::subclass::ElementInstanceStruct<Self>; type Class = subclass::simple::ClassStruct<Self>; - glib_object_subclass!(); + glib::glib_object_subclass!(); fn new() -> Self { Self { diff --git a/audio/lewton/src/lewtondec/mod.rs b/audio/lewton/src/lewtondec/mod.rs index b98d8098..7db96f51 100644 --- a/audio/lewton/src/lewtondec/mod.rs +++ b/audio/lewton/src/lewtondec/mod.rs @@ -10,7 +10,7 @@ use glib::prelude::*; mod imp; -glib_wrapper! { +glib::glib_wrapper! { pub struct LewtonDec(ObjectSubclass<imp::LewtonDec>) @extends gst_audio::AudioDecoder, gst::Element, gst::Object; } diff --git a/audio/lewton/src/lib.rs b/audio/lewton/src/lib.rs index 88a85cfe..5b4166a5 100644 --- a/audio/lewton/src/lib.rs +++ b/audio/lewton/src/lib.rs @@ -6,22 +6,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[macro_use] -extern crate glib; -#[macro_use] -extern crate gstreamer as gst; -#[macro_use] -extern crate gstreamer_audio as gst_audio; -#[macro_use] -extern crate lazy_static; - mod lewtondec; fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { lewtondec::register(plugin) } -gst_plugin_define!( +gst::gst_plugin_define!( lewton, env!("CARGO_PKG_DESCRIPTION"), plugin_init, diff --git a/audio/lewton/tests/lewtondec.rs b/audio/lewton/tests/lewtondec.rs index bc8667e4..59118f03 100644 --- a/audio/lewton/tests/lewtondec.rs +++ b/audio/lewton/tests/lewtondec.rs @@ -6,13 +6,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate glib; -extern crate gstreamer as gst; use gst::prelude::*; -extern crate gstreamer_audio as gst_audio; -extern crate gstreamer_check as gst_check; - -extern crate gstlewton; fn init() { use std::sync::Once; |