Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Unified Diff: webrtc/modules/audio_processing/agc/agc_manager_direct.h

Issue 1299143003: Remove AgcManager. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Initialize volume Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/agc/agc_manager_direct_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_processing/agc/agc_manager_direct.h
diff --git a/webrtc/modules/audio_processing/agc/agc_manager_direct.h b/webrtc/modules/audio_processing/agc/agc_manager_direct.h
index fae1248b195d0c1a586ae5090fadc6cf2b9b76ec..6edb0f7bf137b22b81e4cdcda76d4da083afaa58 100644
--- a/webrtc/modules/audio_processing/agc/agc_manager_direct.h
+++ b/webrtc/modules/audio_processing/agc/agc_manager_direct.h
@@ -21,9 +21,9 @@ class DebugFile;
class GainControl;
// Callbacks that need to be injected into AgcManagerDirect to read and control
-// the volume values. They have different behavior if they are called from
-// AgcManager or AudioProcessing. This is done to remove the VoiceEngine
-// dependency in AgcManagerDirect.
+// the volume values. This is done to remove the VoiceEngine dependency in
+// AgcManagerDirect.
+// TODO(aluebs): Remove VolumeCallbacks.
class VolumeCallbacks {
public:
virtual ~VolumeCallbacks() {}
@@ -33,11 +33,10 @@ class VolumeCallbacks {
// Direct interface to use AGC to set volume and compression values.
// AudioProcessing uses this interface directly to integrate the callback-less
-// AGC. AgcManager delegates most of its calls here. See agc_manager.h for
-// undocumented methods.
+// AGC.
//
// This class is not thread-safe.
-class AgcManagerDirect {
+class AgcManagerDirect final {
public:
// AgcManagerDirect will configure GainControl internally. The user is
// responsible for processing the audio using it after the call to Process.
@@ -60,6 +59,15 @@ class AgcManagerDirect {
size_t samples_per_channel);
void Process(const int16_t* audio, size_t length, int sample_rate_hz);
+ // Call when the capture stream has been muted/unmuted. This causes the
+ // manager to disregard all incoming audio; chances are good it's background
+ // noise to which we'd like to avoid adapting.
+ void SetCaptureMuted(bool muted);
+ bool capture_muted() { return capture_muted_; }
+
+ float voice_probability();
+
+ private:
// Sets a new microphone level, after first checking that it hasn't been
// updated by the user, in which case no action is taken.
void SetLevel(int new_level);
@@ -69,12 +77,6 @@ class AgcManagerDirect {
// |kClippedLevelMin|.
void SetMaxLevel(int level);
- void SetCaptureMuted(bool muted);
- bool capture_muted() { return capture_muted_; }
-
- float voice_probability();
-
- private:
int CheckVolumeAndReset();
void UpdateGain();
void UpdateCompressor();
@@ -97,6 +99,8 @@ class AgcManagerDirect {
rtc::scoped_ptr<DebugFile> file_preproc_;
rtc::scoped_ptr<DebugFile> file_postproc_;
+
+ RTC_DISALLOW_COPY_AND_ASSIGN(AgcManagerDirect);
};
} // namespace webrtc
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/agc/agc_manager_direct_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698