Index: webrtc/modules/audio_processing/gain_control_for_new_agc.cc |
diff --git a/webrtc/modules/audio_processing/gain_control_for_new_agc.cc b/webrtc/modules/audio_processing/gain_control_for_new_agc.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6502bcdf62af9bab848d640151a66446255be84f |
--- /dev/null |
+++ b/webrtc/modules/audio_processing/gain_control_for_new_agc.cc |
@@ -0,0 +1,93 @@ |
+/* |
+ * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
+ * |
+ * Use of this source code is governed by a BSD-style license |
+ * that can be found in the LICENSE file in the root of the source |
+ * tree. An additional intellectual property rights grant can be found |
+ * in the file PATENTS. All contributing project authors may |
+ * be found in the AUTHORS file in the root of the source tree. |
+ */ |
+ |
+#include "webrtc/modules/audio_processing/gain_control_for_new_agc.h" |
+#include "webrtc/modules/audio_processing/gain_control_impl.h" |
+#include "webrtc/modules/audio_processing/include/audio_processing.h" |
+ |
+namespace webrtc { |
+ |
+GainControlForNewAgc::GainControlForNewAgc(GainControlImpl* gain_control) |
the sun
2016/02/08 09:21:39
Do we have any threading issues here at all?
peah-webrtc
2016/02/08 13:01:12
The way it is currently used, threading and lock i
the sun
2016/02/08 14:18:11
Maybe it's a minor thing, but the volume_ field is
peah-webrtc
2016/02/09 09:11:15
I think you are right. I added a thread checker. T
|
+ : real_gain_control_(gain_control), volume_(0) {} |
+ |
+int GainControlForNewAgc::Enable(bool enable) { |
+ return real_gain_control_->Enable(enable); |
+} |
+ |
+bool GainControlForNewAgc::is_enabled() const { |
+ return real_gain_control_->is_enabled(); |
+} |
+ |
+int GainControlForNewAgc::set_stream_analog_level(int level) { |
+ volume_ = level; |
+ return AudioProcessing::kNoError; |
+} |
+ |
+int GainControlForNewAgc::stream_analog_level() { |
+ return volume_; |
+} |
+ |
+int GainControlForNewAgc::set_mode(Mode mode) { |
+ return AudioProcessing::kNoError; |
+} |
+ |
+GainControl::Mode GainControlForNewAgc::mode() const { |
+ return GainControl::kAdaptiveAnalog; |
+} |
+ |
+int GainControlForNewAgc::set_target_level_dbfs(int level) { |
+ return AudioProcessing::kNoError; |
+} |
+ |
+int GainControlForNewAgc::target_level_dbfs() const { |
+ return real_gain_control_->target_level_dbfs(); |
+} |
+ |
+int GainControlForNewAgc::set_compression_gain_db(int gain) { |
+ return AudioProcessing::kNoError; |
+} |
+ |
+int GainControlForNewAgc::compression_gain_db() const { |
+ return real_gain_control_->compression_gain_db(); |
+} |
+ |
+int GainControlForNewAgc::enable_limiter(bool enable) { |
+ return AudioProcessing::kNoError; |
+} |
+ |
+bool GainControlForNewAgc::is_limiter_enabled() const { |
+ return real_gain_control_->is_limiter_enabled(); |
+} |
+ |
+int GainControlForNewAgc::set_analog_level_limits(int minimum, int maximum) { |
+ return AudioProcessing::kNoError; |
+} |
+ |
+int GainControlForNewAgc::analog_level_minimum() const { |
+ return real_gain_control_->analog_level_minimum(); |
+} |
+ |
+int GainControlForNewAgc::analog_level_maximum() const { |
+ return real_gain_control_->analog_level_maximum(); |
+} |
+ |
+bool GainControlForNewAgc::stream_is_saturated() const { |
+ return real_gain_control_->stream_is_saturated(); |
+} |
+ |
+void GainControlForNewAgc::SetMicVolume(int volume) { |
+ volume_ = volume; |
+} |
+ |
+int GainControlForNewAgc::GetMicVolume() { |
+ return volume_; |
+} |
+ |
+} // namespace webrtc |