diff options
Diffstat (limited to 'media/libstagefright/Utils.cpp')
-rw-r--r-- | media/libstagefright/Utils.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/media/libstagefright/Utils.cpp b/media/libstagefright/Utils.cpp index 4db8e80..216a329 100644 --- a/media/libstagefright/Utils.cpp +++ b/media/libstagefright/Utils.cpp @@ -540,7 +540,8 @@ const struct mime_conv_t* p = &mimeLookup[0]; return BAD_VALUE; } -bool canOffloadStream(const sp<MetaData>& meta, bool hasVideo, bool isStreaming) +bool canOffloadStream(const sp<MetaData>& meta, bool hasVideo, + bool isStreaming, audio_stream_type_t streamType) { const char *mime; CHECK(meta->findCString(kKeyMIMEType, &mime)); @@ -561,6 +562,17 @@ bool canOffloadStream(const sp<MetaData>& meta, bool hasVideo, bool isStreaming) 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); @@ -594,7 +606,7 @@ bool canOffloadStream(const sp<MetaData>& meta, bool hasVideo, bool isStreaming) info.bit_rate = brate; - info.stream_type = AUDIO_STREAM_MUSIC; + info.stream_type = streamType; info.has_video = hasVideo; info.is_streaming = isStreaming; |