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

Side by Side Diff: webrtc/modules/audio_processing/level_controller/level_controller_complexity_unittest.cc

Issue 2292863002: Introduced new scheme for controlling the functionality inside the audio processing module (Closed)
Patch Set: Fixed bad merge Created 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 bool use_mobile_aec, 191 bool use_mobile_aec,
192 bool include_default_apm_processing) { 192 bool include_default_apm_processing) {
193 SimulatorBuffers buffers( 193 SimulatorBuffers buffers(
194 render_input_sample_rate_hz, capture_input_sample_rate_hz, 194 render_input_sample_rate_hz, capture_input_sample_rate_hz,
195 render_output_sample_rate_hz, capture_output_sample_rate_hz, num_channels, 195 render_output_sample_rate_hz, capture_output_sample_rate_hz, num_channels,
196 num_channels, num_channels, num_channels); 196 num_channels, num_channels, num_channels);
197 SubmodulePerformanceTimer render_timer; 197 SubmodulePerformanceTimer render_timer;
198 SubmodulePerformanceTimer capture_timer; 198 SubmodulePerformanceTimer capture_timer;
199 SubmodulePerformanceTimer total_timer; 199 SubmodulePerformanceTimer total_timer;
200 200
201 Config config; 201 webrtc::Config config;
202 AudioProcessing::Config apm_config;
202 if (include_default_apm_processing) { 203 if (include_default_apm_processing) {
203 config.Set<DelayAgnostic>(new DelayAgnostic(true)); 204 config.Set<DelayAgnostic>(new DelayAgnostic(true));
204 config.Set<ExtendedFilter>(new ExtendedFilter(true)); 205 config.Set<ExtendedFilter>(new ExtendedFilter(true));
205 } 206 }
206 config.Set<LevelControl>(new LevelControl(true)); 207 apm_config.level_controller.enabled = true;
207 208
208 std::unique_ptr<AudioProcessing> apm; 209 std::unique_ptr<AudioProcessing> apm;
209 apm.reset(AudioProcessing::Create(config)); 210 apm.reset(AudioProcessing::Create(config));
210 ASSERT_TRUE(apm.get()); 211 ASSERT_TRUE(apm.get());
212 apm->ApplyConfig(apm_config);
211 213
212 ASSERT_EQ(AudioProcessing::kNoError, 214 ASSERT_EQ(AudioProcessing::kNoError,
213 apm->gain_control()->Enable(include_default_apm_processing)); 215 apm->gain_control()->Enable(include_default_apm_processing));
214 if (use_mobile_aec) { 216 if (use_mobile_aec) {
215 ASSERT_EQ(AudioProcessing::kNoError, 217 ASSERT_EQ(AudioProcessing::kNoError,
216 apm->echo_cancellation()->Enable(false)); 218 apm->echo_cancellation()->Enable(false));
217 ASSERT_EQ(AudioProcessing::kNoError, apm->echo_control_mobile()->Enable( 219 ASSERT_EQ(AudioProcessing::kNoError, apm->echo_control_mobile()->Enable(
218 include_default_apm_processing)); 220 include_default_apm_processing));
219 } else { 221 } else {
220 ASSERT_EQ(AudioProcessing::kNoError, 222 ASSERT_EQ(AudioProcessing::kNoError,
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 RunTogetherWithApm("LevelControlAndDefaultMobileApm", 48000, 48000, 346 RunTogetherWithApm("LevelControlAndDefaultMobileApm", 48000, 48000,
345 capture_input_sample_rate_hz, 347 capture_input_sample_rate_hz,
346 capture_output_sample_rate_hz, num_channels, true, 348 capture_output_sample_rate_hz, num_channels, true,
347 true); 349 true);
348 } 350 }
349 } 351 }
350 } 352 }
351 } 353 }
352 354
353 } // namespace webrtc 355 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698