OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 int ProcessCaptureAudio(AudioBuffer* audio, bool stream_has_echo); | 36 int ProcessCaptureAudio(AudioBuffer* audio, bool stream_has_echo); |
37 | 37 |
38 void Initialize(size_t num_proc_channels, int sample_rate_hz); | 38 void Initialize(size_t num_proc_channels, int sample_rate_hz); |
39 | 39 |
40 // GainControl implementation. | 40 // GainControl implementation. |
41 bool is_enabled() const override; | 41 bool is_enabled() const override; |
42 int stream_analog_level() override; | 42 int stream_analog_level() override; |
43 bool is_limiter_enabled() const override; | 43 bool is_limiter_enabled() const override; |
44 Mode mode() const override; | 44 Mode mode() const override; |
45 | 45 |
| 46 // Checks whether the module is enabled. Must only be |
| 47 // called from the render side of APM as otherwise |
| 48 // deadlocks may occur. |
| 49 bool is_enabled_render_side_query() const; |
| 50 |
46 // Reads render side data that has been queued on the render call. | 51 // Reads render side data that has been queued on the render call. |
47 void ReadQueuedRenderData(); | 52 void ReadQueuedRenderData(); |
48 | 53 |
49 private: | 54 private: |
50 class GainController; | 55 class GainController; |
51 | 56 |
52 // GainControl implementation. | 57 // GainControl implementation. |
53 int Enable(bool enable) override; | 58 int Enable(bool enable) override; |
54 int set_stream_analog_level(int level) override; | 59 int set_stream_analog_level(int level) override; |
55 int set_mode(Mode mode) override; | 60 int set_mode(Mode mode) override; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 std::vector<std::unique_ptr<GainController>> gain_controllers_; | 99 std::vector<std::unique_ptr<GainController>> gain_controllers_; |
95 | 100 |
96 rtc::Optional<size_t> num_proc_channels_ GUARDED_BY(crit_capture_); | 101 rtc::Optional<size_t> num_proc_channels_ GUARDED_BY(crit_capture_); |
97 rtc::Optional<int> sample_rate_hz_ GUARDED_BY(crit_capture_); | 102 rtc::Optional<int> sample_rate_hz_ GUARDED_BY(crit_capture_); |
98 | 103 |
99 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(GainControlImpl); | 104 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(GainControlImpl); |
100 }; | 105 }; |
101 } // namespace webrtc | 106 } // namespace webrtc |
102 | 107 |
103 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_GAIN_CONTROL_IMPL_H_ | 108 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_GAIN_CONTROL_IMPL_H_ |
OLD | NEW |