tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

echo_canceller3_factory.h (2288B)


      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_ECHO_CANCELLER3_FACTORY_H_
     12 #define API_AUDIO_ECHO_CANCELLER3_FACTORY_H_
     13 
     14 #include <memory>
     15 #include <optional>
     16 
     17 #include "absl/base/nullability.h"
     18 #include "api/audio/echo_canceller3_config.h"
     19 #include "api/audio/echo_control.h"
     20 #include "api/audio/neural_residual_echo_estimator.h"
     21 #include "api/environment/environment.h"
     22 #include "rtc_base/system/rtc_export.h"
     23 
     24 namespace webrtc {
     25 
     26 class RTC_EXPORT EchoCanceller3Factory : public EchoControlFactory {
     27 public:
     28  // Factory producing EchoCanceller3 instances with the default configuration.
     29  EchoCanceller3Factory();
     30 
     31  // Factory producing EchoCanceller3 instances with the specified
     32  // configuration.
     33  explicit EchoCanceller3Factory(const EchoCanceller3Config& config);
     34 
     35  // Factory producing EchoCanceller3 instances with the specified
     36  // configuration and multichannel configuration.
     37  EchoCanceller3Factory(
     38      const EchoCanceller3Config& config,
     39      std::optional<EchoCanceller3Config> multichannel_config);
     40 
     41  // Creates an EchoCanceller3 with a specified channel count and sampling rate.
     42  absl_nonnull std::unique_ptr<EchoControl> Create(
     43      const Environment& env,
     44      int sample_rate_hz,
     45      int num_render_channels,
     46      int num_capture_channels) override;
     47 
     48  // Creates an EchoCanceller3 with a specified channel count and sampling rate.
     49  // If provided, `neural_residual_echo_estimator` is used to estimate the
     50  // residual echo.
     51  absl_nonnull std::unique_ptr<EchoControl> Create(
     52      const Environment& env,
     53      int sample_rate_hz,
     54      int num_render_channels,
     55      int num_capture_channels,
     56      NeuralResidualEchoEstimator* neural_residual_echo_estimator) override;
     57 
     58 private:
     59  const EchoCanceller3Config config_;
     60  const std::optional<EchoCanceller3Config> multichannel_config_;
     61 };
     62 }  // namespace webrtc
     63 
     64 #endif  // API_AUDIO_ECHO_CANCELLER3_FACTORY_H_