Chromium Code Reviews| 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..bdc7a73cb4512c15998f0616bd140d47681eb759 100644 |
| --- a/webrtc/modules/audio_processing/include/audio_processing.h |
| +++ b/webrtc/modules/audio_processing/include/audio_processing.h |
| @@ -91,14 +91,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; |
| - 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 +197,10 @@ struct Intelligibility { |
| // Usage example, omitting error checking: |
| // AudioProcessing* apm = AudioProcessing::Create(0); |
| // |
| +// AudioProcessing::Config config; |
| +// config.level_controller.enable = true; |
| +// apm->ApplyConfig(config); |
|
the sun
2016/09/01 13:48:00
So I guess it is best if the example includes hand
peah-webrtc
2016/09/02 08:22:00
I rewrote this again after feedback from the other
the sun
2016/09/02 09:37:05
I don't see that feedback in this CL, unless you'r
peah-webrtc
2016/09/07 05:42:59
That feedback is now in the comments from Henrik.
|
| +// |
| // apm->high_pass_filter()->Enable(true); |
| // |
| // apm->echo_cancellation()->enable_drift_compensation(false); |
| @@ -244,6 +240,22 @@ struct Intelligibility { |
| // |
| class AudioProcessing { |
| public: |
| + // 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 are controlled |
| + // by changing the default values in the ApmConfig struct. The config is |
|
the sun
2016/09/01 13:48:00
ApmConfig -> AudioProcessing::Config
peah-webrtc
2016/09/02 08:22:00
Done.
|
| + // applied by passing the struct to the ApplyConfig method in the audio |
| + // processing interface. It is possible to verify the specified parameters by |
|
the sun
2016/09/01 13:48:01
"audio processing interface" is unnecessary in thi
peah-webrtc
2016/09/02 08:22:00
Done.
|
| + // calling the Validate() method. |
| + struct Config { |
| + struct LevelController { |
| + bool enabled = false; |
| + } level_controller; |
| + bool Validate() const; |
|
the sun
2016/09/01 13:48:00
Please remove this method and keep it a plain stru
peah-webrtc
2016/09/02 08:22:00
The argument by the other reviewer is that this is
the sun
2016/09/02 09:37:05
Well, sure, but we could just as well handle that
hlundin-webrtc
2016/09/06 08:56:03
We use this pattern for the AudioEncoders. Each im
peah-webrtc
2016/09/07 05:42:59
Acknowledged.
peah-webrtc
2016/09/07 05:42:59
Types would be a good step on the way, but it is e
|
| + }; |
| + |
| // TODO(mgraczyk): Remove once all methods that use ChannelLayout are gone. |
| enum ChannelLayout { |
| kMono, |
| @@ -262,9 +274,9 @@ class AudioProcessing { |
| // be one instance for every incoming stream. |
| static AudioProcessing* Create(); |
| // Allows passing in an optional configuration at create-time. |
| - static AudioProcessing* Create(const Config& config); |
| + static AudioProcessing* Create(const webrtc::Config& config); |
| // Only for testing. |
| - static AudioProcessing* Create(const Config& config, |
| + static AudioProcessing* Create(const webrtc::Config& config, |
| NonlinearBeamformer* beamformer); |
| virtual ~AudioProcessing() {} |
| @@ -300,9 +312,13 @@ class AudioProcessing { |
| ChannelLayout output_layout, |
| ChannelLayout reverse_layout) = 0; |
| + // TODO(peah): This method is a temporary solution used to take control |
| + // over the parameters in the audio processing module and is likely to change. |
| + virtual bool ApplyConfig(const Config& config) = 0; |
| + |
| // Pass down additional options which don't have explicit setters. This |
| // ensures the options are applied immediately. |
| - virtual void SetExtraOptions(const Config& config) = 0; |
| + virtual void SetExtraOptions(const webrtc::Config& config) = 0; |
| // TODO(ajm): Only intended for internal use. Make private and friend the |
| // necessary classes? |