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

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

Issue 2834643002: audioproc_f with simulated mic analog gain (Closed)
Patch Set: AEC dump + fake rec device bugfix Created 3 years, 3 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 c2e262ae6f4d4f9c5ae2c357c475ef647cce215f..10917d155859a5555ca1155e5403b0dfd16a1447 100644
--- a/webrtc/modules/audio_processing/test/aec_dump_based_simulator.cc
+++ b/webrtc/modules/audio_processing/test/aec_dump_based_simulator.cc
@@ -14,6 +14,7 @@
#include "webrtc/modules/audio_processing/test/protobuf_utils.h"
#include "webrtc/rtc_base/checks.h"
+#include "webrtc/rtc_base/logging.h"
#include "webrtc/test/testsupport/trace_to_stderr.h"
namespace webrtc {
@@ -64,13 +65,15 @@ bool VerifyFloatBitExactness(const webrtc::audioproc::Stream& msg,
} // namespace
AecDumpBasedSimulator::AecDumpBasedSimulator(const SimulationSettings& settings)
- : AudioProcessingSimulator(settings) {}
+ : AudioProcessingSimulator(settings) {
+ if (settings_.simulate_mic_gain)
+ LOG(LS_VERBOSE) << "Simulating analog mic gain using AEC dump as input";
+}
AecDumpBasedSimulator::~AecDumpBasedSimulator() = default;
void AecDumpBasedSimulator::PrepareProcessStreamCall(
- const webrtc::audioproc::Stream& msg,
- bool* set_stream_analog_level_called) {
+ const webrtc::audioproc::Stream& msg) {
if (msg.has_input_data()) {
// Fixed interface processing.
// Verify interface invariance.
@@ -159,15 +162,9 @@ void AecDumpBasedSimulator::PrepareProcessStreamCall(
ap_->set_stream_key_pressed(*settings_.use_ts);
}
- // TODO(peah): Add support for controlling the analog level via the
- // command-line.
- 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;
- }
+ // Level is always logged in AEC dumps.
+ RTC_CHECK(msg.has_level());
+ aec_dump_mic_level_ = rtc::Optional<int>(msg.level());
}
void AecDumpBasedSimulator::VerifyProcessStreamBitExactness(
@@ -565,14 +562,8 @@ void AecDumpBasedSimulator::HandleMessage(const webrtc::audioproc::Init& msg) {
void AecDumpBasedSimulator::HandleMessage(
const webrtc::audioproc::Stream& msg) {
- bool set_stream_analog_level_called = false;
- PrepareProcessStreamCall(msg, &set_stream_analog_level_called);
+ PrepareProcessStreamCall(msg);
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