summaryrefslogtreecommitdiffstats
path: root/media/libmedia/AudioRecord.cpp
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-07-02 12:42:44 -0700
committerGlenn Kasten <gkasten@google.com>2012-07-03 10:24:45 -0700
commitdd8104cc5367262f0e5f13df4e79f131e8d560bb (patch)
tree46c95f24576ec352d7d5d363606db9a46a44e9c3 /media/libmedia/AudioRecord.cpp
parentf1da96d8cf60842538e00a9c950cc451f7da2c10 (diff)
downloadframeworks_av-dd8104cc5367262f0e5f13df4e79f131e8d560bb.zip
frameworks_av-dd8104cc5367262f0e5f13df4e79f131e8d560bb.tar.gz
frameworks_av-dd8104cc5367262f0e5f13df4e79f131e8d560bb.tar.bz2
Use audio_channel_mask_t more consistently
In IAudioFlinger::createTrack() and IAudioFlinger::openRecord(), declare input parameter to use correct type audio_channel_mask_t. In IAudioFlinger::getInputBufferSize(), input parameter is now channel mask instead of channel count. Remove unused IAudioFlinger::channelCount(audio_io_handle_t). In AudioRecord::getMinFrameCount() and AudioSystem::getInputBufferSize(), input parameter is channel mask instead of channel count. Change-Id: Ib2f1c29bea70f016b3cfce83942ba292190ac965
Diffstat (limited to 'media/libmedia/AudioRecord.cpp')
-rw-r--r--media/libmedia/AudioRecord.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp
index 0f17bbd..f8813c9 100644
--- a/media/libmedia/AudioRecord.cpp
+++ b/media/libmedia/AudioRecord.cpp
@@ -39,18 +39,18 @@ status_t AudioRecord::getMinFrameCount(
int* frameCount,
uint32_t sampleRate,
audio_format_t format,
- int channelCount)
+ audio_channel_mask_t channelMask)
{
size_t size = 0;
- if (AudioSystem::getInputBufferSize(sampleRate, format, channelCount, &size)
+ if (AudioSystem::getInputBufferSize(sampleRate, format, channelMask, &size)
!= NO_ERROR) {
ALOGE("AudioSystem could not query the input buffer size.");
return NO_INIT;
}
if (size == 0) {
- ALOGE("Unsupported configuration: sampleRate %d, format %d, channelCount %d",
- sampleRate, format, channelCount);
+ ALOGE("Unsupported configuration: sampleRate %d, format %d, channelMask %#x",
+ sampleRate, format, channelMask);
return BAD_VALUE;
}
@@ -58,6 +58,7 @@ status_t AudioRecord::getMinFrameCount(
size <<= 1;
if (audio_is_linear_pcm(format)) {
+ int channelCount = popcount(channelMask);
size /= channelCount * audio_bytes_per_sample(format);
}