blob: bc5dd0391bd9aa892661f020327d6c114ea9ef10 [file] [log] [blame]
Gustaf Ullbergafef7a72020-09-24 09:21:49 +02001/*
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
19namespace webrtc {
20
21// Class for detecting and toggling the transparent mode which causes the
22// suppressor to apply less suppression.
23class TransparentMode {
24 public:
25 static std::unique_ptr<TransparentMode> Create(
26 const EchoCanceller3Config& config);
27
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,
Gustaf Ullberg7481ba02020-10-21 11:44:18 +020040 bool any_coarse_filter_converged,
Gustaf Ullbergafef7a72020-09-24 09:21:49 +020041 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_