summaryrefslogtreecommitdiffstats
path: root/media/audio/mac/audio_input_mac.cc
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-31 23:18:48 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-31 23:18:48 +0000
commit2f6d086da79c737bc2a0ee3023ca80c608c75d19 (patch)
tree6943204cb1c9c7d7cbe722f91a64a1c326601fef /media/audio/mac/audio_input_mac.cc
parent87949cc2b85979964ca9de9483ba1ba2758e0b81 (diff)
downloadchromium_src-2f6d086da79c737bc2a0ee3023ca80c608c75d19.zip
chromium_src-2f6d086da79c737bc2a0ee3023ca80c608c75d19.tar.gz
chromium_src-2f6d086da79c737bc2a0ee3023ca80c608c75d19.tar.bz2
Add AudioParameters struct. Use it everywhere.
BUG=None TEST=unittests Review URL: http://codereview.chromium.org/3226012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58097 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio/mac/audio_input_mac.cc')
-rw-r--r--media/audio/mac/audio_input_mac.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/media/audio/mac/audio_input_mac.cc b/media/audio/mac/audio_input_mac.cc
index 2202484..9705cb30 100644
--- a/media/audio/mac/audio_input_mac.cc
+++ b/media/audio/mac/audio_input_mac.cc
@@ -18,9 +18,7 @@ enum {
PCMQueueInAudioInputStream::PCMQueueInAudioInputStream(
AudioManagerMac* manager,
- int channels,
- int sampling_rate,
- char bits_per_sample,
+ AudioParameters params,
uint32 samples_per_buffer)
: manager_(manager),
callback_(NULL),
@@ -31,14 +29,14 @@ PCMQueueInAudioInputStream::PCMQueueInAudioInputStream(
// A frame is one sample across all channels. In interleaved audio the per
// frame fields identify the set of n |channels|. In uncompressed audio, a
// packet is always one frame.
- format_.mSampleRate = sampling_rate;
+ format_.mSampleRate = params.sample_rate;
format_.mFormatID = kAudioFormatLinearPCM;
format_.mFormatFlags = kLinearPCMFormatFlagIsPacked |
kLinearPCMFormatFlagIsSignedInteger;
- format_.mBitsPerChannel = bits_per_sample;
- format_.mChannelsPerFrame = channels;
+ format_.mBitsPerChannel = params.bits_per_sample;
+ format_.mChannelsPerFrame = params.channels;
format_.mFramesPerPacket = 1;
- format_.mBytesPerPacket = (bits_per_sample * channels) / 8;
+ format_.mBytesPerPacket = (params.bits_per_sample * params.channels) / 8;
format_.mBytesPerFrame = format_.mBytesPerPacket;
buffer_size_bytes_ = format_.mBytesPerFrame * samples_per_buffer;