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 |
11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AGC_AGC_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AGC_AGC_H_ |
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AGC_AGC_H_ | 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AGC_AGC_H_ |
13 | 13 |
14 #include "webrtc/base/scoped_ptr.h" | 14 #include <memory> |
| 15 |
15 #include "webrtc/modules/audio_processing/vad/voice_activity_detector.h" | 16 #include "webrtc/modules/audio_processing/vad/voice_activity_detector.h" |
16 #include "webrtc/typedefs.h" | 17 #include "webrtc/typedefs.h" |
17 | 18 |
18 namespace webrtc { | 19 namespace webrtc { |
19 | 20 |
20 class AudioFrame; | 21 class AudioFrame; |
21 class Histogram; | 22 class Histogram; |
22 | 23 |
23 class Agc { | 24 class Agc { |
24 public: | 25 public: |
(...skipping 16 matching lines...) Expand all Loading... |
41 virtual int set_target_level_dbfs(int level); | 42 virtual int set_target_level_dbfs(int level); |
42 virtual int target_level_dbfs() const { return target_level_dbfs_; } | 43 virtual int target_level_dbfs() const { return target_level_dbfs_; } |
43 | 44 |
44 virtual float voice_probability() const { | 45 virtual float voice_probability() const { |
45 return vad_.last_voice_probability(); | 46 return vad_.last_voice_probability(); |
46 } | 47 } |
47 | 48 |
48 private: | 49 private: |
49 double target_level_loudness_; | 50 double target_level_loudness_; |
50 int target_level_dbfs_; | 51 int target_level_dbfs_; |
51 rtc::scoped_ptr<Histogram> histogram_; | 52 std::unique_ptr<Histogram> histogram_; |
52 rtc::scoped_ptr<Histogram> inactive_histogram_; | 53 std::unique_ptr<Histogram> inactive_histogram_; |
53 VoiceActivityDetector vad_; | 54 VoiceActivityDetector vad_; |
54 }; | 55 }; |
55 | 56 |
56 } // namespace webrtc | 57 } // namespace webrtc |
57 | 58 |
58 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AGC_AGC_H_ | 59 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AGC_AGC_H_ |
OLD | NEW |