OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (c) 2016 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 WEBRTC_MODULES_AUDIO_PROCESSING_GAIN_CONTROL_FOR_NEW_AGC_H_ | |
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_GAIN_CONTROL_FOR_NEW_AGC_H_ | |
13 | |
14 #include "webrtc/base/constructormagic.h" | |
15 #include "webrtc/modules/audio_processing/agc/agc_manager_direct.h" | |
16 #include "webrtc/modules/audio_processing/gain_control_impl.h" | |
the sun
2016/02/08 09:21:39
include not needed?
peah-webrtc
2016/02/08 13:01:12
It is needed for GainControlImpl, right? Or do you
the sun
2016/02/08 14:18:11
Yes, forward declare GainControl. To me it looks l
peah-webrtc
2016/02/09 09:11:15
Done.
| |
17 #include "webrtc/modules/audio_processing/include/audio_processing.h" | |
18 | |
19 namespace webrtc { | |
20 | |
21 // This class has two main functionalities: | |
the sun
2016/02/08 09:21:39
functinoalities -> purposes
peah-webrtc
2016/02/08 13:01:12
Done.
| |
22 // | |
23 // 1) It is returned instead of the real GainControl after the new AGC has been | |
24 // enabled in order to prevent an outside user from overriding compression | |
25 // settings. It doesn't do anything in its implementation, except for | |
26 // delegating the const methods and Enable calls to the real GainControl, so | |
27 // AGC can still be disabled. | |
28 // | |
29 // 2) It is injected into AgcManagerDirect and implements volume callbacks for | |
30 // getting and setting the volume level. It just caches this value to be used | |
31 // in VoiceEngine later. | |
32 class GainControlForNewAgc : public GainControl, public VolumeCallbacks { | |
the sun
2016/02/08 09:21:39
Names with "new" and "old" in them will soon be ob
peah-webrtc
2016/02/08 13:01:12
Good point. I exchanged it with "Experimental" AGC
the sun
2016/02/08 14:18:11
Yes, thanks!
peah-webrtc
2016/02/09 09:11:15
Acknowledged.
| |
33 public: | |
34 explicit GainControlForNewAgc(GainControlImpl* gain_control); | |
35 | |
36 // GainControl implementation. | |
37 int Enable(bool enable) override; | |
38 bool is_enabled() const override; | |
39 int set_stream_analog_level(int level) override; | |
40 int stream_analog_level() override; | |
41 int set_mode(Mode mode) override; | |
42 Mode mode() const override; | |
43 int set_target_level_dbfs(int level) override; | |
44 int target_level_dbfs() const override; | |
45 int set_compression_gain_db(int gain) override; | |
46 int compression_gain_db() const override; | |
47 int enable_limiter(bool enable) override; | |
48 bool is_limiter_enabled() const override; | |
49 int set_analog_level_limits(int minimum, int maximum) override; | |
50 int analog_level_minimum() const override; | |
51 int analog_level_maximum() const override; | |
52 bool stream_is_saturated() const override; | |
53 | |
54 void SetMicVolume(int volume) override; | |
the sun
2016/02/08 09:21:39
// VolumeCallbacks implementation.
?
peah-webrtc
2016/02/08 13:01:12
Done.
| |
55 int GetMicVolume() override; | |
56 | |
57 private: | |
58 GainControl* real_gain_control_; | |
the sun
2016/02/08 09:21:39
GainControlImpl?
and you can forward declare it.
peah-webrtc
2016/02/08 13:01:12
This is a bit tricky. As it is currently implement
the sun
2016/02/08 14:18:11
Typically the reason for making a virtual method p
peah-webrtc
2016/02/09 09:11:15
Maybe I got this wrong, but the problem I see is t
the sun
2016/02/09 11:49:55
No, sorry, you got it right; I was just bad at exp
| |
59 int volume_; | |
60 | |
61 RTC_DISALLOW_COPY_AND_ASSIGN(GainControlForNewAgc); | |
62 }; | |
63 | |
64 } // namespace webrtc | |
65 | |
66 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_GAIN_CONTROL_FOR_NEW_AGC_H_ | |
OLD | NEW |