| Index: webrtc/modules/audio_processing/audio_processing_impl.h
|
| diff --git a/webrtc/modules/audio_processing/audio_processing_impl.h b/webrtc/modules/audio_processing/audio_processing_impl.h
|
| index 0597cd9518531c2789451933cf24488099fe5d47..bbd17191585037e9fa739a1390f5013023a4ba8e 100644
|
| --- a/webrtc/modules/audio_processing/audio_processing_impl.h
|
| +++ b/webrtc/modules/audio_processing/audio_processing_impl.h
|
| @@ -13,7 +13,6 @@
|
|
|
| #include <list>
|
| #include <string>
|
| -#include <vector>
|
|
|
| #include "webrtc/base/scoped_ptr.h"
|
| #include "webrtc/base/thread_annotations.h"
|
| @@ -48,6 +47,42 @@
|
| } // namespace audioproc
|
| #endif
|
|
|
| +class AudioRate {
|
| + public:
|
| + explicit AudioRate(int sample_rate_hz) { set(sample_rate_hz); }
|
| + virtual ~AudioRate() {}
|
| +
|
| + void set(int rate) {
|
| + rate_ = rate;
|
| + samples_per_channel_ = AudioProcessing::kChunkSizeMs * rate_ / 1000;
|
| + }
|
| +
|
| + int rate() const { return rate_; }
|
| + int samples_per_channel() const { return samples_per_channel_; }
|
| +
|
| + private:
|
| + int rate_;
|
| + int samples_per_channel_;
|
| +};
|
| +
|
| +class AudioFormat : public AudioRate {
|
| + public:
|
| + AudioFormat(int sample_rate_hz, int num_channels)
|
| + : AudioRate(sample_rate_hz),
|
| + num_channels_(num_channels) {}
|
| + virtual ~AudioFormat() {}
|
| +
|
| + void set(int rate, int num_channels) {
|
| + AudioRate::set(rate);
|
| + num_channels_ = num_channels;
|
| + }
|
| +
|
| + int num_channels() const { return num_channels_; }
|
| +
|
| + private:
|
| + int num_channels_;
|
| +};
|
| +
|
| class AudioProcessingImpl : public AudioProcessing {
|
| public:
|
| explicit AudioProcessingImpl(const Config& config);
|
| @@ -64,7 +99,6 @@
|
| ChannelLayout input_layout,
|
| ChannelLayout output_layout,
|
| ChannelLayout reverse_layout) override;
|
| - int Initialize(const ProcessingConfig& processing_config) override;
|
| void SetExtraOptions(const Config& config) override;
|
| int set_sample_rate_hz(int rate) override;
|
| int input_sample_rate_hz() const override;
|
| @@ -84,17 +118,11 @@
|
| int output_sample_rate_hz,
|
| ChannelLayout output_layout,
|
| float* const* dest) override;
|
| - int ProcessStream(const float* const* src,
|
| - const StreamConfig& input_config,
|
| - const StreamConfig& output_config,
|
| - float* const* dest) override;
|
| int AnalyzeReverseStream(AudioFrame* frame) override;
|
| int AnalyzeReverseStream(const float* const* data,
|
| int samples_per_channel,
|
| int sample_rate_hz,
|
| ChannelLayout layout) override;
|
| - int AnalyzeReverseStream(const float* const* data,
|
| - const StreamConfig& reverse_config) override;
|
| int set_stream_delay_ms(int delay) override;
|
| int stream_delay_ms() const override;
|
| bool was_stream_delay_set() const override;
|
| @@ -120,9 +148,19 @@
|
| virtual int InitializeLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_);
|
|
|
| private:
|
| - int InitializeLocked(const ProcessingConfig& config)
|
| + int InitializeLocked(int input_sample_rate_hz,
|
| + int output_sample_rate_hz,
|
| + int reverse_sample_rate_hz,
|
| + int num_input_channels,
|
| + int num_output_channels,
|
| + int num_reverse_channels)
|
| EXCLUSIVE_LOCKS_REQUIRED(crit_);
|
| - int MaybeInitializeLocked(const ProcessingConfig& config)
|
| + int MaybeInitializeLocked(int input_sample_rate_hz,
|
| + int output_sample_rate_hz,
|
| + int reverse_sample_rate_hz,
|
| + int num_input_channels,
|
| + int num_output_channels,
|
| + int num_reverse_channels)
|
| EXCLUSIVE_LOCKS_REQUIRED(crit_);
|
| int ProcessStreamLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_);
|
| int AnalyzeReverseStreamLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_);
|
| @@ -159,14 +197,13 @@
|
| std::string event_str_; // Memory for protobuf serialization.
|
| #endif
|
|
|
| - // Format of processing streams at input/output call sites.
|
| - ProcessingConfig api_format_;
|
| -
|
| - // Only the rate and samples fields of fwd_proc_format_ are used because the
|
| - // forward processing number of channels is mutable and is tracked by the
|
| - // capture_audio_.
|
| - StreamConfig fwd_proc_format_;
|
| - StreamConfig rev_proc_format_;
|
| + AudioFormat fwd_in_format_;
|
| + // This one is an AudioRate, because the forward processing number of channels
|
| + // is mutable and is tracked by the capture_audio_.
|
| + AudioRate fwd_proc_format_;
|
| + AudioFormat fwd_out_format_;
|
| + AudioFormat rev_in_format_;
|
| + AudioFormat rev_proc_format_;
|
| int split_rate_;
|
|
|
| int stream_delay_ms_;
|
|
|