tor-browser

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

config_selector.h (1332B)


      1 /*
      2 *  Copyright (c) 2022 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 MODULES_AUDIO_PROCESSING_AEC3_CONFIG_SELECTOR_H_
     12 #define MODULES_AUDIO_PROCESSING_AEC3_CONFIG_SELECTOR_H_
     13 
     14 #include <optional>
     15 
     16 #include "api/audio/echo_canceller3_config.h"
     17 
     18 namespace webrtc {
     19 
     20 // Selects the config to use.
     21 class ConfigSelector {
     22 public:
     23  ConfigSelector(const EchoCanceller3Config& config,
     24                 const std::optional<EchoCanceller3Config>& multichannel_config,
     25                 int num_render_input_channels);
     26 
     27  // Updates the config selection based on the detection of multichannel
     28  // content.
     29  void Update(bool multichannel_content);
     30 
     31  const EchoCanceller3Config& active_config() const { return *active_config_; }
     32 
     33 private:
     34  const EchoCanceller3Config config_;
     35  const std::optional<EchoCanceller3Config> multichannel_config_;
     36  const EchoCanceller3Config* active_config_ = nullptr;
     37 };
     38 
     39 }  // namespace webrtc
     40 
     41 #endif  // MODULES_AUDIO_PROCESSING_AEC3_CONFIG_SELECTOR_H_