OLD | NEW |
---|---|
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 */ |
the sun
2016/09/01 13:48:01
The name of this file is confusing. What is it? A
peah-webrtc
2016/09/02 08:22:01
It is a performance test. Do you have a better sug
| |
10 | 10 |
11 #include <numeric> | 11 #include <numeric> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "webrtc/base/array_view.h" | 15 #include "webrtc/base/array_view.h" |
16 #include "webrtc/base/random.h" | 16 #include "webrtc/base/random.h" |
17 #include "webrtc/modules/audio_processing/audio_buffer.h" | 17 #include "webrtc/modules/audio_processing/audio_buffer.h" |
18 #include "webrtc/modules/audio_processing/include/audio_processing.h" | 18 #include "webrtc/modules/audio_processing/include/audio_processing.h" |
19 #include "webrtc/modules/audio_processing/level_controller/level_controller.h" | 19 #include "webrtc/modules/audio_processing/level_controller/level_controller.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 ASSERT_TRUE(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 Loading... | |
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 |
OLD | NEW |