Index: webrtc/modules/audio_processing/include/audio_processing.h |
diff --git a/webrtc/modules/audio_processing/include/audio_processing.h b/webrtc/modules/audio_processing/include/audio_processing.h |
index 09e5d5be1cba9b20a8b8210c690c3c23e1dc7709..7b15b14333d39d67e11d361d32b5075bdaf01e94 100644 |
--- a/webrtc/modules/audio_processing/include/audio_processing.h |
+++ b/webrtc/modules/audio_processing/include/audio_processing.h |
@@ -44,6 +44,24 @@ class LevelEstimator; |
class NoiseSuppression; |
class VoiceDetection; |
+// The struct below constitutes the new parameter scheme for the |
+// audio processing functionality. It is being introduced gradually and |
+// until it is fully introduced, it is prone to change. |
+// |
+// The parameters and behavior of the audio processing module is speficied |
hlundin-webrtc
2016/08/30 11:26:26
speficied -> specified
hlundin-webrtc
2016/08/30 11:26:26
is -> are
peah-webrtc
2016/08/30 17:05:58
Done.
peah-webrtc
2016/08/30 17:05:58
Done.
|
+// by changing the default values in the ApmSettings struct. It is possible |
hlundin-webrtc
2016/08/30 11:26:26
The parameters and behavior are in fact specified
peah-webrtc
2016/08/30 17:05:57
Done.
|
+// to verify the specified parameters by calling the IsOk method for each |
+// substruct. The settings are applied by passing the struct to the |
hlundin-webrtc
2016/08/30 11:26:26
What happens if I call ApmSettings::IsOk()? Will i
peah-webrtc
2016/08/30 17:05:57
Yes, I added a comment about that.
|
+// ApplySettings |
hlundin-webrtc
2016/08/30 11:26:26
Line wrapping is odd.
peah-webrtc
2016/08/30 17:05:58
Done.
|
+// method in the audio processing interface. |
+struct ApmSettings { |
the sun
2016/08/30 10:32:39
name this Config and put it inside the AudioProces
hlundin-webrtc
2016/08/30 11:26:26
+1
peah-webrtc
2016/08/30 17:05:57
Done.
peah-webrtc
2016/08/30 17:05:57
Done.
|
+ struct LevelControllerSettings { |
hlundin-webrtc
2016/08/30 11:26:26
Should the substructs' configs be declared here or
peah-webrtc
2016/08/30 17:05:57
I don't think that we should allow/require audio_p
|
+ bool enabled = false; |
+ bool IsOk() const; |
+ } level_controller; |
+ bool IsOk() const; |
+}; |
+ |
// Use to enable the extended filter mode in the AEC, along with robustness |
// measures around the reported system delays. It comes with a significant |
// increase in AEC complexity, but is much more robust to unreliable reported |
@@ -91,14 +109,6 @@ struct RefinedAdaptiveFilter { |
bool enabled; |
}; |
-// Enables the adaptive level controller. |
-struct LevelControl { |
- LevelControl() : enabled(false) {} |
- explicit LevelControl(bool enabled) : enabled(enabled) {} |
- static const ConfigOptionID identifier = ConfigOptionID::kLevelControl; |
the sun
2016/08/30 10:32:39
Don't forget to remove ConfigOptionID::kLevelContr
peah-webrtc
2016/08/30 17:05:57
Can we do that? There is a comment in common.h tha
|
- bool enabled; |
-}; |
- |
// Enables delay-agnostic echo cancellation. This feature relies on internally |
// estimated delays between the process and reverse streams, thus not relying |
// on reported system delays. This configuration only applies to |
@@ -205,6 +215,11 @@ struct Intelligibility { |
// Usage example, omitting error checking: |
// AudioProcessing* apm = AudioProcessing::Create(0); |
// |
+// ApmSettings settings; |
+// settings.level_controller_settings.enable = true; |
+// RTC_DCHECK(settings.IsOk()); |
hlundin-webrtc
2016/08/30 11:26:26
The "user" should always verify the settings, not
peah-webrtc
2016/08/30 17:05:57
Good point! I edited it a bit. PTAL
the sun
2016/08/30 18:05:35
I disagree. We need to validate the config anyway,
peah-webrtc
2016/09/02 08:21:59
The argument by the other reviewer is that there a
hlundin-webrtc
2016/09/06 08:56:03
(Same comment as in later patch set, for completen
peah-webrtc
2016/09/07 05:42:59
Acknowledged.
|
+// apm->ApplySettings(settings); |
+// |
// apm->high_pass_filter()->Enable(true); |
// |
// apm->echo_cancellation()->enable_drift_compensation(false); |
@@ -268,6 +283,8 @@ class AudioProcessing { |
NonlinearBeamformer* beamformer); |
virtual ~AudioProcessing() {} |
+ virtual int ApplySettings(const ApmSettings& settings) = 0; |
the sun
2016/08/30 10:32:38
- ApplyConfig()
- Add TODO(peah) that this is temp
peah-webrtc
2016/08/30 17:05:57
Done.
|
+ |
// Initializes internal states, while retaining all user settings. This |
// should be called before beginning to process a new audio stream. However, |
// it is not necessary to call before processing the first stream after |