diff options
author | Steve Kondik <steve@cyngn.com> | 2015-12-21 05:13:15 -0500 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-12-21 05:13:15 -0500 |
commit | ab35ee6f52fb9ad55f01eaf2dc745f7f00863d67 (patch) | |
tree | 1b872f46c03256e6d2d6324fc4e27f6e0832632f | |
parent | d3c005d58c4064b647f1cb8998e5b557e79aa521 (diff) | |
download | frameworks_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
-rw-r--r-- | include/media/stagefright/ACodec.h | 2 | ||||
-rw-r--r-- | media/libstagefright/ACodec.cpp | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/include/media/stagefright/ACodec.h b/include/media/stagefright/ACodec.h index d28d3d9..cbc2ba6 100644 --- a/include/media/stagefright/ACodec.h +++ b/include/media/stagefright/ACodec.h @@ -350,7 +350,7 @@ protected: 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 = 16); status_t setupAC3Codec(bool encoder, int32_t numChannels, int32_t sampleRate, int32_t bitsPerSample = 16); 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; |