Reinterpret AudioOption delay_agnostic_aec to override HW-AEC

This CL will change the behavior when enabling Delay Agnostic AEC through the media constraint (and AudioOption delay_agnostic_aec)

FROM
 Use DA-AEC instead of AECM if there is no HW-AEC
TO
 Use DA-AEC even if there is a HW-AEC

Before this change the user will not really know if the Delay Agnostic AEC is running or not, so it is more intuitive if the option overrides the built-in one if the user has asked for it.

BUG=4472
TESTED=locally with a modified AppRTCDemo app
R=tommi@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9147}
This commit is contained in:
Bjorn Volcker 2015-05-07 07:43:17 +02:00
parent c81591d63f
commit ccfc93913c

View File

@ -850,9 +850,10 @@ 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) {
// Built-in EC exists on this device. Enable/Disable it according to the
// echo_cancellation audio option.
if (built_in_aec && !use_delay_agnostic_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) {
// Disable internal software EC if built-in EC is enabled,