summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/ACodec.cpp
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2015-12-21 05:13:15 -0500
committerSteve Kondik <steve@cyngn.com>2015-12-21 05:13:15 -0500
commitab35ee6f52fb9ad55f01eaf2dc745f7f00863d67 (patch)
tree1b872f46c03256e6d2d6324fc4e27f6e0832632f /media/libstagefright/ACodec.cpp
parentd3c005d58c4064b647f1cb8998e5b557e79aa521 (diff)
downloadframeworks_av-ab35ee6f52fb9ad55f01eaf2dc745f7f00863d67.zip
frameworks_av-ab35ee6f52fb9ad55f01eaf2dc745f7f00863d67.tar.gz
frameworks_av-ab35ee6f52fb9ad55f01eaf2dc745f7f00863d67.tar.bz2
stagefright: Deal with output format of other AAC decoders
* Pass the bits-per-sample value when setting up the raw PCM output in case FFMPEG is decoding as it will produce floats. Change-Id: If5a8cc43a1c41e522324e77871823c9084f92169
Diffstat (limited to 'media/libstagefright/ACodec.cpp')
-rw-r--r--media/libstagefright/ACodec.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index c84601d..6d26173 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -2065,6 +2065,7 @@ status_t ACodec::configureCodec(
int32_t sbrMode;
int32_t maxOutputChannelCount;
int32_t pcmLimiterEnable;
+ int32_t bitsPerSample = 16;
drcParams_t drc;
if (!msg->findInt32("is-adts", &isADTS)) {
isADTS = 0;
@@ -2103,11 +2104,12 @@ status_t ACodec::configureCodec(
// value is unknown
drc.targetRefLevel = -1;
}
+ msg->findInt32("bits-per-sample", &bitsPerSample);
err = setupAACCodec(
encoder, numChannels, sampleRate, bitRate, aacProfile,
isADTS != 0, sbrMode, maxOutputChannelCount, drc,
- pcmLimiterEnable);
+ pcmLimiterEnable, bitsPerSample);
}
} else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_AMR_NB)) {
err = setupAMRCodec(encoder, false /* isWAMR */, bitRate);
@@ -2367,15 +2369,16 @@ status_t ACodec::setupAACCodec(
bool encoder, int32_t numChannels, int32_t sampleRate,
int32_t bitRate, int32_t aacProfile, bool isADTS, int32_t sbrMode,
int32_t maxOutputChannelCount, const drcParams_t& drc,
- int32_t pcmLimiterEnable) {
+ int32_t pcmLimiterEnable, int32_t bitsPerSample) {
if (encoder && isADTS) {
return -EINVAL;
}
- status_t err = setupRawAudioFormat(
+ status_t err = setupRawAudioFormatInternal(
encoder ? kPortIndexInput : kPortIndexOutput,
sampleRate,
- numChannels);
+ numChannels,
+ bitsPerSample);
if (err != OK) {
return err;