summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2014-01-31 10:38:16 -0800
committerGlenn Kasten <gkasten@google.com>2014-02-03 17:11:01 -0800
commit4d7b3f876b21997680ae32a340d746ed1cae6ab1 (patch)
tree85983b9a71a2c18e6ec2748505ca092aa2f08b99
parent1ec712f180072a7eb2131be09862921ae62dc2b4 (diff)
downloadframeworks_av-4d7b3f876b21997680ae32a340d746ed1cae6ab1.zip
frameworks_av-4d7b3f876b21997680ae32a340d746ed1cae6ab1.tar.gz
frameworks_av-4d7b3f876b21997680ae32a340d746ed1cae6ab1.tar.bz2
Change Format_frameBitShift() API for non-power-of-2 sizes
Change-Id: Ie39ff51ab8c403ca9d9898396297efdaa3193588
-rw-r--r--include/media/nbaio/NBAIO.h3
-rw-r--r--media/libnbaio/NBAIO.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/include/media/nbaio/NBAIO.h b/include/media/nbaio/NBAIO.h
index cdeb4ca..56896b9 100644
--- a/include/media/nbaio/NBAIO.h
+++ b/include/media/nbaio/NBAIO.h
@@ -63,7 +63,8 @@ extern const NBAIO_Format Format_Invalid;
size_t Format_frameSize(const NBAIO_Format& format);
// Return the frame size of an NBAIO_Format as a bit shift
-size_t Format_frameBitShift(const NBAIO_Format& format);
+// or -1 if frame size is not a power of 2
+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
diff --git a/media/libnbaio/NBAIO.cpp b/media/libnbaio/NBAIO.cpp
index 26ef8c4..51514de 100644
--- a/media/libnbaio/NBAIO.cpp
+++ b/media/libnbaio/NBAIO.cpp
@@ -28,11 +28,12 @@ size_t Format_frameSize(const NBAIO_Format& format)
return Format_channelCount(format) * sizeof(short);
}
-size_t Format_frameBitShift(const NBAIO_Format& format)
+int Format_frameBitShift(const NBAIO_Format& format)
{
// FIXME The sample format is hard-coded to AUDIO_FORMAT_PCM_16_BIT
// sizeof(short) == 2, so frame size == 1 << channels
return Format_channelCount(format);
+ // FIXME must return -1 for non-power of 2
}
const NBAIO_Format Format_Invalid = { 0 };