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;
gst::debug!(
CAT,
imp: imp,
"Found peak {} at sample {}, going to attack state at sample {} (gain reduction {}-{})",
peak_value,
smp_cnt + LIMITER_ATTACK_WINDOW,
smp_cnt,
self.gain_reduction[0],
self.gain_reduction[1]
);
CAT,
imp: imp,
"Found peak {} at sample {}, going to attack state at sample {} (gain reduction {}-{})",
peak_value,
smp_cnt + LIMITER_ATTACK_WINDOW,
smp_cnt,
self.gain_reduction[0],
self.gain_reduction[1]
);
} else {
// Process all samples, no peak found
smp_cnt = nb_samples;
@ -992,15 +992,15 @@ impl State {
self.sustain_cnt = None;
gst::debug!(
CAT,
imp: imp,
"Found new peak {} at sample {}, restarting attack state at sample {} (gain reduction {}-{})",
peak_value,
smp_cnt + LIMITER_ATTACK_WINDOW,
smp_cnt,
self.gain_reduction[0],
self.gain_reduction[1],
);
CAT,
imp: imp,
"Found new peak {} at sample {}, restarting attack state at sample {} (gain reduction {}-{})",
peak_value,
smp_cnt + LIMITER_ATTACK_WINDOW,
smp_cnt,
self.gain_reduction[0],
self.gain_reduction[1],
);
} else {
// 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.
@ -1041,15 +1041,15 @@ impl State {
self.sustain_cnt = Some(self.env_cnt);
gst::debug!(
CAT,
imp: imp,
"Found new peak {} at sample {}, adjusting attack state at sample {} (gain reduction {}-{})",
peak_value,
smp_cnt + LIMITER_ATTACK_WINDOW,
smp_cnt,
self.gain_reduction[0],
self.gain_reduction[1],
);
CAT,
imp: imp,
"Found new peak {} at sample {}, adjusting attack state at sample {} (gain reduction {}-{})",
peak_value,
smp_cnt + LIMITER_ATTACK_WINDOW,
smp_cnt,
self.gain_reduction[0],
self.gain_reduction[1],
);
}
return smp_cnt;
} else {
@ -1151,25 +1151,25 @@ impl State {
self.gain_reduction[1] = gain_reduction;
gst::debug!(
CAT,
imp: imp,
"Found new peak {} at sample {}, going back to attack state at sample {} (gain reduction {}-{})",
peak_value,
smp_cnt + LIMITER_ATTACK_WINDOW,
smp_cnt,
self.gain_reduction[0],
self.gain_reduction[1],
);
CAT,
imp: imp,
"Found new peak {} at sample {}, going back to attack state at sample {} (gain reduction {}-{})",
peak_value,
smp_cnt + LIMITER_ATTACK_WINDOW,
smp_cnt,
self.gain_reduction[0],
self.gain_reduction[1],
);
} else {
gst::debug!(
CAT,
imp: imp,
"Found new peak {} at sample {}, going sustain further at sample {} (gain reduction {})",
peak_value,
smp_cnt + LIMITER_ATTACK_WINDOW,
smp_cnt,
self.gain_reduction[1],
);
CAT,
imp: imp,
"Found new peak {} at sample {}, going sustain further at sample {} (gain reduction {})",
peak_value,
smp_cnt + LIMITER_ATTACK_WINDOW,
smp_cnt,
self.gain_reduction[1],
);
// We need to sustain until the peak at least
self.sustain_cnt = Some(LIMITER_LOOKAHEAD);
}
@ -1259,26 +1259,26 @@ impl State {
self.gain_reduction[1] = gain_reduction;
gst::debug!(
CAT,
imp: imp,
"Found new peak {} at sample {}, going back to attack state at sample {} (gain reduction {}-{})",
peak_value,
smp_cnt + LIMITER_ATTACK_WINDOW,
smp_cnt,
self.gain_reduction[0],
self.gain_reduction[1],
);
CAT,
imp: imp,
"Found new peak {} at sample {}, going back to attack state at sample {} (gain reduction {}-{})",
peak_value,
smp_cnt + LIMITER_ATTACK_WINDOW,
smp_cnt,
self.gain_reduction[0],
self.gain_reduction[1],
);
} else {
self.gain_reduction[1] = current_gain_reduction;
gst::debug!(
CAT,
imp: imp,
"Going from release to sustain state at sample {} because of low peak {} at sample {} (gain reduction {})",
smp_cnt,
peak_value,
smp_cnt + LIMITER_ATTACK_WINDOW,
self.gain_reduction[1]
);
CAT,
imp: imp,
"Going from release to sustain state at sample {} because of low peak {} at sample {} (gain reduction {})",
smp_cnt,
peak_value,
smp_cnt + LIMITER_ATTACK_WINDOW,
self.gain_reduction[1]
);
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");

View file

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

View file

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

View file

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

View file

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

View file

@ -219,12 +219,12 @@ impl OnvifMetadataParse {
Some(diff) => diff,
None => {
gst::error!(
CAT,
obj: pad,
"Too big running time difference between initial running time {:?} and current running time {:?}",
initial_running_time,
running_time,
);
CAT,
obj: pad,
"Too big running time difference between initial running time {:?} and current running time {:?}",
initial_running_time,
running_time,
);
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 video_sink = match video_sink_weak.upgrade() {
Some(video_sink) => video_sink,
None => return glib::Continue(true),
None => return glib::ControlFlow::Continue,
};
let position = video_sink
@ -118,7 +118,7 @@ fn create_ui(app: &gtk::Application) {
.unwrap_or(gst::ClockTime::ZERO);
position_label.set_text(&format!("Position: {position:.1}"));
glib::Continue(true)
glib::ControlFlow::Continue
});
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() {
Some(app) => app,
None => return glib::Continue(false),
None => return glib::ControlFlow::Break,
};
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");

View file

@ -134,7 +134,7 @@ fn create_window(app: &gtk::Application) {
_ => (),
};
glib::Continue(true)
glib::ControlFlow::Continue
})
.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 video_sink = match video_sink_weak.upgrade() {
Some(video_sink) => video_sink,
None => return glib::Continue(true),
None => return glib::ControlFlow::Continue,
};
let togglerecord = match togglerecord_weak.upgrade() {
Some(togglerecord) => togglerecord,
None => return glib::Continue(true),
None => return glib::ControlFlow::Continue,
};
let position = video_sink
@ -241,7 +241,7 @@ fn create_ui(app: &gtk::Application) {
.unwrap_or(gst::ClockTime::ZERO);
recorded_duration_label.set_text(&format!("Recorded: {recording_duration:.1}"));
glib::Continue(true)
glib::ControlFlow::Continue
});
let togglerecord_weak = togglerecord.downgrade();
@ -290,7 +290,7 @@ fn create_ui(app: &gtk::Application) {
let app = match app_weak.upgrade() {
Some(app) => app,
None => return glib::Continue(false),
None => return glib::ControlFlow::Break,
};
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");

View file

@ -856,13 +856,13 @@ impl ToggleRecord {
// 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.
gst::debug!(
CAT,
obj: pad,
"Main stream EOS and we're not EOS yet (overlapping recording start, {} < {} < {})",
current_running_time.display(),
last_recording_start,
current_running_time_end.display(),
);
CAT,
obj: pad,
"Main stream EOS and we're not EOS yet (overlapping recording start, {} < {} < {})",
current_running_time.display(),
last_recording_start,
current_running_time_end.display(),
);
let mut clip_start = state
.in_segment
@ -914,13 +914,13 @@ impl ToggleRecord {
// 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.
gst::debug!(
CAT,
obj: pad,
"Main stream EOS and we're not EOS yet (overlapping recording end, {} < {} < {})",
current_running_time.display(),
rec_state.last_recording_stop.display(),
current_running_time_end.display(),
);
CAT,
obj: pad,
"Main stream EOS and we're not EOS yet (overlapping recording end, {} < {} < {})",
current_running_time.display(),
rec_state.last_recording_stop.display(),
current_running_time_end.display(),
);
let mut clip_start = state
.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 pipeline = match pipeline_weak.upgrade() {
Some(pipeline) => pipeline,
None => return glib::Continue(true),
None => return glib::ControlFlow::Continue,
};
let position = pipeline.query_position::<gst::ClockTime>();
label.set_text(&format!("Position: {:.0}", position.display()));
glib::Continue(true)
glib::ControlFlow::Continue
});
let bus = pipeline.bus().unwrap();
@ -98,7 +98,7 @@ fn create_ui(app: &gtk::Application) {
let app = match app_weak.upgrade() {
Some(app) => app,
None => return glib::Continue(false),
None => return glib::ControlFlow::Break,
};
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");

View file

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