| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 // is not blacklisted. | 453 // is not blacklisted. |
| 454 bool BuiltInAECIsAvailable() const override { | 454 bool BuiltInAECIsAvailable() const override { |
| 455 return audio_manager_->IsAcousticEchoCancelerSupported(); | 455 return audio_manager_->IsAcousticEchoCancelerSupported(); |
| 456 } | 456 } |
| 457 | 457 |
| 458 int32_t EnableBuiltInAEC(bool enable) override { | 458 int32_t EnableBuiltInAEC(bool enable) override { |
| 459 RTC_CHECK(BuiltInAECIsAvailable()) << "HW AEC is not available"; | 459 RTC_CHECK(BuiltInAECIsAvailable()) << "HW AEC is not available"; |
| 460 return input_.EnableBuiltInAEC(enable); | 460 return input_.EnableBuiltInAEC(enable); |
| 461 } | 461 } |
| 462 | 462 |
| 463 // Returns true if the device both supports built in AGC and the device |
| 464 // is not blacklisted. |
| 465 bool BuiltInAGCIsAvailable() const override { |
| 466 return audio_manager_->IsAutomaticGainControlSupported(); |
| 467 } |
| 468 |
| 469 int32_t EnableBuiltInAGC(bool enable) override { |
| 470 RTC_CHECK(BuiltInAGCIsAvailable()) << "HW AGC is not available"; |
| 471 return input_.EnableBuiltInAGC(enable); |
| 472 } |
| 473 |
| 474 // Returns true if the device both supports built in NS and the device |
| 475 // is not blacklisted. |
| 476 bool BuiltInNSIsAvailable() const override { |
| 477 return audio_manager_->IsNoiseSuppressorSupported(); |
| 478 } |
| 479 |
| 480 int32_t EnableBuiltInNS(bool enable) override { |
| 481 RTC_CHECK(BuiltInNSIsAvailable()) << "HW NS is not available"; |
| 482 return input_.EnableBuiltInNS(enable); |
| 483 } |
| 484 |
| 463 private: | 485 private: |
| 464 rtc::ThreadChecker thread_checker_; | 486 rtc::ThreadChecker thread_checker_; |
| 465 | 487 |
| 466 // Local copy of the audio layer set during construction of the | 488 // Local copy of the audio layer set during construction of the |
| 467 // AudioDeviceModuleImpl instance. Read only value. | 489 // AudioDeviceModuleImpl instance. Read only value. |
| 468 const AudioDeviceModule::AudioLayer audio_layer_; | 490 const AudioDeviceModule::AudioLayer audio_layer_; |
| 469 | 491 |
| 470 // Non-owning raw pointer to AudioManager instance given to use at | 492 // Non-owning raw pointer to AudioManager instance given to use at |
| 471 // construction. The real object is owned by AudioDeviceModuleImpl and the | 493 // construction. The real object is owned by AudioDeviceModuleImpl and the |
| 472 // life time is the same as that of the AudioDeviceModuleImpl, hence there | 494 // life time is the same as that of the AudioDeviceModuleImpl, hence there |
| 473 // is no risk of reading a NULL pointer at any time in this class. | 495 // is no risk of reading a NULL pointer at any time in this class. |
| 474 AudioManager* const audio_manager_; | 496 AudioManager* const audio_manager_; |
| 475 | 497 |
| 476 OutputType output_; | 498 OutputType output_; |
| 477 | 499 |
| 478 InputType input_; | 500 InputType input_; |
| 479 | 501 |
| 480 bool initialized_; | 502 bool initialized_; |
| 481 }; | 503 }; |
| 482 | 504 |
| 483 } // namespace webrtc | 505 } // namespace webrtc |
| 484 | 506 |
| 485 #endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_AUDIO_DEVICE_TEMPLATE_H_ | 507 #endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_AUDIO_DEVICE_TEMPLATE_H_ |
| OLD | NEW |