Actively turns off platform-AEC when DA-AEC is used

When initiating a call default audio options are applied, which turns on platform-AEC if such exists. Then, if delay agnostic AEC (DA-AEC) is enabled through a media constraint no action with respect to platform-AEC is taken (a bug) and turning on SW AEC. Hence, we run both AECs.

This CL makes sure the platform-AEC is disabled if we want to run DA-AEC.

BUG=
TESTED=locally on Nexus 4 and Nexus 6.
R=henrika@webrtc.org, tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/52049004

Cr-Commit-Position: refs/heads/master@{#9361}
This commit is contained in:
Bjorn Volcker 2015-06-03 14:50:15 +02:00
parent 5abd3e1f98
commit 73f72105c4

View File

@ -689,12 +689,14 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) {
// TODO(henrika): investigate possibility to support built-in EC also
// in combination with Open SL ES audio.
const bool built_in_aec = voe_wrapper_->hw()->BuiltInAECIsAvailable();
if (built_in_aec && !use_delay_agnostic_aec) {
if (built_in_aec) {
// Built-in EC exists on this device and use_delay_agnostic_aec is not
// overriding it. Enable/Disable it according to the echo_cancellation
// audio option.
if (voe_wrapper_->hw()->EnableBuiltInAEC(echo_cancellation) == 0 &&
echo_cancellation) {
const bool enable_built_in_aec =
echo_cancellation && !use_delay_agnostic_aec;
if (voe_wrapper_->hw()->EnableBuiltInAEC(enable_built_in_aec) == 0 &&
enable_built_in_aec) {
// Disable internal software EC if built-in EC is enabled,
// i.e., replace the software EC with the built-in EC.
options.echo_cancellation.Set(false);