blob: 478bff60408eeea4d1ae878aeb6a9e8530846047 [file] [log] [blame]
Niels Möllera6fe2612018-01-19 10:28:541/*
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 10:03:0114#include <stdint.h>
Niels Möllera6fe2612018-01-19 10:28:5415#include <string>
16
Danil Chapovalov0bc58cf2018-06-21 11:32:5617#include "absl/types/optional.h"
Niels Möllera6fe2612018-01-19 10:28:5418
19namespace cricket {
20
21// Options that can be applied to a VoiceMediaChannel or a VoiceMediaEngine.
22// Used to be flags, but that makes it hard to selectively apply options.
23// We are moving all of the setting of options to structs like this,
24// but some things currently still use flags.
25struct AudioOptions {
Paulina Hensman11b34f42018-04-09 12:24:5226 AudioOptions();
27 ~AudioOptions();
Danil Chapovalov21652332018-08-31 08:29:0728 void SetAll(const AudioOptions& change);
Niels Möllera6fe2612018-01-19 10:28:5429
Danil Chapovalov21652332018-08-31 08:29:0730 bool operator==(const AudioOptions& o) const;
Niels Möllera6fe2612018-01-19 10:28:5431 bool operator!=(const AudioOptions& o) const { return !(*this == o); }
32
Danil Chapovalov21652332018-08-31 08:29:0733 std::string ToString() const;
Niels Möllera6fe2612018-01-19 10:28:5434
35 // Audio processing that attempts to filter away the output signal from
36 // later inbound pickup.
Danil Chapovalov0bc58cf2018-06-21 11:32:5637 absl::optional<bool> echo_cancellation;
Niels Möllera6fe2612018-01-19 10:28:5438#if defined(WEBRTC_IOS)
39 // Forces software echo cancellation on iOS. This is a temporary workaround
40 // (until Apple fixes the bug) for a device with non-functioning AEC. May
41 // improve performance on that particular device, but will cause unpredictable
42 // behavior in all other cases. See http://bugs.webrtc.org/8682.
Danil Chapovalov0bc58cf2018-06-21 11:32:5643 absl::optional<bool> ios_force_software_aec_HACK;
Niels Möllera6fe2612018-01-19 10:28:5444#endif
45 // Audio processing to adjust the sensitivity of the local mic dynamically.
Danil Chapovalov0bc58cf2018-06-21 11:32:5646 absl::optional<bool> auto_gain_control;
Niels Möllera6fe2612018-01-19 10:28:5447 // Audio processing to filter out background noise.
Danil Chapovalov0bc58cf2018-06-21 11:32:5648 absl::optional<bool> noise_suppression;
Niels Möllera6fe2612018-01-19 10:28:5449 // Audio processing to remove background noise of lower frequencies.
Danil Chapovalov0bc58cf2018-06-21 11:32:5650 absl::optional<bool> highpass_filter;
Niels Möllera6fe2612018-01-19 10:28:5451 // Audio processing to swap the left and right channels.
Danil Chapovalov0bc58cf2018-06-21 11:32:5652 absl::optional<bool> stereo_swapping;
Niels Möllera6fe2612018-01-19 10:28:5453 // Audio receiver jitter buffer (NetEq) max capacity in number of packets.
Danil Chapovalov0bc58cf2018-06-21 11:32:5654 absl::optional<int> audio_jitter_buffer_max_packets;
Niels Möllera6fe2612018-01-19 10:28:5455 // Audio receiver jitter buffer (NetEq) fast accelerate mode.
Danil Chapovalov0bc58cf2018-06-21 11:32:5656 absl::optional<bool> audio_jitter_buffer_fast_accelerate;
Jakob Ivarsson10403ae2018-11-27 14:45:2057 // Audio receiver jitter buffer (NetEq) minimum target delay in milliseconds.
58 absl::optional<int> audio_jitter_buffer_min_delay_ms;
Jakob Ivarsson53eae872019-01-10 14:58:3659 // Audio receiver jitter buffer (NetEq) should handle retransmitted packets.
60 absl::optional<bool> audio_jitter_buffer_enable_rtx_handling;
Niels Möllera6fe2612018-01-19 10:28:5461 // Audio processing to detect typing.
Danil Chapovalov0bc58cf2018-06-21 11:32:5662 absl::optional<bool> typing_detection;
Danil Chapovalov0bc58cf2018-06-21 11:32:5663 absl::optional<bool> experimental_agc;
64 absl::optional<bool> extended_filter_aec;
65 absl::optional<bool> delay_agnostic_aec;
66 absl::optional<bool> experimental_ns;
Niels Möllera6fe2612018-01-19 10:28:5467 // Note that tx_agc_* only applies to non-experimental AGC.
Danil Chapovalov0bc58cf2018-06-21 11:32:5668 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öllera6fe2612018-01-19 10:28:5472 // 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 Chapovalov0bc58cf2018-06-21 11:32:5676 absl::optional<bool> combined_audio_video_bwe;
Niels Möllera6fe2612018-01-19 10:28:5477 // Enable audio network adaptor.
Danil Chapovalov0bc58cf2018-06-21 11:32:5678 absl::optional<bool> audio_network_adaptor;
Niels Möllera6fe2612018-01-19 10:28:5479 // Config string for audio network adaptor.
Danil Chapovalov0bc58cf2018-06-21 11:32:5680 absl::optional<std::string> audio_network_adaptor_config;
Niels Möllera6fe2612018-01-19 10:28:5481};
82
83} // namespace cricket
84
85#endif // API_AUDIO_OPTIONS_H_