diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2021-03-07 19:22:24 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2021-03-07 19:27:00 +0300 |
commit | dc0c5f7611d5896f9fcfa9e141fabe02dea16ea6 (patch) | |
tree | 74d3f6c20a64a3e5fa9c1f4fcff6efb8a1d694d4 /audio | |
parent | 5dd0a23986352fa363b002c8495951e6a3593673 (diff) |
Update for new #[glib::object_subclass] attribute macro
Diffstat (limited to 'audio')
-rw-r--r-- | audio/audiofx/src/audioecho/imp.rs | 14 | ||||
-rw-r--r-- | audio/audiofx/src/audioloudnorm/imp.rs | 6 | ||||
-rw-r--r-- | audio/audiofx/src/audiornnoise/imp.rs | 13 | ||||
-rw-r--r-- | audio/claxon/src/claxondec/imp.rs | 13 | ||||
-rw-r--r-- | audio/csound/src/filter/imp.rs | 6 | ||||
-rw-r--r-- | audio/lewton/src/lewtondec/imp.rs | 16 |
6 files changed, 12 insertions, 56 deletions
diff --git a/audio/audiofx/src/audioecho/imp.rs b/audio/audiofx/src/audioecho/imp.rs index 8abf4de7b..106316f09 100644 --- a/audio/audiofx/src/audioecho/imp.rs +++ b/audio/audiofx/src/audioecho/imp.rs @@ -6,7 +6,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use glib::subclass; use glib::subclass::prelude::*; use gst::prelude::*; use gst::subclass::prelude::*; @@ -60,6 +59,7 @@ struct State { buffer: RingBuffer, } +#[derive(Default)] pub struct AudioEcho { settings: Mutex<Settings>, state: Mutex<Option<State>>, @@ -85,22 +85,12 @@ impl AudioEcho { } } +#[glib::object_subclass] impl ObjectSubclass for AudioEcho { const NAME: &'static str = "RsAudioEcho"; type Type = super::AudioEcho; type ParentType = gst_base::BaseTransform; - type Interfaces = (); type Instance = gst::subclass::ElementInstanceStruct<Self>; - type Class = subclass::simple::ClassStruct<Self>; - - glib::object_subclass!(); - - fn new() -> Self { - Self { - settings: Mutex::new(Default::default()), - state: Mutex::new(None), - } - } } impl ObjectImpl for AudioEcho { diff --git a/audio/audiofx/src/audioloudnorm/imp.rs b/audio/audiofx/src/audioloudnorm/imp.rs index 555301641..543ec70a1 100644 --- a/audio/audiofx/src/audioloudnorm/imp.rs +++ b/audio/audiofx/src/audioloudnorm/imp.rs @@ -18,7 +18,6 @@ // License along with FFmpeg; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -use glib::subclass; use glib::subclass::prelude::*; use gst::prelude::*; use gst::subclass::prelude::*; @@ -1701,15 +1700,12 @@ impl AudioLoudNorm { } } +#[glib::object_subclass] impl ObjectSubclass for AudioLoudNorm { const NAME: &'static str = "RsAudioLoudNorm"; type Type = super::AudioLoudNorm; type ParentType = gst::Element; - type Interfaces = (); type Instance = gst::subclass::ElementInstanceStruct<Self>; - type Class = subclass::simple::ClassStruct<Self>; - - glib::object_subclass!(); fn with_class(klass: &Self::Class) -> Self { let templ = klass.get_pad_template("sink").unwrap(); diff --git a/audio/audiofx/src/audiornnoise/imp.rs b/audio/audiofx/src/audiornnoise/imp.rs index 02a23a755..8e11d3038 100644 --- a/audio/audiofx/src/audiornnoise/imp.rs +++ b/audio/audiofx/src/audiornnoise/imp.rs @@ -8,7 +8,6 @@ // except according to those terms. use byte_slice_cast::*; -use glib::subclass; use glib::subclass::prelude::*; use gst::prelude::*; use gst::subclass::prelude::*; @@ -42,6 +41,7 @@ struct State { adapter: gst_base::UniqueAdapter, } +#[derive(Default)] pub struct AudioRNNoise { state: Mutex<Option<State>>, } @@ -189,21 +189,12 @@ impl AudioRNNoise { } } +#[glib::object_subclass] impl ObjectSubclass for AudioRNNoise { const NAME: &'static str = "AudioRNNoise"; type Type = super::AudioRNNoise; type ParentType = gst_base::BaseTransform; - type Interfaces = (); type Instance = gst::subclass::ElementInstanceStruct<Self>; - type Class = subclass::simple::ClassStruct<Self>; - - glib::object_subclass!(); - - fn new() -> Self { - Self { - state: Mutex::new(None), - } - } } impl ObjectImpl for AudioRNNoise {} diff --git a/audio/claxon/src/claxondec/imp.rs b/audio/claxon/src/claxondec/imp.rs index bbec688d9..b880ca92d 100644 --- a/audio/claxon/src/claxondec/imp.rs +++ b/audio/claxon/src/claxondec/imp.rs @@ -6,7 +6,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use glib::subclass; use glib::subclass::prelude::*; use gst::subclass::prelude::*; use gst::{gst_debug, gst_error}; @@ -34,25 +33,17 @@ struct State { audio_info: Option<gst_audio::AudioInfo>, } +#[derive(Default)] pub struct ClaxonDec { state: AtomicRefCell<Option<State>>, } +#[glib::object_subclass] impl ObjectSubclass for ClaxonDec { const NAME: &'static str = "ClaxonDec"; type Type = super::ClaxonDec; type ParentType = gst_audio::AudioDecoder; - type Interfaces = (); type Instance = gst::subclass::ElementInstanceStruct<Self>; - type Class = subclass::simple::ClassStruct<Self>; - - glib::object_subclass!(); - - fn new() -> Self { - Self { - state: AtomicRefCell::new(None), - } - } } impl ObjectImpl for ClaxonDec {} diff --git a/audio/csound/src/filter/imp.rs b/audio/csound/src/filter/imp.rs index 3a5c492a3..dcc0ea570 100644 --- a/audio/csound/src/filter/imp.rs +++ b/audio/csound/src/filter/imp.rs @@ -15,7 +15,6 @@ // Free Software Foundation, Inc., 51 Franklin Street, Suite 500, // Boston, MA 02110-1335, USA. -use glib::subclass; use glib::subclass::prelude::*; use gst::prelude::*; use gst::subclass::prelude::*; @@ -314,15 +313,12 @@ impl CsoundFilter { } } +#[glib::object_subclass] impl ObjectSubclass for CsoundFilter { const NAME: &'static str = "CsoundFilter"; type Type = super::CsoundFilter; type ParentType = gst_base::BaseTransform; - type Interfaces = (); type Instance = gst::subclass::ElementInstanceStruct<Self>; - type Class = subclass::simple::ClassStruct<Self>; - - glib::object_subclass!(); fn new() -> Self { let csound = Csound::new(); diff --git a/audio/lewton/src/lewtondec/imp.rs b/audio/lewton/src/lewtondec/imp.rs index c08167752..d5a09584b 100644 --- a/audio/lewton/src/lewtondec/imp.rs +++ b/audio/lewton/src/lewtondec/imp.rs @@ -6,7 +6,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use glib::subclass; use glib::subclass::prelude::*; use gst::subclass::prelude::*; use gst::{gst_debug, gst_error, gst_warning}; @@ -18,6 +17,8 @@ use atomic_refcell::AtomicRefCell; use byte_slice_cast::*; +use once_cell::sync::Lazy; + struct State { header_bufs: ( Option<gst::Buffer>, @@ -30,11 +31,11 @@ struct State { reorder_map: Option<[usize; 8]>, } +#[derive(Default)] pub struct LewtonDec { state: AtomicRefCell<Option<State>>, } -use once_cell::sync::Lazy; static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { gst::DebugCategory::new( "lewtondec", @@ -43,21 +44,12 @@ static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { ) }); +#[glib::object_subclass] impl ObjectSubclass for LewtonDec { const NAME: &'static str = "LewtonDec"; type Type = super::LewtonDec; type ParentType = gst_audio::AudioDecoder; - type Interfaces = (); type Instance = gst::subclass::ElementInstanceStruct<Self>; - type Class = subclass::simple::ClassStruct<Self>; - - glib::object_subclass!(); - - fn new() -> Self { - Self { - state: AtomicRefCell::new(None), - } - } } impl ObjectImpl for LewtonDec {} |