blob: aecff414298cd248ee42c106f2d530e53e632551 [file] [log] [blame]
Niels Möllera6fe2612018-01-19 11:28:54 +01001/*
2 * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef API_AUDIO_OPTIONS_H_
12#define API_AUDIO_OPTIONS_H_
13
14#include <string>
15
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020016#include "absl/types/optional.h"
Niels Möllera6fe2612018-01-19 11:28:54 +010017
18namespace cricket {
19
20// Options that can be applied to a VoiceMediaChannel or a VoiceMediaEngine.
21// Used to be flags, but that makes it hard to selectively apply options.
22// We are moving all of the setting of options to structs like this,
23// but some things currently still use flags.
24struct AudioOptions {
Paulina Hensman11b34f42018-04-09 14:24:52 +020025 AudioOptions();
26 ~AudioOptions();
Danil Chapovalov21652332018-08-31 10:29:07 +020027 void SetAll(const AudioOptions& change);
Niels Möllera6fe2612018-01-19 11:28:54 +010028
Danil Chapovalov21652332018-08-31 10:29:07 +020029 bool operator==(const AudioOptions& o) const;
Niels Möllera6fe2612018-01-19 11:28:54 +010030 bool operator!=(const AudioOptions& o) const { return !(*this == o); }
31
Danil Chapovalov21652332018-08-31 10:29:07 +020032 std::string ToString() const;
Niels Möllera6fe2612018-01-19 11:28:54 +010033
34 // Audio processing that attempts to filter away the output signal from
35 // later inbound pickup.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020036 absl::optional<bool> echo_cancellation;
Niels Möllera6fe2612018-01-19 11:28:54 +010037#if defined(WEBRTC_IOS)
38 // Forces software echo cancellation on iOS. This is a temporary workaround
39 // (until Apple fixes the bug) for a device with non-functioning AEC. May
40 // improve performance on that particular device, but will cause unpredictable
41 // behavior in all other cases. See http://bugs.webrtc.org/8682.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020042 absl::optional<bool> ios_force_software_aec_HACK;
Niels Möllera6fe2612018-01-19 11:28:54 +010043#endif
44 // Audio processing to adjust the sensitivity of the local mic dynamically.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020045 absl::optional<bool> auto_gain_control;
Niels Möllera6fe2612018-01-19 11:28:54 +010046 // Audio processing to filter out background noise.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020047 absl::optional<bool> noise_suppression;
Niels Möllera6fe2612018-01-19 11:28:54 +010048 // Audio processing to remove background noise of lower frequencies.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020049 absl::optional<bool> highpass_filter;
Niels Möllera6fe2612018-01-19 11:28:54 +010050 // Audio processing to swap the left and right channels.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020051 absl::optional<bool> stereo_swapping;
Niels Möllera6fe2612018-01-19 11:28:54 +010052 // Audio receiver jitter buffer (NetEq) max capacity in number of packets.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020053 absl::optional<int> audio_jitter_buffer_max_packets;
Niels Möllera6fe2612018-01-19 11:28:54 +010054 // Audio receiver jitter buffer (NetEq) fast accelerate mode.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020055 absl::optional<bool> audio_jitter_buffer_fast_accelerate;
Niels Möllera6fe2612018-01-19 11:28:54 +010056 // Audio processing to detect typing.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020057 absl::optional<bool> typing_detection;
58 absl::optional<bool> aecm_generate_comfort_noise;
59 absl::optional<bool> experimental_agc;
60 absl::optional<bool> extended_filter_aec;
61 absl::optional<bool> delay_agnostic_aec;
62 absl::optional<bool> experimental_ns;
Niels Möllera6fe2612018-01-19 11:28:54 +010063 // Note that tx_agc_* only applies to non-experimental AGC.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020064 absl::optional<bool> residual_echo_detector;
65 absl::optional<uint16_t> tx_agc_target_dbov;
66 absl::optional<uint16_t> tx_agc_digital_compression_gain;
67 absl::optional<bool> tx_agc_limiter;
Niels Möllera6fe2612018-01-19 11:28:54 +010068 // Enable combined audio+bandwidth BWE.
69 // TODO(pthatcher): This flag is set from the
70 // "googCombinedAudioVideoBwe", but not used anywhere. So delete it,
71 // and check if any other AudioOptions members are unused.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020072 absl::optional<bool> combined_audio_video_bwe;
Niels Möllera6fe2612018-01-19 11:28:54 +010073 // Enable audio network adaptor.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020074 absl::optional<bool> audio_network_adaptor;
Niels Möllera6fe2612018-01-19 11:28:54 +010075 // Config string for audio network adaptor.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020076 absl::optional<std::string> audio_network_adaptor_config;
Niels Möllera6fe2612018-01-19 11:28:54 +010077};
78
79} // namespace cricket
80
81#endif // API_AUDIO_OPTIONS_H_