Niels Möller | a6fe261 | 2018-01-19 10:28:54 | [diff] [blame] | 1 | /* |
| 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 | |
Yves Gerey | 988cc08 | 2018-10-23 10:03:01 | [diff] [blame] | 14 | #include <stdint.h> |
Jonas Olsson | a4d8737 | 2019-07-05 17:08:33 | [diff] [blame] | 15 | |
Niels Möller | a6fe261 | 2018-01-19 10:28:54 | [diff] [blame] | 16 | #include <string> |
| 17 | |
Danil Chapovalov | 0bc58cf | 2018-06-21 11:32:56 | [diff] [blame] | 18 | #include "absl/types/optional.h" |
Ken MacKay | 831ce5f | 2019-12-02 18:26:34 | [diff] [blame] | 19 | #include "rtc_base/system/rtc_export.h" |
Niels Möller | a6fe261 | 2018-01-19 10:28:54 | [diff] [blame] | 20 | |
| 21 | namespace cricket { |
| 22 | |
| 23 | // Options that can be applied to a VoiceMediaChannel or a VoiceMediaEngine. |
| 24 | // Used to be flags, but that makes it hard to selectively apply options. |
| 25 | // We are moving all of the setting of options to structs like this, |
| 26 | // but some things currently still use flags. |
Ken MacKay | 831ce5f | 2019-12-02 18:26:34 | [diff] [blame] | 27 | struct RTC_EXPORT AudioOptions { |
Paulina Hensman | 11b34f4 | 2018-04-09 12:24:52 | [diff] [blame] | 28 | AudioOptions(); |
| 29 | ~AudioOptions(); |
Danil Chapovalov | 2165233 | 2018-08-31 08:29:07 | [diff] [blame] | 30 | void SetAll(const AudioOptions& change); |
Niels Möller | a6fe261 | 2018-01-19 10:28:54 | [diff] [blame] | 31 | |
Danil Chapovalov | 2165233 | 2018-08-31 08:29:07 | [diff] [blame] | 32 | bool operator==(const AudioOptions& o) const; |
Niels Möller | a6fe261 | 2018-01-19 10:28:54 | [diff] [blame] | 33 | bool operator!=(const AudioOptions& o) const { return !(*this == o); } |
| 34 | |
Danil Chapovalov | 2165233 | 2018-08-31 08:29:07 | [diff] [blame] | 35 | std::string ToString() const; |
Niels Möller | a6fe261 | 2018-01-19 10:28:54 | [diff] [blame] | 36 | |
| 37 | // Audio processing that attempts to filter away the output signal from |
| 38 | // later inbound pickup. |
Danil Chapovalov | 0bc58cf | 2018-06-21 11:32:56 | [diff] [blame] | 39 | absl::optional<bool> echo_cancellation; |
Niels Möller | a6fe261 | 2018-01-19 10:28:54 | [diff] [blame] | 40 | #if defined(WEBRTC_IOS) |
| 41 | // Forces software echo cancellation on iOS. This is a temporary workaround |
| 42 | // (until Apple fixes the bug) for a device with non-functioning AEC. May |
| 43 | // improve performance on that particular device, but will cause unpredictable |
| 44 | // behavior in all other cases. See http://bugs.webrtc.org/8682. |
Danil Chapovalov | 0bc58cf | 2018-06-21 11:32:56 | [diff] [blame] | 45 | absl::optional<bool> ios_force_software_aec_HACK; |
Niels Möller | a6fe261 | 2018-01-19 10:28:54 | [diff] [blame] | 46 | #endif |
| 47 | // Audio processing to adjust the sensitivity of the local mic dynamically. |
Danil Chapovalov | 0bc58cf | 2018-06-21 11:32:56 | [diff] [blame] | 48 | absl::optional<bool> auto_gain_control; |
Niels Möller | a6fe261 | 2018-01-19 10:28:54 | [diff] [blame] | 49 | // Audio processing to filter out background noise. |
Danil Chapovalov | 0bc58cf | 2018-06-21 11:32:56 | [diff] [blame] | 50 | absl::optional<bool> noise_suppression; |
Niels Möller | a6fe261 | 2018-01-19 10:28:54 | [diff] [blame] | 51 | // Audio processing to remove background noise of lower frequencies. |
Danil Chapovalov | 0bc58cf | 2018-06-21 11:32:56 | [diff] [blame] | 52 | absl::optional<bool> highpass_filter; |
Niels Möller | a6fe261 | 2018-01-19 10:28:54 | [diff] [blame] | 53 | // Audio processing to swap the left and right channels. |
Danil Chapovalov | 0bc58cf | 2018-06-21 11:32:56 | [diff] [blame] | 54 | absl::optional<bool> stereo_swapping; |
Niels Möller | a6fe261 | 2018-01-19 10:28:54 | [diff] [blame] | 55 | // Audio receiver jitter buffer (NetEq) max capacity in number of packets. |
Danil Chapovalov | 0bc58cf | 2018-06-21 11:32:56 | [diff] [blame] | 56 | absl::optional<int> audio_jitter_buffer_max_packets; |
Niels Möller | a6fe261 | 2018-01-19 10:28:54 | [diff] [blame] | 57 | // Audio receiver jitter buffer (NetEq) fast accelerate mode. |
Danil Chapovalov | 0bc58cf | 2018-06-21 11:32:56 | [diff] [blame] | 58 | absl::optional<bool> audio_jitter_buffer_fast_accelerate; |
Jakob Ivarsson | 10403ae | 2018-11-27 14:45:20 | [diff] [blame] | 59 | // Audio receiver jitter buffer (NetEq) minimum target delay in milliseconds. |
| 60 | absl::optional<int> audio_jitter_buffer_min_delay_ms; |
Jakob Ivarsson | 53eae87 | 2019-01-10 14:58:36 | [diff] [blame] | 61 | // Audio receiver jitter buffer (NetEq) should handle retransmitted packets. |
| 62 | absl::optional<bool> audio_jitter_buffer_enable_rtx_handling; |
Niels Möller | a6fe261 | 2018-01-19 10:28:54 | [diff] [blame] | 63 | // Audio processing to detect typing. |
Danil Chapovalov | 0bc58cf | 2018-06-21 11:32:56 | [diff] [blame] | 64 | absl::optional<bool> typing_detection; |
Danil Chapovalov | 0bc58cf | 2018-06-21 11:32:56 | [diff] [blame] | 65 | absl::optional<bool> experimental_agc; |
Danil Chapovalov | 0bc58cf | 2018-06-21 11:32:56 | [diff] [blame] | 66 | absl::optional<bool> experimental_ns; |
Niels Möller | a6fe261 | 2018-01-19 10:28:54 | [diff] [blame] | 67 | // Note that tx_agc_* only applies to non-experimental AGC. |
Danil Chapovalov | 0bc58cf | 2018-06-21 11:32:56 | [diff] [blame] | 68 | absl::optional<bool> residual_echo_detector; |
| 69 | absl::optional<uint16_t> tx_agc_target_dbov; |
| 70 | absl::optional<uint16_t> tx_agc_digital_compression_gain; |
| 71 | absl::optional<bool> tx_agc_limiter; |
Niels Möller | a6fe261 | 2018-01-19 10:28:54 | [diff] [blame] | 72 | // Enable combined audio+bandwidth BWE. |
| 73 | // TODO(pthatcher): This flag is set from the |
| 74 | // "googCombinedAudioVideoBwe", but not used anywhere. So delete it, |
| 75 | // and check if any other AudioOptions members are unused. |
Danil Chapovalov | 0bc58cf | 2018-06-21 11:32:56 | [diff] [blame] | 76 | absl::optional<bool> combined_audio_video_bwe; |
Niels Möller | a6fe261 | 2018-01-19 10:28:54 | [diff] [blame] | 77 | // Enable audio network adaptor. |
Jakob Ivarsson | 39adce1 | 2020-06-25 12:09:58 | [diff] [blame] | 78 | // TODO(webrtc:11717): Remove this API in favor of adaptivePtime in |
| 79 | // RtpEncodingParameters. |
Danil Chapovalov | 0bc58cf | 2018-06-21 11:32:56 | [diff] [blame] | 80 | absl::optional<bool> audio_network_adaptor; |
Niels Möller | a6fe261 | 2018-01-19 10:28:54 | [diff] [blame] | 81 | // Config string for audio network adaptor. |
Danil Chapovalov | 0bc58cf | 2018-06-21 11:32:56 | [diff] [blame] | 82 | absl::optional<std::string> audio_network_adaptor_config; |
Niels Möller | a6fe261 | 2018-01-19 10:28:54 | [diff] [blame] | 83 | }; |
| 84 | |
| 85 | } // namespace cricket |
| 86 | |
| 87 | #endif // API_AUDIO_OPTIONS_H_ |