summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2014-03-07 01:09:33 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-03-07 01:09:34 +0000
commited4d8b28b8ee5a3e4ebc8f73bf4dc86c75a74258 (patch)
tree93a6b8673072ca56e0e42e67859a7943915cd016
parent880413f7923ec77467243e15dc34d4af4f8064f9 (diff)
parentf590f948e6c0fe3c54008dd7802fd513f127792d (diff)
downloadframeworks_av-ed4d8b28b8ee5a3e4ebc8f73bf4dc86c75a74258.zip
frameworks_av-ed4d8b28b8ee5a3e4ebc8f73bf4dc86c75a74258.tar.gz
frameworks_av-ed4d8b28b8ee5a3e4ebc8f73bf4dc86c75a74258.tar.bz2
Merge "stagefright: do not offload LD-AAC decoding" into klp-dev
-rw-r--r--include/media/stagefright/MetaData.h1
-rw-r--r--media/libstagefright/MPEG4Extractor.cpp3
-rw-r--r--media/libstagefright/Utils.cpp11
3 files changed, 15 insertions, 0 deletions
diff --git a/include/media/stagefright/MetaData.h b/include/media/stagefright/MetaData.h
index de3fc36..3a87474 100644
--- a/include/media/stagefright/MetaData.h
+++ b/include/media/stagefright/MetaData.h
@@ -134,6 +134,7 @@ enum {
kKeyRequiresSecureBuffers = 'secu', // bool (int32_t)
kKeyIsADTS = 'adts', // bool (int32_t)
+ kKeyAACAOT = 'aaot', // int32_t
// If a MediaBuffer's data represents (at least partially) encrypted
// data, the following fields aid in decryption.
diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp
index 6f51c39..491b4d1 100644
--- a/media/libstagefright/MPEG4Extractor.cpp
+++ b/media/libstagefright/MPEG4Extractor.cpp
@@ -2297,6 +2297,9 @@ status_t MPEG4Extractor::updateAudioTrackInfoFromESDS_MPEG4Audio(
objectType = 32 + br.getBits(6);
}
+ //keep AOT type
+ mLastTrack->meta->setInt32(kKeyAACAOT, objectType);
+
uint32_t freqIndex = br.getBits(4);
int32_t sampleRate = 0;
diff --git a/media/libstagefright/Utils.cpp b/media/libstagefright/Utils.cpp
index 9041c21..216a329 100644
--- a/media/libstagefright/Utils.cpp
+++ b/media/libstagefright/Utils.cpp
@@ -562,6 +562,17 @@ bool canOffloadStream(const sp<MetaData>& meta, bool hasVideo,
return false;
}
+ // check whether it is ELD/LD content -> no offloading
+ // FIXME: this should depend on audio DSP capabilities. mapMimeToAudioFormat() should use the
+ // metadata to refine the AAC format and the audio HAL should only list supported profiles.
+ int32_t aacaot = -1;
+ if (meta->findInt32(kKeyAACAOT, &aacaot)) {
+ if (aacaot == 23 || aacaot == 39 ) {
+ ALOGV("track of type '%s' is ELD/LD content", mime);
+ return false;
+ }
+ }
+
int32_t srate = -1;
if (!meta->findInt32(kKeySampleRate, &srate)) {
ALOGV("track of type '%s' does not publish sample rate", mime);