diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2020-12-20 21:43:45 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2020-12-20 21:43:45 +0300 |
commit | 3d617371af1d1b779cf10d3fec40b17f29a7baf3 (patch) | |
tree | ff5ae62c07716648d8e62c4db34c6b731fbbd2fe /audio | |
parent | ea6c05e16ccf0875652e2370eef4839ae819bc34 (diff) |
Update for macro renames
Diffstat (limited to 'audio')
-rw-r--r-- | audio/audiofx/src/audioecho/imp.rs | 5 | ||||
-rw-r--r-- | audio/audiofx/src/audiornnoise/imp.rs | 10 | ||||
-rw-r--r-- | audio/audiofx/src/lib.rs | 2 | ||||
-rw-r--r-- | audio/claxon/src/claxondec/imp.rs | 9 | ||||
-rw-r--r-- | audio/claxon/src/lib.rs | 2 | ||||
-rw-r--r-- | audio/csound/src/filter/imp.rs | 28 | ||||
-rw-r--r-- | audio/csound/src/lib.rs | 4 | ||||
-rw-r--r-- | audio/lewton/src/lewtondec/imp.rs | 20 | ||||
-rw-r--r-- | audio/lewton/src/lib.rs | 2 |
9 files changed, 38 insertions, 44 deletions
diff --git a/audio/audiofx/src/audioecho/imp.rs b/audio/audiofx/src/audioecho/imp.rs index ba8496b8e..88204141e 100644 --- a/audio/audiofx/src/audioecho/imp.rs +++ b/audio/audiofx/src/audioecho/imp.rs @@ -8,7 +8,6 @@ use glib::subclass; use glib::subclass::prelude::*; -use gst::gst_loggable_error; use gst::prelude::*; use gst::subclass::prelude::*; use gst_base::subclass::prelude::*; @@ -288,14 +287,14 @@ impl BaseTransformImpl for AudioEcho { outcaps: &gst::Caps, ) -> Result<(), gst::LoggableError> { if incaps != outcaps { - return Err(gst_loggable_error!( + return Err(gst::loggable_error!( CAT, "Input and output caps are not the same" )); } let info = gst_audio::AudioInfo::from_caps(incaps) - .map_err(|_| gst_loggable_error!(CAT, "Failed to parse input caps"))?; + .map_err(|_| gst::loggable_error!(CAT, "Failed to parse input caps"))?; let max_delay = self.settings.lock().unwrap().max_delay; let size = max_delay * (info.rate() as u64) / gst::SECOND_VAL; let buffer_size = size * (info.channels() as u64); diff --git a/audio/audiofx/src/audiornnoise/imp.rs b/audio/audiofx/src/audiornnoise/imp.rs index 821eeb895..71a75f695 100644 --- a/audio/audiofx/src/audiornnoise/imp.rs +++ b/audio/audiofx/src/audiornnoise/imp.rs @@ -12,7 +12,7 @@ use glib::subclass; use glib::subclass::prelude::*; use gst::prelude::*; use gst::subclass::prelude::*; -use gst::{gst_debug, gst_element_error, gst_error, gst_loggable_error}; +use gst::{gst_debug, gst_error}; use gst_base::subclass::base_transform::BaseTransformImplExt; use gst_base::subclass::base_transform::GenerateOutputSuccess; use gst_base::subclass::prelude::*; @@ -260,11 +260,11 @@ impl BaseTransformImpl for AudioRNNoise { // Flush previous state if self.state.lock().unwrap().is_some() { self.drain(element).map_err(|e| { - gst_loggable_error!(CAT, "Error flusing previous state data {:?}", e) + gst::loggable_error!(CAT, "Error flusing previous state data {:?}", e) })?; } if incaps != outcaps { - return Err(gst_loggable_error!( + return Err(gst::loggable_error!( CAT, "Input and output caps are not the same" )); @@ -273,7 +273,7 @@ impl BaseTransformImpl for AudioRNNoise { gst_debug!(CAT, obj: element, "Set caps to {}", incaps); let in_info = gst_audio::AudioInfo::from_caps(incaps) - .map_err(|e| gst_loggable_error!(CAT, "Failed to parse input caps {:?}", e))?; + .map_err(|e| gst::loggable_error!(CAT, "Failed to parse input caps {:?}", e))?; let mut denoisers = vec![]; for _i in 0..in_info.channels() { @@ -308,7 +308,7 @@ impl BaseTransformImpl for AudioRNNoise { let mut state_guard = self.state.lock().unwrap(); let state = state_guard.as_mut().ok_or_else(|| { - gst_element_error!( + gst::element_error!( element, gst::CoreError::Negotiation, ["Can not generate an output without State"] diff --git a/audio/audiofx/src/lib.rs b/audio/audiofx/src/lib.rs index 8b65e3c45..bf89e886b 100644 --- a/audio/audiofx/src/lib.rs +++ b/audio/audiofx/src/lib.rs @@ -17,7 +17,7 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { Ok(()) } -gst::gst_plugin_define!( +gst::plugin_define!( rsaudiofx, env!("CARGO_PKG_DESCRIPTION"), plugin_init, diff --git a/audio/claxon/src/claxondec/imp.rs b/audio/claxon/src/claxondec/imp.rs index 304e769dd..ce8d2761b 100644 --- a/audio/claxon/src/claxondec/imp.rs +++ b/audio/claxon/src/claxondec/imp.rs @@ -9,8 +9,7 @@ use glib::subclass; use glib::subclass::prelude::*; use gst::subclass::prelude::*; -use gst::{gst_debug, gst_element_error, gst_error}; -use gst_audio::gst_audio_decoder_error; +use gst::{gst_debug, gst_error}; use gst_audio::prelude::*; use gst_audio::subclass::prelude::*; @@ -221,12 +220,12 @@ impl ClaxonDec { indata: &[u8], ) -> Result<gst::FlowSuccess, gst::FlowError> { let streaminfo = get_claxon_streaminfo(indata).map_err(|e| { - gst_element_error!(element, gst::StreamError::Decode, [e]); + gst::element_error!(element, gst::StreamError::Decode, [e]); gst::FlowError::Error })?; let audio_info = get_gstaudioinfo(streaminfo).map_err(|e| { - gst_element_error!(element, gst::StreamError::Decode, [&e]); + gst::element_error!(element, gst::StreamError::Decode, [&e]); gst::FlowError::Error })?; @@ -275,7 +274,7 @@ impl ClaxonDec { Ok(Some(result)) => result, Ok(None) => return element.finish_frame(None, 1), Err(err) => { - return gst_audio_decoder_error!( + return gst_audio::audio_decoder_error!( element, 1, gst::StreamError::Decode, diff --git a/audio/claxon/src/lib.rs b/audio/claxon/src/lib.rs index 6d9cd5c83..18039cd94 100644 --- a/audio/claxon/src/lib.rs +++ b/audio/claxon/src/lib.rs @@ -12,7 +12,7 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { claxondec::register(plugin) } -gst::gst_plugin_define!( +gst::plugin_define!( claxon, env!("CARGO_PKG_DESCRIPTION"), plugin_init, diff --git a/audio/csound/src/filter/imp.rs b/audio/csound/src/filter/imp.rs index 8740bb493..6fdda3aff 100644 --- a/audio/csound/src/filter/imp.rs +++ b/audio/csound/src/filter/imp.rs @@ -20,8 +20,7 @@ use glib::subclass::prelude::*; use gst::prelude::*; use gst::subclass::prelude::*; use gst::{ - gst_debug, gst_element_error, gst_error, gst_error_msg, gst_info, gst_log, gst_loggable_error, - gst_warning, + element_error, error_msg, gst_debug, gst_error, gst_info, gst_log, gst_warning, loggable_error, }; use gst_base::subclass::base_transform::GenerateOutputSuccess; use gst_base::subclass::prelude::*; @@ -194,13 +193,13 @@ impl CsoundFilter { if let Some(ref location) = settings.location { csound .compile_csd(location) - .map_err(|e| gst_error_msg!(gst::LibraryError::Failed, [e]))?; + .map_err(|e| error_msg!(gst::LibraryError::Failed, [e]))?; } else if let Some(ref text) = settings.csd_text { csound .compile_csd_text(text) - .map_err(|e| gst_error_msg!(gst::LibraryError::Failed, [e]))?; + .map_err(|e| error_msg!(gst::LibraryError::Failed, [e]))?; } else { - return Err(gst_error_msg!( + return Err(error_msg!( gst::LibraryError::Failed, ["No Csound score specified to compile. Use either location or csd-text but not both"] )); @@ -500,7 +499,7 @@ impl BaseTransformImpl for CsoundFilter { csound.set_score_offset_seconds(settings.offset); if let Err(e) = csound.start() { - return Err(gst_error_msg!(gst::LibraryError::Failed, [e])); + return Err(error_msg!(gst::LibraryError::Failed, [e])); } Ok(()) @@ -589,15 +588,14 @@ impl BaseTransformImpl for CsoundFilter { ) -> Result<(), gst::LoggableError> { // Flush previous state if self.state.lock().unwrap().is_some() { - self.drain(element).map_err(|e| { - gst_loggable_error!(CAT, "Error flusing previous state data {:?}", e) - })?; + self.drain(element) + .map_err(|e| loggable_error!(CAT, "Error flusing previous state data {:?}", e))?; } let in_info = gst_audio::AudioInfo::from_caps(incaps) - .map_err(|_| gst_loggable_error!(CAT, "Failed to parse input caps"))?; + .map_err(|_| loggable_error!(CAT, "Failed to parse input caps"))?; let out_info = gst_audio::AudioInfo::from_caps(outcaps) - .map_err(|_| gst_loggable_error!(CAT, "Failed to parse output caps"))?; + .map_err(|_| loggable_error!(CAT, "Failed to parse output caps"))?; let csound = self.csound.lock().unwrap(); @@ -607,19 +605,19 @@ impl BaseTransformImpl for CsoundFilter { // Check if the negotiated caps are the right ones if rate != out_info.rate() || rate != csound.get_sample_rate() as _ { - return Err(gst_loggable_error!( + return Err(loggable_error!( CAT, "Failed to negotiate caps: invalid sample rate {}", rate )); } else if ichannels != csound.input_channels() { - return Err(gst_loggable_error!( + return Err(loggable_error!( CAT, "Failed to negotiate caps: input channels {} not supported", ichannels )); } else if ochannels != csound.output_channels() { - return Err(gst_loggable_error!( + return Err(loggable_error!( CAT, "Failed to negotiate caps: output channels {} not supported", ochannels @@ -655,7 +653,7 @@ impl BaseTransformImpl for CsoundFilter { let mut state_guard = self.state.lock().unwrap(); let state = state_guard.as_mut().ok_or_else(|| { - gst_element_error!( + element_error!( element, gst::CoreError::Negotiation, ["Can not generate an output without State"] diff --git a/audio/csound/src/lib.rs b/audio/csound/src/lib.rs index e10915bdb..2c7f15958 100644 --- a/audio/csound/src/lib.rs +++ b/audio/csound/src/lib.rs @@ -15,8 +15,6 @@ // Free Software Foundation, Inc., 51 Franklin Street, Suite 500, // Boston, MA 02110-1335, USA. -use gst::gst_plugin_define; - mod filter; fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { @@ -24,7 +22,7 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { Ok(()) } -gst_plugin_define!( +gst::plugin_define!( csound, env!("CARGO_PKG_DESCRIPTION"), plugin_init, diff --git a/audio/lewton/src/lewtondec/imp.rs b/audio/lewton/src/lewtondec/imp.rs index aa5b95756..3573a55e7 100644 --- a/audio/lewton/src/lewtondec/imp.rs +++ b/audio/lewton/src/lewtondec/imp.rs @@ -9,8 +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::{gst_debug, gst_error, gst_warning}; +use gst_audio::audio_decoder_error; use gst_audio::prelude::*; use gst_audio::subclass::prelude::*; @@ -262,7 +262,7 @@ impl LewtonDec { (ident_buf, comment_buf, setup_buf) } _ => { - gst_element_error!( + gst::element_error!( element, gst::StreamError::Decode, ["Got no headers before data packets"] @@ -277,7 +277,7 @@ impl LewtonDec { gst::FlowError::Error })?; let ident = lewton::header::read_header_ident(ident_map.as_ref()).map_err(|err| { - gst_element_error!( + gst::element_error!( element, gst::StreamError::Decode, ["Failed to parse ident header: {:?}", err] @@ -290,7 +290,7 @@ impl LewtonDec { gst::FlowError::Error })?; let comment = lewton::header::read_header_comment(comment_map.as_ref()).map_err(|err| { - gst_element_error!( + gst::element_error!( element, gst::StreamError::Decode, ["Failed to parse comment header: {:?}", err] @@ -308,7 +308,7 @@ impl LewtonDec { (ident.blocksize_0, ident.blocksize_1), ) .map_err(|err| { - gst_element_error!( + gst::element_error!( element, gst::StreamError::Decode, ["Failed to parse setup header: {:?}", err] @@ -384,7 +384,7 @@ impl LewtonDec { { Ok(decoded) => decoded, Err(err) => { - return gst_audio_decoder_error!( + return audio_decoder_error!( element, 1, gst::StreamError::Decode, @@ -394,7 +394,7 @@ impl LewtonDec { }; if decoded.channel_count != audio_info.channels() as usize { - return gst_audio_decoder_error!( + return audio_decoder_error!( element, 1, gst::StreamError::Decode, @@ -417,7 +417,7 @@ impl LewtonDec { let mut outbuf = element .allocate_output_buffer(sample_count as usize * audio_info.bpf() as usize) .map_err(|_| { - gst_element_error!( + gst::element_error!( element, gst::StreamError::Decode, ["Failed to allocate output buffer"] @@ -429,7 +429,7 @@ impl LewtonDec { // GStreamer channel order let outbuf = outbuf.get_mut().unwrap(); let mut outmap = outbuf.map_writable().map_err(|_| { - gst_element_error!( + gst::element_error!( element, gst::StreamError::Decode, ["Failed to map output buffer writable"] diff --git a/audio/lewton/src/lib.rs b/audio/lewton/src/lib.rs index 5b4166a5e..fa63d81b0 100644 --- a/audio/lewton/src/lib.rs +++ b/audio/lewton/src/lib.rs @@ -12,7 +12,7 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { lewtondec::register(plugin) } -gst::gst_plugin_define!( +gst::plugin_define!( lewton, env!("CARGO_PKG_DESCRIPTION"), plugin_init, |