webrtc_m130/api/audio_options.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

91 lines
3.7 KiB
C
Raw Normal View History

/*
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef API_AUDIO_OPTIONS_H_
#define API_AUDIO_OPTIONS_H_
#include <stdint.h>
#include <string>
#include "absl/types/optional.h"
#include "rtc_base/system/rtc_export.h"
namespace cricket {
// Options that can be applied to a VoiceMediaChannel or a VoiceMediaEngine.
// Used to be flags, but that makes it hard to selectively apply options.
// We are moving all of the setting of options to structs like this,
// but some things currently still use flags.
struct RTC_EXPORT AudioOptions {
AudioOptions();
~AudioOptions();
void SetAll(const AudioOptions& change);
bool operator==(const AudioOptions& o) const;
bool operator!=(const AudioOptions& o) const { return !(*this == o); }
std::string ToString() const;
// Audio processing that attempts to filter away the output signal from
// later inbound pickup.
absl::optional<bool> echo_cancellation;
#if defined(WEBRTC_IOS)
// Forces software echo cancellation on iOS. This is a temporary workaround
// (until Apple fixes the bug) for a device with non-functioning AEC. May
// improve performance on that particular device, but will cause unpredictable
// behavior in all other cases. See http://bugs.webrtc.org/8682.
absl::optional<bool> ios_force_software_aec_HACK;
#endif
// Audio processing to adjust the sensitivity of the local mic dynamically.
absl::optional<bool> auto_gain_control;
// Audio processing to filter out background noise.
absl::optional<bool> noise_suppression;
// Audio processing to remove background noise of lower frequencies.
absl::optional<bool> highpass_filter;
// Audio processing to swap the left and right channels.
absl::optional<bool> stereo_swapping;
// Audio receiver jitter buffer (NetEq) max capacity in number of packets.
absl::optional<int> audio_jitter_buffer_max_packets;
// Audio receiver jitter buffer (NetEq) fast accelerate mode.
absl::optional<bool> audio_jitter_buffer_fast_accelerate;
// Audio receiver jitter buffer (NetEq) minimum target delay in milliseconds.
absl::optional<int> audio_jitter_buffer_min_delay_ms;
// Audio receiver jitter buffer (NetEq) should handle retransmitted packets.
absl::optional<bool> audio_jitter_buffer_enable_rtx_handling;
Reland "Reland "Remove unused APM voice activity detection sub-module"" This reverts commit 09aaf6f7bcfb4da644bd86c76896a04a41f776e1. Reason for revert: downstream fixed (see https://chromium-review.googlesource.com/c/chromium/src/+/3461371) Original change's description: > Revert "Reland "Remove unused APM voice activity detection sub-module"" > > This reverts commit 54d1344d985b00d4d1580dd18057d4618c11ad1f. > > Reason for revert: Breaks chromium roll, see > https://ci.chromium.org/ui/p/chromium/builders/try/linux_chromium_tsan_rel_ng/1080583/overview > > https://chromium-review.googlesource.com/c/chromium/src/+/3461512 > > Original change's description: > > Reland "Remove unused APM voice activity detection sub-module" > > > > This reverts commit a751f167c68343f76528436defdbc61600a8d7b3. > > > > Reason for revert: dependency in a downstream project removed > > > > Original change's description: > > > Revert "Remove unused APM voice activity detection sub-module" > > > > > > This reverts commit b4e06d032e6f82a65c52ed0c5364ae9e7c0a0215. > > > > > > Reason for revert: breaking downstream projects > > > > > > Original change's description: > > > > Remove unused APM voice activity detection sub-module > > > > > > > > API changes: > > > > - webrtc::AudioProcessing::Config::VoiceDetection removed > > > > - webrtc::AudioProcessingStats::voice_detected deprecated > > > > - cricket::AudioOptions::typing_detection deprecated > > > > - webrtc::StatsReport::StatsValueName:: > > > > kStatsValueNameTypingNoiseState deprecated > > > > > > > > PSA: https://groups.google.com/g/discuss-webrtc/c/7X6uwmJarE0 > > > > > > > > Bug: webrtc:11226,webrtc:11292 > > > > Change-Id: I8d008b56708cf62961b9857ec052b59fda3b41bf > > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250666 > > > > Reviewed-by: Harald Alvestrand <hta@webrtc.org> > > > > Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org> > > > > Reviewed-by: Sam Zackrisson <saza@webrtc.org> > > > > Reviewed-by: Björn Terelius <terelius@webrtc.org> > > > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > > > > Cr-Commit-Position: refs/heads/main@{#35975} > > > > > > TBR=gustaf@webrtc.org,saza@webrtc.org,alessiob@webrtc.org,terelius@webrtc.org,hta@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com > > > > > > Change-Id: Iee01fdb874b4e0331277f3ffe60dacaabc3859a2 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: webrtc:11226,webrtc:11292 > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251600 > > > Reviewed-by: Harald Alvestrand <hta@webrtc.org> > > > Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org> > > > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > > > Cr-Commit-Position: refs/heads/main@{#35977} > > > > # Not skipping CQ checks because this is a reland. > > > > Bug: webrtc:11226,webrtc:11292 > > Change-Id: I2fcbc5fdade16bfe6a0f0a02841a33a598d4f2ad > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251660 > > Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> > > Reviewed-by: Harald Alvestrand <hta@webrtc.org> > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#35984} > > TBR=mbonadei@webrtc.org,gustaf@webrtc.org,saza@webrtc.org,alessiob@webrtc.org,terelius@webrtc.org,hta@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com > > Change-Id: Ib308a3af2dcce85a0074ef5a4680ccec3f82712f > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:11226,webrtc:11292 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251688 > Reviewed-by: Henrik Boström <hbos@webrtc.org> > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> > Auto-Submit: Henrik Boström <hbos@webrtc.org> > Reviewed-by: Harald Alvestrand <hta@webrtc.org> > Commit-Queue: Harald Alvestrand <hta@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#35990} # Not skipping CQ checks because original CL landed > 1 day ago. Bug: webrtc:11226,webrtc:11292 Change-Id: Idfda6a517027ad323caf44c526a88468e5b52b65 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251762 Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Reviewed-by: Sam Zackrisson <saza@webrtc.org> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> Cr-Commit-Position: refs/heads/main@{#36012}
2022-02-15 14:18:09 +00:00
// Deprecated.
// TODO(bugs.webrtc.org/11226): Remove.
// Audio processing to detect typing.
absl::optional<bool> typing_detection;
APM: Make echo detector an optionally compilable and injectable component Important: This change does not in any way affect echo cancellation or standardized stats. The user audio experience is unchanged. Only non-standard stats are affected. Echo return loss metrics are unchanged. Residual echo likelihood {recent max} will no longer be computed by default. Important: The echo detector is no longer enabled by default. API change, PSA: https://groups.google.com/g/discuss-webrtc/c/mJV5cDysBDI/m/7PTPBjVHCgAJ This CL removes the default usage of the residual echo detector in APM. It can now only be used via injection and the helper function webrtc::CreateEchoDetector. See how the function audio_processing_unittest.cc:CreateApm() changed, for an example. The echo detector implementation is marked poisonous, to avoid accidental dependencies. Some cleanup is done: - EchoDetector::PackRenderAudioBuffer is declared in one target but is defined in another target. It is not necessary to keep in the API. It is made an implementation detail, and the echo detector input is documented in the API. - The internal state of APM is large and difficult to track. Submodule pointers that are set permanently on construction are now appropriately marked const. Tested: - existing + new unit tests - audioproc_f is bitexact on a large number of aecdumps Bug: webrtc:11539 Change-Id: I00cc2ee112fedb06451a533409311605220064d0 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239652 Reviewed-by: Ivo Creusen <ivoc@webrtc.org> Reviewed-by: Per Kjellander <perkj@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Sam Zackrisson <saza@webrtc.org> Cr-Commit-Position: refs/heads/main@{#35550}
2021-12-06 15:40:04 +01:00
// TODO(bugs.webrtc.org/11539): Deprecated, replaced by
// webrtc::CreateEchoDetector() and injection when creating the audio
// processing module.
absl::optional<bool> residual_echo_detector;
// Enable combined audio+bandwidth BWE.
// TODO(pthatcher): This flag is set from the
// "googCombinedAudioVideoBwe", but not used anywhere. So delete it,
// and check if any other AudioOptions members are unused.
absl::optional<bool> combined_audio_video_bwe;
// Enable audio network adaptor.
// TODO(webrtc:11717): Remove this API in favor of adaptivePtime in
// RtpEncodingParameters.
absl::optional<bool> audio_network_adaptor;
// Config string for audio network adaptor.
absl::optional<std::string> audio_network_adaptor_config;
// Pre-initialize the ADM for recording when starting to send. Default to
// true.
// TODO(webrtc:13566): Remove this option. See issue for details.
absl::optional<bool> init_recording_on_send;
};
} // namespace cricket
#endif // API_AUDIO_OPTIONS_H_