Commit 03333c5c authored by Hsin-Yu Chao's avatar Hsin-Yu Chao Committed by Commit Bot

Set system AEC supported to true for Chrome OS

Web app selecting echo canceller type to system AEC is behind an
experimental origin trial. Removing the flag report from Chrome
OS system, so it's easier to control testing for this feature.

Bug: 880708
Change-Id: I10f981d2bd27e04a372d12644eae2903521c7ea1
Reviewed-on: https://chromium-review.googlesource.com/1248063
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: default avatarJenny Zhang <jennyz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595745}
parent 01403578
......@@ -910,7 +910,6 @@ void CrasAudioHandler::InitializeAudioAfterCrasServiceAvailable(
cras_service_available_ = true;
GetDefaultOutputBufferSizeInternal();
GetSystemAecSupported();
GetNodes();
GetNumberOfOutputStreams();
}
......@@ -1676,28 +1675,4 @@ void CrasAudioHandler::HandleGetDefaultOutputBufferSize(
default_output_buffer_size_ = buffer_size.value();
}
bool CrasAudioHandler::system_aec_supported() const {
DCHECK(main_task_runner_->BelongsToCurrentThread());
return system_aec_supported_;
}
// GetSystemAecSupported() is only called in the same thread
// as the CrasAudioHanler constructor. We are safe here without
// thread check, because unittest may not have the task runner
// for the current thread.
void CrasAudioHandler::GetSystemAecSupported() {
GetCrasAudioClient()->GetSystemAecSupported(
base::BindOnce(&CrasAudioHandler::HandleGetSystemAecSupported,
weak_ptr_factory_.GetWeakPtr()));
}
void CrasAudioHandler::HandleGetSystemAecSupported(
base::Optional<bool> system_aec_supported) {
if (!system_aec_supported.has_value()) {
LOG(ERROR) << "Failed to retrieve system aec supported";
return;
}
system_aec_supported_ = system_aec_supported.value();
}
} // namespace chromeos
......@@ -274,8 +274,10 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
// the use case. It should be called from a user initiated action.
void SwitchToFrontOrRearMic();
// Returns if system AEC is supported in CRAS.
bool system_aec_supported() const;
// All Chrome OS boards support this feature. Web applications will need
// to opt into original trial to use experimental native echo cancellation.
// Check crbug.com/853196 for usage.
bool system_aec_supported() const { return true; };
protected:
explicit CrasAudioHandler(
......@@ -478,15 +480,6 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
// Handle dbus callback for GetDefaultOutputBufferSize.
void HandleGetDefaultOutputBufferSize(base::Optional<int> buffer_size);
// Calling dbus to get system AEC supported flag.
void GetSystemAecSupported();
// Calling dbus to get system AEC supported flag on main thread.
void GetSystemAecSupportedOnMainThread();
// Handle dbus callback for GetSystemAecSupported.
void HandleGetSystemAecSupported(base::Optional<bool> system_aec_supported);
void OnVideoCaptureStartedOnMainThread(media::VideoFacingMode facing);
void OnVideoCaptureStoppedOnMainThread(media::VideoFacingMode facing);
......@@ -533,8 +526,6 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
// Default output buffer size in frames.
int32_t default_output_buffer_size_;
bool system_aec_supported_ = false;
int num_active_output_streams_ = 0;
// Task runner of browser main thread. All member variables should be accessed
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment