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 */ |
10 | 10 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 new Intelligibility(msg.intelligibility_enhancer_enabled())); | 192 new Intelligibility(msg.intelligibility_enhancer_enabled())); |
193 | 193 |
194 // We only create APM once, since changes on these fields should not | 194 // We only create APM once, since changes on these fields should not |
195 // happen in current implementation. | 195 // happen in current implementation. |
196 if (!apm_.get()) { | 196 if (!apm_.get()) { |
197 apm_.reset(AudioProcessing::Create(config)); | 197 apm_.reset(AudioProcessing::Create(config)); |
198 } | 198 } |
199 } | 199 } |
200 | 200 |
201 void DebugDumpReplayer::ConfigureApm(const audioproc::Config& msg) { | 201 void DebugDumpReplayer::ConfigureApm(const audioproc::Config& msg) { |
| 202 AudioProcessing::Config apm_config; |
| 203 |
202 // AEC configs. | 204 // AEC configs. |
203 RTC_CHECK(msg.has_aec_enabled()); | 205 RTC_CHECK(msg.has_aec_enabled()); |
204 RTC_CHECK_EQ(AudioProcessing::kNoError, | 206 RTC_CHECK_EQ(AudioProcessing::kNoError, |
205 apm_->echo_cancellation()->Enable(msg.aec_enabled())); | 207 apm_->echo_cancellation()->Enable(msg.aec_enabled())); |
206 | 208 |
207 RTC_CHECK(msg.has_aec_drift_compensation_enabled()); | 209 RTC_CHECK(msg.has_aec_drift_compensation_enabled()); |
208 RTC_CHECK_EQ(AudioProcessing::kNoError, | 210 RTC_CHECK_EQ(AudioProcessing::kNoError, |
209 apm_->echo_cancellation()->enable_drift_compensation( | 211 apm_->echo_cancellation()->enable_drift_compensation( |
210 msg.aec_drift_compensation_enabled())); | 212 msg.aec_drift_compensation_enabled())); |
211 | 213 |
(...skipping 28 matching lines...) Expand all Loading... |
240 RTC_CHECK_EQ(AudioProcessing::kNoError, | 242 RTC_CHECK_EQ(AudioProcessing::kNoError, |
241 apm_->gain_control()->set_mode( | 243 apm_->gain_control()->set_mode( |
242 static_cast<GainControl::Mode>(msg.agc_mode()))); | 244 static_cast<GainControl::Mode>(msg.agc_mode()))); |
243 | 245 |
244 RTC_CHECK(msg.has_agc_limiter_enabled()); | 246 RTC_CHECK(msg.has_agc_limiter_enabled()); |
245 RTC_CHECK_EQ(AudioProcessing::kNoError, | 247 RTC_CHECK_EQ(AudioProcessing::kNoError, |
246 apm_->gain_control()->enable_limiter(msg.agc_limiter_enabled())); | 248 apm_->gain_control()->enable_limiter(msg.agc_limiter_enabled())); |
247 | 249 |
248 // HPF configs. | 250 // HPF configs. |
249 RTC_CHECK(msg.has_hpf_enabled()); | 251 RTC_CHECK(msg.has_hpf_enabled()); |
250 RTC_CHECK_EQ(AudioProcessing::kNoError, | 252 apm_config.high_pass_filter.enabled = msg.hpf_enabled(); |
251 apm_->high_pass_filter()->Enable(msg.hpf_enabled())); | |
252 | 253 |
253 // NS configs. | 254 // NS configs. |
254 RTC_CHECK(msg.has_ns_enabled()); | 255 RTC_CHECK(msg.has_ns_enabled()); |
255 RTC_CHECK_EQ(AudioProcessing::kNoError, | 256 RTC_CHECK_EQ(AudioProcessing::kNoError, |
256 apm_->noise_suppression()->Enable(msg.ns_enabled())); | 257 apm_->noise_suppression()->Enable(msg.ns_enabled())); |
257 | 258 |
258 RTC_CHECK(msg.has_ns_level()); | 259 RTC_CHECK(msg.has_ns_level()); |
259 RTC_CHECK_EQ(AudioProcessing::kNoError, | 260 RTC_CHECK_EQ(AudioProcessing::kNoError, |
260 apm_->noise_suppression()->set_level( | 261 apm_->noise_suppression()->set_level( |
261 static_cast<NoiseSuppression::Level>(msg.ns_level()))); | 262 static_cast<NoiseSuppression::Level>(msg.ns_level()))); |
| 263 |
| 264 apm_->ApplyConfig(apm_config); |
262 } | 265 } |
263 | 266 |
264 void DebugDumpReplayer::LoadNextMessage() { | 267 void DebugDumpReplayer::LoadNextMessage() { |
265 has_next_event_ = | 268 has_next_event_ = |
266 debug_file_ && ReadMessageFromFile(debug_file_, &next_event_); | 269 debug_file_ && ReadMessageFromFile(debug_file_, &next_event_); |
267 } | 270 } |
268 | 271 |
269 } // namespace test | 272 } // namespace test |
270 } // namespace webrtc | 273 } // namespace webrtc |
OLD | NEW |