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 bbd17191585037e9fa739a1390f5013023a4ba8e..0597cd9518531c2789451933cf24488099fe5d47 100644 |
--- a/webrtc/modules/audio_processing/audio_processing_impl.h |
+++ b/webrtc/modules/audio_processing/audio_processing_impl.h |
@@ -13,6 +13,7 @@ |
#include <list> |
#include <string> |
+#include <vector> |
#include "webrtc/base/scoped_ptr.h" |
#include "webrtc/base/thread_annotations.h" |
@@ -47,42 +48,6 @@ class Event; |
} // 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); |
@@ -99,6 +64,7 @@ class AudioProcessingImpl : public AudioProcessing { |
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; |
@@ -118,11 +84,17 @@ class AudioProcessingImpl : public AudioProcessing { |
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; |
@@ -148,19 +120,9 @@ class AudioProcessingImpl : public AudioProcessing { |
virtual int InitializeLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_); |
private: |
- 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) |
+ int InitializeLocked(const ProcessingConfig& config) |
EXCLUSIVE_LOCKS_REQUIRED(crit_); |
- 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) |
+ int MaybeInitializeLocked(const ProcessingConfig& config) |
EXCLUSIVE_LOCKS_REQUIRED(crit_); |
int ProcessStreamLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_); |
int AnalyzeReverseStreamLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_); |
@@ -197,13 +159,14 @@ class AudioProcessingImpl : public AudioProcessing { |
std::string event_str_; // Memory for protobuf serialization. |
#endif |
- 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_; |
+ // 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_; |
int split_rate_; |
int stream_delay_ms_; |