| 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 22 matching lines...) Expand all Loading... |
| 33 return 2; | 33 return 2; |
| 34 case EchoControlMobile::kSpeakerphone: | 34 case EchoControlMobile::kSpeakerphone: |
| 35 return 3; | 35 return 3; |
| 36 case EchoControlMobile::kLoudSpeakerphone: | 36 case EchoControlMobile::kLoudSpeakerphone: |
| 37 return 4; | 37 return 4; |
| 38 } | 38 } |
| 39 assert(false); | 39 assert(false); |
| 40 return -1; | 40 return -1; |
| 41 } | 41 } |
| 42 | 42 |
| 43 AudioProcessing::Error MapError(int err) { | |
| 44 switch (err) { | |
| 45 case AECM_UNSUPPORTED_FUNCTION_ERROR: | |
| 46 return AudioProcessing::kUnsupportedFunctionError; | |
| 47 case AECM_NULL_POINTER_ERROR: | |
| 48 return AudioProcessing::kNullPointerError; | |
| 49 case AECM_BAD_PARAMETER_ERROR: | |
| 50 return AudioProcessing::kBadParameterError; | |
| 51 case AECM_BAD_PARAMETER_WARNING: | |
| 52 return AudioProcessing::kBadStreamParameterWarning; | |
| 53 default: | |
| 54 // AECM_UNSPECIFIED_ERROR | |
| 55 // AECM_UNINITIALIZED_ERROR | |
| 56 return AudioProcessing::kUnspecifiedError; | |
| 57 } | |
| 58 } | |
| 59 } // namespace | 43 } // namespace |
| 60 | 44 |
| 61 size_t EchoControlMobile::echo_path_size_bytes() { | 45 size_t EchoControlMobile::echo_path_size_bytes() { |
| 62 return WebRtcAecm_echo_path_size_bytes(); | 46 return WebRtcAecm_echo_path_size_bytes(); |
| 63 } | 47 } |
| 64 | 48 |
| 65 EchoControlMobileImpl::EchoControlMobileImpl(const AudioProcessing* apm, | 49 EchoControlMobileImpl::EchoControlMobileImpl(const AudioProcessing* apm, |
| 66 CriticalSectionWrapper* crit) | 50 CriticalSectionWrapper* crit) |
| 67 : ProcessingComponent(), | 51 : ProcessingComponent(), |
| 68 apm_(apm), | 52 apm_(apm), |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 return WebRtcAecm_set_config(static_cast<Handle*>(handle), config); | 266 return WebRtcAecm_set_config(static_cast<Handle*>(handle), config); |
| 283 } | 267 } |
| 284 | 268 |
| 285 int EchoControlMobileImpl::num_handles_required() const { | 269 int EchoControlMobileImpl::num_handles_required() const { |
| 286 return apm_->num_output_channels() * | 270 return apm_->num_output_channels() * |
| 287 apm_->num_reverse_channels(); | 271 apm_->num_reverse_channels(); |
| 288 } | 272 } |
| 289 | 273 |
| 290 int EchoControlMobileImpl::GetHandleError(void* handle) const { | 274 int EchoControlMobileImpl::GetHandleError(void* handle) const { |
| 291 assert(handle != NULL); | 275 assert(handle != NULL); |
| 292 return MapError(WebRtcAecm_get_error_code(static_cast<Handle*>(handle))); | 276 return AudioProcessing::kUnspecifiedError; |
| 293 } | 277 } |
| 294 } // namespace webrtc | 278 } // namespace webrtc |
| OLD | NEW |