Chromium Code Reviews| Index: media/audio/audio_parameters.cc |
| diff --git a/media/audio/audio_parameters.cc b/media/audio/audio_parameters.cc |
| index 872413f808379b92ad460be125340d26b7735c6a..5aff588d529959a3f6faae7203d5d02a07010b19 100644 |
| --- a/media/audio/audio_parameters.cc |
| +++ b/media/audio/audio_parameters.cc |
| @@ -10,42 +10,31 @@ |
| namespace media { |
| AudioParameters::AudioParameters() |
| - : format_(AUDIO_PCM_LINEAR), |
| - channel_layout_(CHANNEL_LAYOUT_NONE), |
| - sample_rate_(0), |
| - bits_per_sample_(0), |
| - frames_per_buffer_(0), |
| - channels_(0), |
| - effects_(NO_EFFECTS) { |
| -} |
| - |
| -AudioParameters::AudioParameters(Format format, ChannelLayout channel_layout, |
| - int sample_rate, int bits_per_sample, |
| - int frames_per_buffer) |
| - : format_(format), |
| - channel_layout_(channel_layout), |
| - sample_rate_(sample_rate), |
| - bits_per_sample_(bits_per_sample), |
| - frames_per_buffer_(frames_per_buffer), |
| - channels_(ChannelLayoutToChannelCount(channel_layout)), |
| - effects_(NO_EFFECTS) { |
| -} |
| - |
| -AudioParameters::AudioParameters(Format format, ChannelLayout channel_layout, |
| - int sample_rate, int bits_per_sample, |
| - int frames_per_buffer, int effects) |
| - : format_(format), |
| - channel_layout_(channel_layout), |
| - sample_rate_(sample_rate), |
| - bits_per_sample_(bits_per_sample), |
| - frames_per_buffer_(frames_per_buffer), |
| - channels_(ChannelLayoutToChannelCount(channel_layout)), |
| - effects_(effects) { |
| -} |
| - |
| -AudioParameters::AudioParameters(Format format, ChannelLayout channel_layout, |
| - int channels, int sample_rate, |
| - int bits_per_sample, int frames_per_buffer, |
| + : AudioParameters(AUDIO_PCM_LINEAR, CHANNEL_LAYOUT_NONE, 0, 0, 0) {} |
| + |
| +AudioParameters::AudioParameters(Format format, |
| + ChannelLayout channel_layout, |
| + int sample_rate, |
| + int bits_per_sample, |
| + int frames_per_buffer, |
| + const std::vector<Point>& mic_positions, |
| + int effects) |
| + : AudioParameters(format, |
| + ChannelLayoutToChannelCount(channel_layout), |
| + channel_layout, |
| + sample_rate, |
| + bits_per_sample, |
| + frames_per_buffer, |
| + mic_positions, |
| + effects) {} |
| + |
| +AudioParameters::AudioParameters(Format format, |
| + int channels, |
| + ChannelLayout channel_layout, |
| + int sample_rate, |
| + int bits_per_sample, |
| + int frames_per_buffer, |
| + const std::vector<Point>& mic_positions, |
| int effects) |
| : format_(format), |
| channel_layout_(channel_layout), |
| @@ -53,8 +42,10 @@ AudioParameters::AudioParameters(Format format, ChannelLayout channel_layout, |
| bits_per_sample_(bits_per_sample), |
| frames_per_buffer_(frames_per_buffer), |
| channels_(channels), |
| - effects_(effects) { |
| -} |
| + mic_positions_(mic_positions), |
| + effects_(effects) {} |
| + |
| +AudioParameters::~AudioParameters() {} |
| void AudioParameters::Reset(Format format, ChannelLayout channel_layout, |
| int channels, int sample_rate, |
| @@ -65,6 +56,8 @@ void AudioParameters::Reset(Format format, ChannelLayout channel_layout, |
| sample_rate_ = sample_rate; |
| bits_per_sample_ = bits_per_sample; |
| frames_per_buffer_ = frames_per_buffer; |
| + mic_positions_.clear(); |
| + effects_ = NO_EFFECTS; |
|
tommi (sloooow) - chröme
2015/09/02 07:43:07
I wonder if this will have a side effect. Can you
|
| } |
| bool AudioParameters::IsValid() const { |
| @@ -110,13 +103,12 @@ base::TimeDelta AudioParameters::GetBufferDuration() const { |
| } |
| bool AudioParameters::Equals(const AudioParameters& other) const { |
| - return format_ == other.format() && |
| - sample_rate_ == other.sample_rate() && |
| + return format_ == other.format() && sample_rate_ == other.sample_rate() && |
| channel_layout_ == other.channel_layout() && |
| channels_ == other.channels() && |
| bits_per_sample_ == other.bits_per_sample() && |
| frames_per_buffer_ == other.frames_per_buffer() && |
| - effects_ == other.effects(); |
| + mic_positions_ == other.mic_positions_ && effects_ == other.effects(); |
| } |
| } // namespace media |