summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2014-03-06 07:59:49 -0800
committerGlenn Kasten <gkasten@google.com>2014-03-06 08:40:49 -0800
commitf95a3c4122d67273d930c7d83c3df99f136603ed (patch)
tree3aa730e7dd0db5481ed18f4e59745a9dcb53413c
parent4d693d6b8cc1283f92f5301daf19a07abc772a2b (diff)
downloadframeworks_av-f95a3c4122d67273d930c7d83c3df99f136603ed.zip
frameworks_av-f95a3c4122d67273d930c7d83c3df99f136603ed.tar.gz
frameworks_av-f95a3c4122d67273d930c7d83c3df99f136603ed.tar.bz2
Add format parameter to Format_from_SR_C
Change-Id: I891138b7754342fe2a4f02de30ee616dbd078474
-rw-r--r--include/media/nbaio/NBAIO.h6
-rw-r--r--media/libnbaio/NBAIO.cpp3
2 files changed, 6 insertions, 3 deletions
diff --git a/include/media/nbaio/NBAIO.h b/include/media/nbaio/NBAIO.h
index be91c3a..8afacec 100644
--- a/include/media/nbaio/NBAIO.h
+++ b/include/media/nbaio/NBAIO.h
@@ -29,6 +29,7 @@
#include <utils/Errors.h>
#include <utils/RefBase.h>
#include <media/AudioTimestamp.h>
+#include <system/audio.h>
namespace android {
@@ -67,8 +68,9 @@ size_t Format_frameSize(const NBAIO_Format& format);
int Format_frameBitShift(const NBAIO_Format& format);
// Convert a sample rate in Hz and channel count to an NBAIO_Format
-// FIXME The sample format is hard-coded to AUDIO_FORMAT_PCM_16_BIT
-NBAIO_Format Format_from_SR_C(unsigned sampleRate, unsigned channelCount);
+// FIXME Remove the default value of AUDIO_FORMAT_PCM_16_BIT, and rename
+NBAIO_Format Format_from_SR_C(unsigned sampleRate, unsigned channelCount,
+ audio_format_t format = AUDIO_FORMAT_PCM_16_BIT);
// Return the sample rate in Hz of an NBAIO_Format
unsigned Format_sampleRate(const NBAIO_Format& format);
diff --git a/media/libnbaio/NBAIO.cpp b/media/libnbaio/NBAIO.cpp
index 51514de..a15d41c 100644
--- a/media/libnbaio/NBAIO.cpp
+++ b/media/libnbaio/NBAIO.cpp
@@ -98,7 +98,8 @@ unsigned Format_channelCount(const NBAIO_Format& format)
}
}
-NBAIO_Format Format_from_SR_C(unsigned sampleRate, unsigned channelCount)
+NBAIO_Format Format_from_SR_C(unsigned sampleRate, unsigned channelCount,
+ audio_format_t format_ __unused)
{
unsigned format;
switch (sampleRate) {