OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 use_new_agc_(config.Get<ExperimentalAgc>().enabled), | 187 use_new_agc_(config.Get<ExperimentalAgc>().enabled), |
188 #endif | 188 #endif |
189 agc_startup_min_volume_(config.Get<ExperimentalAgc>().startup_min_volume), | 189 agc_startup_min_volume_(config.Get<ExperimentalAgc>().startup_min_volume), |
190 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) | 190 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
191 transient_suppressor_enabled_(false), | 191 transient_suppressor_enabled_(false), |
192 #else | 192 #else |
193 transient_suppressor_enabled_(config.Get<ExperimentalNs>().enabled), | 193 transient_suppressor_enabled_(config.Get<ExperimentalNs>().enabled), |
194 #endif | 194 #endif |
195 beamformer_enabled_(config.Get<Beamforming>().enabled), | 195 beamformer_enabled_(config.Get<Beamforming>().enabled), |
196 beamformer_(beamformer), | 196 beamformer_(beamformer), |
197 array_geometry_(config.Get<Beamforming>().array_geometry), | 197 array_geometry_(config.Get<Beamforming>().array_geometry) { |
198 supports_48kHz_(config.Get<AudioProcessing48kHzSupport>().enabled) { | |
199 echo_cancellation_ = new EchoCancellationImpl(this, crit_); | 198 echo_cancellation_ = new EchoCancellationImpl(this, crit_); |
200 component_list_.push_back(echo_cancellation_); | 199 component_list_.push_back(echo_cancellation_); |
201 | 200 |
202 echo_control_mobile_ = new EchoControlMobileImpl(this, crit_); | 201 echo_control_mobile_ = new EchoControlMobileImpl(this, crit_); |
203 component_list_.push_back(echo_control_mobile_); | 202 component_list_.push_back(echo_control_mobile_); |
204 | 203 |
205 gain_control_ = new GainControlImpl(this, crit_); | 204 gain_control_ = new GainControlImpl(this, crit_); |
206 component_list_.push_back(gain_control_); | 205 component_list_.push_back(gain_control_); |
207 | 206 |
208 high_pass_filter_ = new HighPassFilterImpl(this, crit_); | 207 high_pass_filter_ = new HighPassFilterImpl(this, crit_); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 return kBadNumberChannelsError; | 342 return kBadNumberChannelsError; |
344 } | 343 } |
345 | 344 |
346 fwd_in_format_.set(input_sample_rate_hz, num_input_channels); | 345 fwd_in_format_.set(input_sample_rate_hz, num_input_channels); |
347 fwd_out_format_.set(output_sample_rate_hz, num_output_channels); | 346 fwd_out_format_.set(output_sample_rate_hz, num_output_channels); |
348 rev_in_format_.set(reverse_sample_rate_hz, num_reverse_channels); | 347 rev_in_format_.set(reverse_sample_rate_hz, num_reverse_channels); |
349 | 348 |
350 // We process at the closest native rate >= min(input rate, output rate)... | 349 // We process at the closest native rate >= min(input rate, output rate)... |
351 int min_proc_rate = std::min(fwd_in_format_.rate(), fwd_out_format_.rate()); | 350 int min_proc_rate = std::min(fwd_in_format_.rate(), fwd_out_format_.rate()); |
352 int fwd_proc_rate; | 351 int fwd_proc_rate; |
353 if (supports_48kHz_ && min_proc_rate > kSampleRate32kHz) { | 352 if (min_proc_rate > kSampleRate32kHz) { |
354 fwd_proc_rate = kSampleRate48kHz; | 353 fwd_proc_rate = kSampleRate48kHz; |
355 } else if (min_proc_rate > kSampleRate16kHz) { | 354 } else if (min_proc_rate > kSampleRate16kHz) { |
356 fwd_proc_rate = kSampleRate32kHz; | 355 fwd_proc_rate = kSampleRate32kHz; |
357 } else if (min_proc_rate > kSampleRate8kHz) { | 356 } else if (min_proc_rate > kSampleRate8kHz) { |
358 fwd_proc_rate = kSampleRate16kHz; | 357 fwd_proc_rate = kSampleRate16kHz; |
359 } else { | 358 } else { |
360 fwd_proc_rate = kSampleRate8kHz; | 359 fwd_proc_rate = kSampleRate8kHz; |
361 } | 360 } |
362 // ...with one exception. | 361 // ...with one exception. |
363 if (echo_control_mobile_->is_enabled() && min_proc_rate > kSampleRate16kHz) { | 362 if (echo_control_mobile_->is_enabled() && min_proc_rate > kSampleRate16kHz) { |
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1106 int err = WriteMessageToDebugFile(); | 1105 int err = WriteMessageToDebugFile(); |
1107 if (err != kNoError) { | 1106 if (err != kNoError) { |
1108 return err; | 1107 return err; |
1109 } | 1108 } |
1110 | 1109 |
1111 return kNoError; | 1110 return kNoError; |
1112 } | 1111 } |
1113 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP | 1112 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP |
1114 | 1113 |
1115 } // namespace webrtc | 1114 } // namespace webrtc |
OLD | NEW |