echo_canceller3_config_json.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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_ECHO_CANCELLER3_CONFIG_JSON_H_
  11. #define API_AUDIO_ECHO_CANCELLER3_CONFIG_JSON_H_
  12. #include <string>
  13. #include "absl/strings/string_view.h"
  14. #include "api/audio/echo_canceller3_config.h"
  15. #include "rtc_base/system/rtc_export.h"
  16. namespace webrtc {
  17. // Parses a JSON-encoded string into an Aec3 config. Fields corresponds to
  18. // substruct names, with the addition that there must be a top-level node
  19. // "aec3". Produces default config values for anything that cannot be parsed
  20. // from the string. If any error was found in the parsing, parsing_successful is
  21. // set to false.
  22. RTC_EXPORT void Aec3ConfigFromJsonString(absl::string_view json_string,
  23. EchoCanceller3Config* config,
  24. bool* parsing_successful);
  25. // To be deprecated.
  26. // Parses a JSON-encoded string into an Aec3 config. Fields corresponds to
  27. // substruct names, with the addition that there must be a top-level node
  28. // "aec3". Returns default config values for anything that cannot be parsed from
  29. // the string.
  30. RTC_EXPORT EchoCanceller3Config
  31. Aec3ConfigFromJsonString(absl::string_view json_string);
  32. // Encodes an Aec3 config in JSON format. Fields corresponds to substruct names,
  33. // with the addition that the top-level node is named "aec3".
  34. RTC_EXPORT std::string Aec3ConfigToJsonString(
  35. const EchoCanceller3Config& config);
  36. } // namespace webrtc
  37. #endif // API_AUDIO_ECHO_CANCELLER3_CONFIG_JSON_H_