| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 |
| 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AGC_AGC_MANAGER_DIRECT_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AGC_AGC_MANAGER_DIRECT_H_ |
| 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AGC_AGC_MANAGER_DIRECT_H_ | 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AGC_AGC_MANAGER_DIRECT_H_ |
| 13 | 13 |
| 14 #include "webrtc/base/scoped_ptr.h" | 14 #include <memory> |
| 15 |
| 16 #include "webrtc/base/constructormagic.h" |
| 15 #include "webrtc/modules/audio_processing/agc/agc.h" | 17 #include "webrtc/modules/audio_processing/agc/agc.h" |
| 16 | 18 |
| 17 namespace webrtc { | 19 namespace webrtc { |
| 18 | 20 |
| 19 class AudioFrame; | 21 class AudioFrame; |
| 20 class DebugFile; | 22 class DebugFile; |
| 21 class GainControl; | 23 class GainControl; |
| 22 | 24 |
| 23 // Callbacks that need to be injected into AgcManagerDirect to read and control | 25 // Callbacks that need to be injected into AgcManagerDirect to read and control |
| 24 // the volume values. This is done to remove the VoiceEngine dependency in | 26 // the volume values. This is done to remove the VoiceEngine dependency in |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 76 |
| 75 // Set the maximum level the AGC is allowed to apply. Also updates the | 77 // Set the maximum level the AGC is allowed to apply. Also updates the |
| 76 // maximum compression gain to compensate. The level must be at least | 78 // maximum compression gain to compensate. The level must be at least |
| 77 // |kClippedLevelMin|. | 79 // |kClippedLevelMin|. |
| 78 void SetMaxLevel(int level); | 80 void SetMaxLevel(int level); |
| 79 | 81 |
| 80 int CheckVolumeAndReset(); | 82 int CheckVolumeAndReset(); |
| 81 void UpdateGain(); | 83 void UpdateGain(); |
| 82 void UpdateCompressor(); | 84 void UpdateCompressor(); |
| 83 | 85 |
| 84 rtc::scoped_ptr<Agc> agc_; | 86 std::unique_ptr<Agc> agc_; |
| 85 GainControl* gctrl_; | 87 GainControl* gctrl_; |
| 86 VolumeCallbacks* volume_callbacks_; | 88 VolumeCallbacks* volume_callbacks_; |
| 87 | 89 |
| 88 int frames_since_clipped_; | 90 int frames_since_clipped_; |
| 89 int level_; | 91 int level_; |
| 90 int max_level_; | 92 int max_level_; |
| 91 int max_compression_gain_; | 93 int max_compression_gain_; |
| 92 int target_compression_; | 94 int target_compression_; |
| 93 int compression_; | 95 int compression_; |
| 94 float compression_accumulator_; | 96 float compression_accumulator_; |
| 95 bool capture_muted_; | 97 bool capture_muted_; |
| 96 bool check_volume_on_next_process_; | 98 bool check_volume_on_next_process_; |
| 97 bool startup_; | 99 bool startup_; |
| 98 int startup_min_level_; | 100 int startup_min_level_; |
| 99 | 101 |
| 100 rtc::scoped_ptr<DebugFile> file_preproc_; | 102 std::unique_ptr<DebugFile> file_preproc_; |
| 101 rtc::scoped_ptr<DebugFile> file_postproc_; | 103 std::unique_ptr<DebugFile> file_postproc_; |
| 102 | 104 |
| 103 RTC_DISALLOW_COPY_AND_ASSIGN(AgcManagerDirect); | 105 RTC_DISALLOW_COPY_AND_ASSIGN(AgcManagerDirect); |
| 104 }; | 106 }; |
| 105 | 107 |
| 106 } // namespace webrtc | 108 } // namespace webrtc |
| 107 | 109 |
| 108 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AGC_AGC_MANAGER_DIRECT_H_ | 110 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AGC_AGC_MANAGER_DIRECT_H_ |
| OLD | NEW |