xref: /aosp_15_r20/external/webrtc/modules/audio_processing/aec3/transparent_mode.h (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1 /*
2  *  Copyright (c) 2020 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_TRANSPARENT_MODE_H_
12 #define MODULES_AUDIO_PROCESSING_AEC3_TRANSPARENT_MODE_H_
13 
14 #include <memory>
15 
16 #include "api/audio/echo_canceller3_config.h"
17 #include "modules/audio_processing/aec3/aec3_common.h"
18 
19 namespace webrtc {
20 
21 // Class for detecting and toggling the transparent mode which causes the
22 // suppressor to apply less suppression.
23 class TransparentMode {
24  public:
25   static std::unique_ptr<TransparentMode> Create(
26       const EchoCanceller3Config& config);
27 
~TransparentMode()28   virtual ~TransparentMode() {}
29 
30   // Returns whether the transparent mode should be active.
31   virtual bool Active() const = 0;
32 
33   // Resets the state of the detector.
34   virtual void Reset() = 0;
35 
36   // Updates the detection decision based on new data.
37   virtual void Update(int filter_delay_blocks,
38                       bool any_filter_consistent,
39                       bool any_filter_converged,
40                       bool any_coarse_filter_converged,
41                       bool all_filters_diverged,
42                       bool active_render,
43                       bool saturated_capture) = 0;
44 };
45 
46 }  // namespace webrtc
47 #endif  // MODULES_AUDIO_PROCESSING_AEC3_TRANSPARENT_MODE_H_
48