Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: media/audio/audio_parameters.cc

Issue 1275783003: Add a virtual beamforming audio device on ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix more constructors and disable for now. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/audio/audio_parameters.cc
diff --git a/media/audio/audio_parameters.cc b/media/audio/audio_parameters.cc
index 872413f808379b92ad460be125340d26b7735c6a..f45aa86bb8857d7c23bacdf62edb9bef37df3ce6 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::string& 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::string& mic_positions,
int effects)
: format_(format),
channel_layout_(channel_layout),
@@ -53,8 +42,8 @@ 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) {}
void AudioParameters::Reset(Format format, ChannelLayout channel_layout,
int channels, int sample_rate,
@@ -110,13 +99,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

Powered by Google App Engine
This is Rietveld 408576698