Move the downmixing out of AudioBuffer
This provides more flexibility if some component in AudioProcessing wants to operate before downmixing.
Now the AudioProcessing does only track the processing rate, but not the processing number of channels. This is tracked by the AudioBuffer itself and can be changed at any time to one smaller or equal the input number of channels. For each chunk it is reset to input number of channels and the end it should be equal to the output number of channels.
R=andrew@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/28169004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7879 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/audio_processing/audio_buffer.h b/webrtc/modules/audio_processing/audio_buffer.h
index 65d7cad..a526ca0 100644
--- a/webrtc/modules/audio_processing/audio_buffer.h
+++ b/webrtc/modules/audio_processing/audio_buffer.h
@@ -45,6 +45,7 @@
virtual ~AudioBuffer();
int num_channels() const;
+ void set_num_channels(int num_channels);
int samples_per_channel() const;
int samples_per_split_channel() const;
int samples_per_keyboard_channel() const;
@@ -107,11 +108,20 @@
// Called from DeinterleaveFrom() and CopyFrom().
void InitForNewData();
+ // The audio is passed into DeinterleaveFrom() or CopyFrom() with input
+ // format (samples per channel and number of channels).
const int input_samples_per_channel_;
const int num_input_channels_;
+ // The audio is stored by DeinterleaveFrom() or CopyFrom() with processing
+ // format.
const int proc_samples_per_channel_;
const int num_proc_channels_;
+ // The audio is returned by InterleaveTo() and CopyTo() with output samples
+ // per channels and the current number of channels. This last one can be
+ // changed at any time using set_num_channels().
const int output_samples_per_channel_;
+ int num_channels_;
+
int num_bands_;
int samples_per_split_channel_;
bool mixed_low_pass_valid_;