Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(684)

Unified Diff: webrtc/modules/audio_processing/test/aec_dump_based_simulator.cc

Issue 2449043008: Added calling of the stream_analog_level api in audioproc_f (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/test/aec_dump_based_simulator.cc
diff --git a/webrtc/modules/audio_processing/test/aec_dump_based_simulator.cc b/webrtc/modules/audio_processing/test/aec_dump_based_simulator.cc
index c2983fc62516fb6a6dfd3679a2ddae0616522160..266e649181a6cd5d3ae8770ec9e1448ff624d98c 100644
--- a/webrtc/modules/audio_processing/test/aec_dump_based_simulator.cc
+++ b/webrtc/modules/audio_processing/test/aec_dump_based_simulator.cc
@@ -63,7 +63,8 @@ bool VerifyFloatBitExactness(const webrtc::audioproc::Stream& msg,
} // namespace
void AecDumpBasedSimulator::PrepareProcessStreamCall(
- const webrtc::audioproc::Stream& msg) {
+ const webrtc::audioproc::Stream& msg,
+ bool* set_stream_analog_level_called) {
if (msg.has_input_data()) {
// Fixed interface processing.
// Verify interface invariance.
@@ -127,6 +128,9 @@ void AecDumpBasedSimulator::PrepareProcessStreamCall(
if (msg.has_level()) {
RTC_CHECK_EQ(AudioProcessing::kNoError,
ap_->gain_control()->set_stream_analog_level(msg.level()));
+ *set_stream_analog_level_called = true;
+ } else {
+ *set_stream_analog_level_called = false;
}
}
@@ -507,8 +511,14 @@ void AecDumpBasedSimulator::HandleMessage(const webrtc::audioproc::Init& msg) {
void AecDumpBasedSimulator::HandleMessage(
const webrtc::audioproc::Stream& msg) {
- PrepareProcessStreamCall(msg);
+ bool set_stream_analog_level_called = false;
+ PrepareProcessStreamCall(msg, &set_stream_analog_level_called);
ProcessStream(interface_used_ == InterfaceType::kFixedInterface);
+ if (set_stream_analog_level_called) {
+ // Call stream analog level to ensure that any side-effects are triggered.
+ (void)ap_->gain_control()->stream_analog_level();
+ }
+
VerifyProcessStreamBitExactness(msg);
}

Powered by Google App Engine
This is Rietveld 408576698