blob: 39ba3886ea229394ce00410133bce775abd34914 [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
Yves Gerey988cc082018-10-23 12:03:01 +020014#include <stdint.h>
Jonas Olssona4d87372019-07-05 19:08:33 +020015
Niels Möllera6fe2612018-01-19 11:28:54 +010016#include <string>
17
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020018#include "absl/types/optional.h"
Ken MacKay831ce5f2019-12-02 10:26:34 -080019#include "rtc_base/system/rtc_export.h"
Niels Möllera6fe2612018-01-19 11:28:54 +010020
21namespace 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 MacKay831ce5f2019-12-02 10:26:34 -080027struct RTC_EXPORT AudioOptions {
Paulina Hensman11b34f42018-04-09 14:24:52 +020028 AudioOptions();
29 ~AudioOptions();
Danil Chapovalov21652332018-08-31 10:29:07 +020030 void SetAll(const AudioOptions& change);
Niels Möllera6fe2612018-01-19 11:28:54 +010031
Danil Chapovalov21652332018-08-31 10:29:07 +020032 bool operator==(const AudioOptions& o) const;
Niels Möllera6fe2612018-01-19 11:28:54 +010033 bool operator!=(const AudioOptions& o) const { return !(*this == o); }
34
Danil Chapovalov21652332018-08-31 10:29:07 +020035 std::string ToString() const;
Niels Möllera6fe2612018-01-19 11:28:54 +010036
37 // Audio processing that attempts to filter away the output signal from
38 // later inbound pickup.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020039 absl::optional<bool> echo_cancellation;
Niels Möllera6fe2612018-01-19 11:28:54 +010040#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 Chapovalov0bc58cf2018-06-21 13:32:56 +020045 absl::optional<bool> ios_force_software_aec_HACK;
Niels Möllera6fe2612018-01-19 11:28:54 +010046#endif
47 // Audio processing to adjust the sensitivity of the local mic dynamically.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020048 absl::optional<bool> auto_gain_control;
Niels Möllera6fe2612018-01-19 11:28:54 +010049 // Audio processing to filter out background noise.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020050 absl::optional<bool> noise_suppression;
Niels Möllera6fe2612018-01-19 11:28:54 +010051 // Audio processing to remove background noise of lower frequencies.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020052 absl::optional<bool> highpass_filter;
Niels Möllera6fe2612018-01-19 11:28:54 +010053 // Audio processing to swap the left and right channels.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020054 absl::optional<bool> stereo_swapping;
Niels Möllera6fe2612018-01-19 11:28:54 +010055 // Audio receiver jitter buffer (NetEq) max capacity in number of packets.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020056 absl::optional<int> audio_jitter_buffer_max_packets;
Niels Möllera6fe2612018-01-19 11:28:54 +010057 // Audio receiver jitter buffer (NetEq) fast accelerate mode.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020058 absl::optional<bool> audio_jitter_buffer_fast_accelerate;
Jakob Ivarsson10403ae2018-11-27 15:45:20 +010059 // Audio receiver jitter buffer (NetEq) minimum target delay in milliseconds.
60 absl::optional<int> audio_jitter_buffer_min_delay_ms;
Niels Möllera6fe2612018-01-19 11:28:54 +010061 // Enable combined audio+bandwidth BWE.
62 // TODO(pthatcher): This flag is set from the
63 // "googCombinedAudioVideoBwe", but not used anywhere. So delete it,
64 // and check if any other AudioOptions members are unused.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020065 absl::optional<bool> combined_audio_video_bwe;
Niels Möllera6fe2612018-01-19 11:28:54 +010066 // Enable audio network adaptor.
Jakob Ivarsson39adce12020-06-25 14:09:58 +020067 // TODO(webrtc:11717): Remove this API in favor of adaptivePtime in
68 // RtpEncodingParameters.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020069 absl::optional<bool> audio_network_adaptor;
Niels Möllera6fe2612018-01-19 11:28:54 +010070 // Config string for audio network adaptor.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020071 absl::optional<std::string> audio_network_adaptor_config;
Xavier Lepaul1e12f2a2022-01-13 17:06:26 +010072 // Pre-initialize the ADM for recording when starting to send. Default to
73 // true.
74 // TODO(webrtc:13566): Remove this option. See issue for details.
75 absl::optional<bool> init_recording_on_send;
Niels Möllera6fe2612018-01-19 11:28:54 +010076};
77
78} // namespace cricket
79
80#endif // API_AUDIO_OPTIONS_H_