Chromium Code Reviews| 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 d12acf30d377b0c7344cc2c1106d8fcf8993dff9..fadab36b4096a51878c85919f7121b841509a6e8 100644 |
| --- a/webrtc/modules/audio_processing/agc/agc_manager_direct.h |
| +++ b/webrtc/modules/audio_processing/agc/agc_manager_direct.h |
| @@ -21,9 +21,8 @@ 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. |
| class VolumeCallbacks { |
|
Andrew MacDonald
2015/08/19 17:58:39
Not for this CL, but do we need to use this callba
aluebs-webrtc
2015/09/28 22:51:08
Added TODO. But how would you imagine it to work?
Andrew MacDonald
2015/09/29 05:33:34
Instead of triggering a callback on volume change,
aluebs-webrtc
2015/09/29 18:10:39
And let the APM update the volume in the GainContr
Andrew MacDonald
2015/09/29 18:17:11
These callbacks don't get delivered to voice engin
aluebs-webrtc
2015/09/29 19:10:34
Ok, I think I get your point but we can discuss wh
|
| public: |
| virtual ~VolumeCallbacks() {} |
| @@ -33,8 +32,7 @@ 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 { |
|
Andrew MacDonald
2015/08/19 17:58:39
final, and DISALLOW_COPY_AND_ASSIGN
aluebs-webrtc
2015/09/28 22:51:08
Done.
|
| @@ -60,6 +58,15 @@ class AgcManagerDirect { |
| int samples_per_channel); |
| void Process(const int16_t* audio, int 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 +76,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(); |