Commit 396a9099 authored by Oskar Sundbom's avatar Oskar Sundbom Committed by Commit Bot

APM move: Add interfaces for Audio Processing in Audio Service

Adds some mojo interfaces for configuring audio processing, intended for
both WebRTC and system-level echo cancellation, though the latter will
be less configurable.

There are two parts to this change:
1. AudioProcessingSettings in media/audio, used to configure audio
   processing when done in the audio service. At one point, the similar
   AudioProcessingParameters in content will be replaced by this one.
2. AudioProcessorControls in media/webrtc; an interface used to control
   auxiliary audio processor functionality, specifically getting stats
   and starting/stopping AEC dumps.

For an outline of the project this CL is part of, see: https://docs.google.com/document/d/1u4POff_ts_1LE3WDLA_wDDFnUswdlsuHL5DsiTE0a3U/edit?usp=sharing
It's accessible to everyone @chromium.org.

Bug: 851959
Tbr: tommi@webrtc.org
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I0c8c934b35b93aa728a0d1b60ae76063e925ee6c
Reviewed-on: https://chromium-review.googlesource.com/1167848
Commit-Queue: Tommi <tommi@chromium.org>
Reviewed-by: default avatarTommi <tommi@chromium.org>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583239}
parent ade2b1fa
...@@ -25,6 +25,7 @@ include_rules = [ ...@@ -25,6 +25,7 @@ include_rules = [
"+third_party/widevine/cdm/widevine_cdm_common.h", "+third_party/widevine/cdm/widevine_cdm_common.h",
"-ipc", "-ipc",
"-media/blink", "-media/blink",
"-media/webrtc",
] ]
specific_include_rules = { specific_include_rules = {
......
...@@ -123,6 +123,7 @@ source_set("audio") { ...@@ -123,6 +123,7 @@ source_set("audio") {
"audio_output_stream_sink.h", "audio_output_stream_sink.h",
"audio_power_monitor.cc", "audio_power_monitor.cc",
"audio_power_monitor.h", "audio_power_monitor.h",
"audio_processing.h",
"audio_source_diverter.h", "audio_source_diverter.h",
"audio_sync_reader.cc", "audio_sync_reader.cc",
"audio_sync_reader.h", "audio_sync_reader.h",
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MEDIA_AUDIO_AUDIO_PROCESSING_H_
#define MEDIA_AUDIO_AUDIO_PROCESSING_H_
#include "base/files/file.h"
#include "base/time/time.h"
#include "base/unguessable_token.h"
#include "media/base/media_export.h"
namespace media {
enum class AutomaticGainControlType { kDisabled, kDefault, kExperimental };
enum class EchoCancellationType { kDisabled, kAec2, kAec3, kSystemAec };
enum class NoiseSuppressionType { kDisabled, kDefault, kExperimental };
struct MEDIA_EXPORT AudioProcessingSettings {
EchoCancellationType echo_cancellation = EchoCancellationType::kDisabled;
NoiseSuppressionType noise_suppression = NoiseSuppressionType::kDisabled;
AutomaticGainControlType automatic_gain_control =
AutomaticGainControlType::kDisabled;
bool high_pass_filter = false;
bool typing_detection = false;
bool stereo_mirroring = false;
bool operator==(const AudioProcessingSettings& b) const {
return echo_cancellation == b.echo_cancellation &&
noise_suppression == b.noise_suppression &&
automatic_gain_control == b.automatic_gain_control &&
high_pass_filter == b.high_pass_filter &&
typing_detection == b.typing_detection &&
stereo_mirroring == b.stereo_mirroring;
}
};
} // namespace media
#endif // MEDIA_AUDIO_AUDIO_PROCESSING_H_
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//media/media_options.gni")
import("//third_party/webrtc/webrtc.gni")
source_set("webrtc") {
sources = [
"audio_processor_controls.h",
]
deps = [
"//base",
"//media",
"//third_party/webrtc/api:libjingle_peerconnection_api",
"//third_party/webrtc/modules/audio_processing",
"//third_party/webrtc/modules/audio_processing:audio_processing_statistics",
"//third_party/webrtc_overrides:init_webrtc",
]
}
include_rules = [
"+third_party/webrtc/api",
"+third_party/webrtc/modules/audio_processing",
]
olka@chromium.org
maxmorin@chromium.org
dalecurtis@chromium.org
miu@chromium.org
ossu@chromium.org
# COMPONENT: Blink>WebRTC>Audio
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MEDIA_WEBRTC_AUDIO_PROCESSOR_CONTROLS_H_
#define MEDIA_WEBRTC_AUDIO_PROCESSOR_CONTROLS_H_
#include "base/callback.h"
#include "third_party/webrtc/api/mediastreaminterface.h"
namespace media {
class MEDIA_EXPORT AudioProcessorControls {
public:
using GetStatsCB = base::OnceCallback<void(
const webrtc::AudioProcessorInterface::AudioProcessorStatistics& stats)>;
// Request the latest stats from the audio processor. Stats are returned
// asynchronously through |callback|.
virtual void GetStats(GetStatsCB callback) = 0;
// Begin dumping echo cancellation data into |file|.
virtual void StartEchoCancellationDump(base::File file) = 0;
// Stop any ongoin dump of echo cancellation data.
virtual void StopEchoCancellationDump() = 0;
protected:
virtual ~AudioProcessorControls() = default;
};
} // namespace media
#endif // MEDIA_WEBRTC_AUDIO_PROCESSOR_CONTROLS_H_
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