audio_options.h 3.6 KB

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