Adapt to glib::Continue rename

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1268>
This commit is contained in:
Bilal Elmoussaoui 2023-07-06 15:27:28 +02:00 committed by Sebastian Dröge
parent 64151790d0
commit 2cc98bf410
13 changed files with 123 additions and 123 deletions

View file

@ -855,15 +855,15 @@ impl State {
smp_cnt += LIMITER_LOOKAHEAD + peak_delta - LIMITER_ATTACK_WINDOW; smp_cnt += LIMITER_LOOKAHEAD + peak_delta - LIMITER_ATTACK_WINDOW;
gst::debug!( gst::debug!(
CAT, CAT,
imp: imp, imp: imp,
"Found peak {} at sample {}, going to attack state at sample {} (gain reduction {}-{})", "Found peak {} at sample {}, going to attack state at sample {} (gain reduction {}-{})",
peak_value, peak_value,
smp_cnt + LIMITER_ATTACK_WINDOW, smp_cnt + LIMITER_ATTACK_WINDOW,
smp_cnt, smp_cnt,
self.gain_reduction[0], self.gain_reduction[0],
self.gain_reduction[1] self.gain_reduction[1]
); );
} else { } else {
// Process all samples, no peak found // Process all samples, no peak found
smp_cnt = nb_samples; smp_cnt = nb_samples;
@ -992,15 +992,15 @@ impl State {
self.sustain_cnt = None; self.sustain_cnt = None;
gst::debug!( gst::debug!(
CAT, CAT,
imp: imp, imp: imp,
"Found new peak {} at sample {}, restarting attack state at sample {} (gain reduction {}-{})", "Found new peak {} at sample {}, restarting attack state at sample {} (gain reduction {}-{})",
peak_value, peak_value,
smp_cnt + LIMITER_ATTACK_WINDOW, smp_cnt + LIMITER_ATTACK_WINDOW,
smp_cnt, smp_cnt,
self.gain_reduction[0], self.gain_reduction[0],
self.gain_reduction[1], self.gain_reduction[1],
); );
} else { } else {
// If the slope is lower we can't simply reduce the slope as we would // If the slope is lower we can't simply reduce the slope as we would
// then have a lower gain reduction than needed at the previous peak. // then have a lower gain reduction than needed at the previous peak.
@ -1041,15 +1041,15 @@ impl State {
self.sustain_cnt = Some(self.env_cnt); self.sustain_cnt = Some(self.env_cnt);
gst::debug!( gst::debug!(
CAT, CAT,
imp: imp, imp: imp,
"Found new peak {} at sample {}, adjusting attack state at sample {} (gain reduction {}-{})", "Found new peak {} at sample {}, adjusting attack state at sample {} (gain reduction {}-{})",
peak_value, peak_value,
smp_cnt + LIMITER_ATTACK_WINDOW, smp_cnt + LIMITER_ATTACK_WINDOW,
smp_cnt, smp_cnt,
self.gain_reduction[0], self.gain_reduction[0],
self.gain_reduction[1], self.gain_reduction[1],
); );
} }
return smp_cnt; return smp_cnt;
} else { } else {
@ -1151,25 +1151,25 @@ impl State {
self.gain_reduction[1] = gain_reduction; self.gain_reduction[1] = gain_reduction;
gst::debug!( gst::debug!(
CAT, CAT,
imp: imp, imp: imp,
"Found new peak {} at sample {}, going back to attack state at sample {} (gain reduction {}-{})", "Found new peak {} at sample {}, going back to attack state at sample {} (gain reduction {}-{})",
peak_value, peak_value,
smp_cnt + LIMITER_ATTACK_WINDOW, smp_cnt + LIMITER_ATTACK_WINDOW,
smp_cnt, smp_cnt,
self.gain_reduction[0], self.gain_reduction[0],
self.gain_reduction[1], self.gain_reduction[1],
); );
} else { } else {
gst::debug!( gst::debug!(
CAT, CAT,
imp: imp, imp: imp,
"Found new peak {} at sample {}, going sustain further at sample {} (gain reduction {})", "Found new peak {} at sample {}, going sustain further at sample {} (gain reduction {})",
peak_value, peak_value,
smp_cnt + LIMITER_ATTACK_WINDOW, smp_cnt + LIMITER_ATTACK_WINDOW,
smp_cnt, smp_cnt,
self.gain_reduction[1], self.gain_reduction[1],
); );
// We need to sustain until the peak at least // We need to sustain until the peak at least
self.sustain_cnt = Some(LIMITER_LOOKAHEAD); self.sustain_cnt = Some(LIMITER_LOOKAHEAD);
} }
@ -1259,26 +1259,26 @@ impl State {
self.gain_reduction[1] = gain_reduction; self.gain_reduction[1] = gain_reduction;
gst::debug!( gst::debug!(
CAT, CAT,
imp: imp, imp: imp,
"Found new peak {} at sample {}, going back to attack state at sample {} (gain reduction {}-{})", "Found new peak {} at sample {}, going back to attack state at sample {} (gain reduction {}-{})",
peak_value, peak_value,
smp_cnt + LIMITER_ATTACK_WINDOW, smp_cnt + LIMITER_ATTACK_WINDOW,
smp_cnt, smp_cnt,
self.gain_reduction[0], self.gain_reduction[0],
self.gain_reduction[1], self.gain_reduction[1],
); );
} else { } else {
self.gain_reduction[1] = current_gain_reduction; self.gain_reduction[1] = current_gain_reduction;
gst::debug!( gst::debug!(
CAT, CAT,
imp: imp, imp: imp,
"Going from release to sustain state at sample {} because of low peak {} at sample {} (gain reduction {})", "Going from release to sustain state at sample {} because of low peak {} at sample {} (gain reduction {})",
smp_cnt, smp_cnt,
peak_value, peak_value,
smp_cnt + LIMITER_ATTACK_WINDOW, smp_cnt + LIMITER_ATTACK_WINDOW,
self.gain_reduction[1] self.gain_reduction[1]
); );
self.limiter_state = LimiterState::Sustain; self.limiter_state = LimiterState::Sustain;
} }

View file

@ -211,7 +211,7 @@ fn main() {
_ => (), _ => (),
}; };
glib::Continue(true) glib::ControlFlow::Continue
}) })
.expect("Failed to add bus watch"); .expect("Failed to add bus watch");

View file

@ -116,7 +116,7 @@ fn main() {
gst::info!(CAT, "Received eos"); gst::info!(CAT, "Received eos");
l_clone.quit(); l_clone.quit();
glib::Continue(false) glib::ControlFlow::Break
} }
MessageView::Error(msg) => { MessageView::Error(msg) => {
if let gst::MessageView::Error(msg) = msg.message().view() { if let gst::MessageView::Error(msg) = msg.message().view() {
@ -125,9 +125,9 @@ fn main() {
gst::info!(CAT, "Received all shutdown requests"); gst::info!(CAT, "Received all shutdown requests");
l_clone.quit(); l_clone.quit();
return glib::Continue(false); return glib::ControlFlow::Break;
} else { } else {
return glib::Continue(true); return glib::ControlFlow::Continue;
} }
} }
} }
@ -141,9 +141,9 @@ fn main() {
); );
l_clone.quit(); l_clone.quit();
glib::Continue(false) glib::ControlFlow::Break
} }
_ => glib::Continue(true), _ => glib::ControlFlow::Continue,
} }
}) })
.expect("Failed to add bus watch"); .expect("Failed to add bus watch");

View file

@ -178,7 +178,7 @@ fn run(pipeline: gst::Pipeline) {
gst::info!(CAT, "Received eos"); gst::info!(CAT, "Received eos");
l_clone.quit(); l_clone.quit();
glib::Continue(false) glib::ControlFlow::Break
} }
MessageView::Error(msg) => { MessageView::Error(msg) => {
gst::error!( gst::error!(
@ -190,9 +190,9 @@ fn run(pipeline: gst::Pipeline) {
); );
l_clone.quit(); l_clone.quit();
glib::Continue(false) glib::ControlFlow::Break
} }
_ => glib::Continue(true), _ => glib::ControlFlow::Continue,
} }
}) })
.expect("Failed to add bus watch"); .expect("Failed to add bus watch");

View file

@ -165,7 +165,7 @@ fn multiple_contexts_queue() {
_ => (), _ => (),
}; };
glib::Continue(true) glib::ControlFlow::Continue
}) })
.unwrap(); .unwrap();
@ -312,7 +312,7 @@ fn multiple_contexts_proxy() {
_ => (), _ => (),
}; };
glib::Continue(true) glib::ControlFlow::Continue
}) })
.unwrap(); .unwrap();
@ -417,7 +417,7 @@ fn eos() {
MessageView::StateChanged(state_changed) => { MessageView::StateChanged(state_changed) => {
if let Some(source) = state_changed.src() { if let Some(source) = state_changed.src() {
if source.type_() != gst::Pipeline::static_type() { if source.type_() != gst::Pipeline::static_type() {
return glib::Continue(true); return glib::ControlFlow::Continue;
} }
if state_changed.old() == gst::State::Paused if state_changed.old() == gst::State::Paused
&& state_changed.current() == gst::State::Playing && state_changed.current() == gst::State::Playing
@ -441,7 +441,7 @@ fn eos() {
_ => (), _ => (),
}; };
glib::Continue(true) glib::ControlFlow::Continue
}) })
.unwrap(); .unwrap();
@ -573,7 +573,7 @@ fn premature_shutdown() {
MessageView::StateChanged(state_changed) => { MessageView::StateChanged(state_changed) => {
if let Some(source) = state_changed.src() { if let Some(source) = state_changed.src() {
if source.type_() != gst::Pipeline::static_type() { if source.type_() != gst::Pipeline::static_type() {
return glib::Continue(true); return glib::ControlFlow::Continue;
} }
if state_changed.old() == gst::State::Paused if state_changed.old() == gst::State::Paused
&& state_changed.current() == gst::State::Playing && state_changed.current() == gst::State::Playing
@ -597,7 +597,7 @@ fn premature_shutdown() {
_ => (), _ => (),
}; };
glib::Continue(true) glib::ControlFlow::Continue
}) })
.unwrap(); .unwrap();
@ -669,7 +669,7 @@ fn socket_play_null_play() {
MessageView::StateChanged(state_changed) => { MessageView::StateChanged(state_changed) => {
if let Some(source) = state_changed.src() { if let Some(source) = state_changed.src() {
if source.type_() != gst::Pipeline::static_type() { if source.type_() != gst::Pipeline::static_type() {
return glib::Continue(true); return glib::ControlFlow::Continue;
} }
if state_changed.old() == gst::State::Paused if state_changed.old() == gst::State::Paused
&& state_changed.current() == gst::State::Playing && state_changed.current() == gst::State::Playing
@ -694,7 +694,7 @@ fn socket_play_null_play() {
_ => (), _ => (),
}; };
glib::Continue(true) glib::ControlFlow::Continue
}) })
.unwrap(); .unwrap();

View file

@ -274,13 +274,13 @@ impl S3HlsSink {
match result { match result {
Err(err) => { Err(err) => {
gst::error!( gst::error!(
CAT, CAT,
imp: self, imp: self,
"Put object request for S3 key {} of data length {} failed with error {:?}", "Put object request for S3 key {} of data length {} failed with error {:?}",
s3_key, s3_key,
s3_data_len, s3_data_len,
err, err,
); );
element_imp_error!( element_imp_error!(
self, self,
gst::ResourceError::Write, gst::ResourceError::Write,

View file

@ -219,12 +219,12 @@ impl OnvifMetadataParse {
Some(diff) => diff, Some(diff) => diff,
None => { None => {
gst::error!( gst::error!(
CAT, CAT,
obj: pad, obj: pad,
"Too big running time difference between initial running time {:?} and current running time {:?}", "Too big running time difference between initial running time {:?} and current running time {:?}",
initial_running_time, initial_running_time,
running_time, running_time,
); );
return Err(gst::FlowError::Error); return Err(gst::FlowError::Error);
} }
}; };

View file

@ -110,7 +110,7 @@ fn create_ui(app: &gtk::Application) {
let timeout_id = glib::timeout_add_local(std::time::Duration::from_millis(100), move || { let timeout_id = glib::timeout_add_local(std::time::Duration::from_millis(100), move || {
let video_sink = match video_sink_weak.upgrade() { let video_sink = match video_sink_weak.upgrade() {
Some(video_sink) => video_sink, Some(video_sink) => video_sink,
None => return glib::Continue(true), None => return glib::ControlFlow::Continue,
}; };
let position = video_sink let position = video_sink
@ -118,7 +118,7 @@ fn create_ui(app: &gtk::Application) {
.unwrap_or(gst::ClockTime::ZERO); .unwrap_or(gst::ClockTime::ZERO);
position_label.set_text(&format!("Position: {position:.1}")); position_label.set_text(&format!("Position: {position:.1}"));
glib::Continue(true) glib::ControlFlow::Continue
}); });
let video_src_pad_weak = video_src_pad.downgrade(); let video_src_pad_weak = video_src_pad.downgrade();
@ -160,7 +160,7 @@ fn create_ui(app: &gtk::Application) {
let app = match app_weak.upgrade() { let app = match app_weak.upgrade() {
Some(app) => app, Some(app) => app,
None => return glib::Continue(false), None => return glib::ControlFlow::Break,
}; };
match msg.view() { match msg.view() {
@ -177,7 +177,7 @@ fn create_ui(app: &gtk::Application) {
_ => (), _ => (),
}; };
glib::Continue(true) glib::ControlFlow::Continue
}) })
.expect("Failed to add bus watch"); .expect("Failed to add bus watch");

View file

@ -134,7 +134,7 @@ fn create_window(app: &gtk::Application) {
_ => (), _ => (),
}; };
glib::Continue(true) glib::ControlFlow::Continue
}) })
.unwrap() .unwrap()
}; };

View file

@ -221,12 +221,12 @@ fn create_ui(app: &gtk::Application) {
let timeout_id = glib::timeout_add_local(std::time::Duration::from_millis(100), move || { let timeout_id = glib::timeout_add_local(std::time::Duration::from_millis(100), move || {
let video_sink = match video_sink_weak.upgrade() { let video_sink = match video_sink_weak.upgrade() {
Some(video_sink) => video_sink, Some(video_sink) => video_sink,
None => return glib::Continue(true), None => return glib::ControlFlow::Continue,
}; };
let togglerecord = match togglerecord_weak.upgrade() { let togglerecord = match togglerecord_weak.upgrade() {
Some(togglerecord) => togglerecord, Some(togglerecord) => togglerecord,
None => return glib::Continue(true), None => return glib::ControlFlow::Continue,
}; };
let position = video_sink let position = video_sink
@ -241,7 +241,7 @@ fn create_ui(app: &gtk::Application) {
.unwrap_or(gst::ClockTime::ZERO); .unwrap_or(gst::ClockTime::ZERO);
recorded_duration_label.set_text(&format!("Recorded: {recording_duration:.1}")); recorded_duration_label.set_text(&format!("Recorded: {recording_duration:.1}"));
glib::Continue(true) glib::ControlFlow::Continue
}); });
let togglerecord_weak = togglerecord.downgrade(); let togglerecord_weak = togglerecord.downgrade();
@ -290,7 +290,7 @@ fn create_ui(app: &gtk::Application) {
let app = match app_weak.upgrade() { let app = match app_weak.upgrade() {
Some(app) => app, Some(app) => app,
None => return glib::Continue(false), None => return glib::ControlFlow::Break,
}; };
match msg.view() { match msg.view() {
@ -307,7 +307,7 @@ fn create_ui(app: &gtk::Application) {
_ => (), _ => (),
}; };
glib::Continue(true) glib::ControlFlow::Continue
}) })
.expect("Failed to add bus watch"); .expect("Failed to add bus watch");

View file

@ -856,13 +856,13 @@ impl ToggleRecord {
// Otherwise if we're before the recording start but the end of the buffer is after // Otherwise if we're before the recording start but the end of the buffer is after
// the start and we can clip, clip the buffer and pass it onwards. // the start and we can clip, clip the buffer and pass it onwards.
gst::debug!( gst::debug!(
CAT, CAT,
obj: pad, obj: pad,
"Main stream EOS and we're not EOS yet (overlapping recording start, {} < {} < {})", "Main stream EOS and we're not EOS yet (overlapping recording start, {} < {} < {})",
current_running_time.display(), current_running_time.display(),
last_recording_start, last_recording_start,
current_running_time_end.display(), current_running_time_end.display(),
); );
let mut clip_start = state let mut clip_start = state
.in_segment .in_segment
@ -914,13 +914,13 @@ impl ToggleRecord {
// Similarly if the end is after the recording stop but the start is before and we // Similarly if the end is after the recording stop but the start is before and we
// can clip, clip the buffer and pass it through. // can clip, clip the buffer and pass it through.
gst::debug!( gst::debug!(
CAT, CAT,
obj: pad, obj: pad,
"Main stream EOS and we're not EOS yet (overlapping recording end, {} < {} < {})", "Main stream EOS and we're not EOS yet (overlapping recording end, {} < {} < {})",
current_running_time.display(), current_running_time.display(),
rec_state.last_recording_stop.display(), rec_state.last_recording_stop.display(),
current_running_time_end.display(), current_running_time_end.display(),
); );
let mut clip_start = state let mut clip_start = state
.in_segment .in_segment

View file

@ -77,12 +77,12 @@ fn create_ui(app: &gtk::Application) {
let timeout_id = glib::timeout_add_local(std::time::Duration::from_millis(500), move || { let timeout_id = glib::timeout_add_local(std::time::Duration::from_millis(500), move || {
let pipeline = match pipeline_weak.upgrade() { let pipeline = match pipeline_weak.upgrade() {
Some(pipeline) => pipeline, Some(pipeline) => pipeline,
None => return glib::Continue(true), None => return glib::ControlFlow::Continue,
}; };
let position = pipeline.query_position::<gst::ClockTime>(); let position = pipeline.query_position::<gst::ClockTime>();
label.set_text(&format!("Position: {:.0}", position.display())); label.set_text(&format!("Position: {:.0}", position.display()));
glib::Continue(true) glib::ControlFlow::Continue
}); });
let bus = pipeline.bus().unwrap(); let bus = pipeline.bus().unwrap();
@ -98,7 +98,7 @@ fn create_ui(app: &gtk::Application) {
let app = match app_weak.upgrade() { let app = match app_weak.upgrade() {
Some(app) => app, Some(app) => app,
None => return glib::Continue(false), None => return glib::ControlFlow::Break,
}; };
match msg.view() { match msg.view() {
@ -115,7 +115,7 @@ fn create_ui(app: &gtk::Application) {
_ => (), _ => (),
}; };
glib::Continue(true) glib::ControlFlow::Continue
}) })
.expect("Failed to add bus watch"); .expect("Failed to add bus watch");

View file

@ -452,11 +452,11 @@ impl PaintableSink {
self.pending_frame.lock().unwrap().take() self.pending_frame.lock().unwrap().take()
} }
fn do_action(&self, action: SinkEvent) -> glib::Continue { fn do_action(&self, action: SinkEvent) -> glib::ControlFlow {
let paintable = self.paintable.lock().unwrap(); let paintable = self.paintable.lock().unwrap();
let paintable = match &*paintable { let paintable = match &*paintable {
Some(paintable) => paintable, Some(paintable) => paintable,
None => return glib::Continue(false), None => return glib::ControlFlow::Break,
}; };
match action { match action {
@ -468,7 +468,7 @@ impl PaintableSink {
} }
} }
glib::Continue(true) glib::ControlFlow::Continue
} }
fn configure_caps(&self) { fn configure_caps(&self) {
@ -519,7 +519,7 @@ impl PaintableSink {
receiver.attach( receiver.attach(
Some(&glib::MainContext::default()), Some(&glib::MainContext::default()),
glib::clone!( glib::clone!(
@weak self_ => @default-return glib::Continue(false), @weak self_ => @default-return glib::ControlFlow::Break,
move |action| self_.do_action(action) move |action| self_.do_action(action)
), ),
); );