Debian Codegraph @

Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/gain_controller2.h

raw symbols SCIP
1 /*
2 * Copyright (c) 2017 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_GAIN_CONTROLLER2_H_
12 #define MODULES_AUDIO_PROCESSING_GAIN_CONTROLLER2_H_
13
14 #include <memory>
15 #include <string>
16
17 #include "modules/audio_processing/agc2/adaptive_agc.h"
18 #include "modules/audio_processing/agc2/gain_applier.h"
19 #include "modules/audio_processing/agc2/limiter.h"
20 #include "modules/audio_processing/include/audio_processing.h"
21 #include "modules/audio_processing/logging/apm_data_dumper.h"
22 #include "rtc_base/constructor_magic.h"
23
24 namespace webrtc {
25
26 class AudioBuffer;
27
28 // Gain Controller 2 aims to automatically adjust levels by acting on the
29 // microphone gain and/or applying digital gain.
30 class GainController2 {
31 public:
32 GainController2();
33 GainController2(const GainController2&) = delete;
34 GainController2& operator=(const GainController2&) = delete;
35 ~GainController2();
36
37 void Initialize(int sample_rate_hz);
38 void Process(AudioBuffer* audio);
39 void NotifyAnalogLevel(int level);
40
41 void ApplyConfig(const AudioProcessing::Config::GainController2& config);
42 static bool Validate(const AudioProcessing::Config::GainController2& config);
43
44 private:
45 static int instance_count_;
46 ApmDataDumper data_dumper_;
47 AudioProcessing::Config::GainController2 config_;
48 GainApplier gain_applier_;
49 std::unique_ptr<AdaptiveAgc> adaptive_agc_;
50 Limiter limiter_;
51 int calls_since_last_limiter_log_;
52 int analog_level_ = -1;
53 };
54
55 } // namespace webrtc
56
57 #endif // MODULES_AUDIO_PROCESSING_GAIN_CONTROLLER2_H_