summaryrefslogtreecommitdiffstats
path: root/media/libmedia/AudioSystem.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/AudioSystem.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/AudioSystem.cpp')
-rw-r--r--media/libmedia/AudioSystem.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp
index 7c29c87..9c270c8 100644
--- a/media/libmedia/AudioSystem.cpp
+++ b/media/libmedia/AudioSystem.cpp
@@ -41,7 +41,7 @@ DefaultKeyedVector<audio_io_handle_t, AudioSystem::OutputDescriptor *> AudioSyst
// Cached values for recording queries, all protected by gLock
uint32_t AudioSystem::gPrevInSamplingRate = 16000;
audio_format_t AudioSystem::gPrevInFormat = AUDIO_FORMAT_PCM_16_BIT;
-int AudioSystem::gPrevInChannelCount = 1;
+audio_channel_mask_t AudioSystem::gPrevInChannelMask = AUDIO_CHANNEL_IN_MONO;
size_t AudioSystem::gInBuffSize = 0;
@@ -334,25 +334,25 @@ status_t AudioSystem::getLatency(audio_io_handle_t output,
return NO_ERROR;
}
-status_t AudioSystem::getInputBufferSize(uint32_t sampleRate, audio_format_t format, int channelCount,
- size_t* buffSize)
+status_t AudioSystem::getInputBufferSize(uint32_t sampleRate, audio_format_t format,
+ audio_channel_mask_t channelMask, size_t* buffSize)
{
gLock.lock();
// Do we have a stale gInBufferSize or are we requesting the input buffer size for new values
size_t inBuffSize = gInBuffSize;
if ((inBuffSize == 0) || (sampleRate != gPrevInSamplingRate) || (format != gPrevInFormat)
- || (channelCount != gPrevInChannelCount)) {
+ || (channelMask != gPrevInChannelMask)) {
gLock.unlock();
const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger();
if (af == 0) {
return PERMISSION_DENIED;
}
- inBuffSize = af->getInputBufferSize(sampleRate, format, channelCount);
+ inBuffSize = af->getInputBufferSize(sampleRate, format, channelMask);
gLock.lock();
// save the request params
gPrevInSamplingRate = sampleRate;
gPrevInFormat = format;
- gPrevInChannelCount = channelCount;
+ gPrevInChannelMask = channelMask;
gInBuffSize = inBuffSize;
}