diff options
author | Andy Hung <hunga@google.com> | 2015-05-31 22:55:59 -0700 |
---|---|---|
committer | Andy Hung <hunga@google.com> | 2015-06-03 22:41:22 -0700 |
commit | 288da02b1f074f9f3c191f1838f135d4633b3d34 (patch) | |
tree | 71f3b4ba081022cabab6ea25e06c201e690e1024 /media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp | |
parent | 179652ee2a508361df1aa18e99000373886f0816 (diff) | |
download | frameworks_av-288da02b1f074f9f3c191f1838f135d4633b3d34.zip frameworks_av-288da02b1f074f9f3c191f1838f135d4633b3d34.tar.gz frameworks_av-288da02b1f074f9f3c191f1838f135d4633b3d34.tar.bz2 |
NuPlayer: Add audio deep buffer configuration
Disabled for video streams now.
Enabled by property media.stagefright.audio.deep 1
Bug: 21198655
Change-Id: I03f3b43091f950637d46779e2e74c1321b2cd268
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp')
-rw-r--r-- | media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp index 6abc81c..c649c62 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp @@ -24,6 +24,7 @@ #include "NuPlayerRenderer.h" #include "NuPlayerSource.h" +#include <cutils/properties.h> #include <media/ICrypto.h> #include <media/stagefright/foundation/ABuffer.h> #include <media/stagefright/foundation/ADebug.h> @@ -40,6 +41,10 @@ namespace android { +static inline bool getAudioDeepBufferSetting() { + return property_get_bool("media.stagefright.audio.deep", false /* default_value */); +} + NuPlayer::Decoder::Decoder( const sp<AMessage> ¬ify, const sp<Source> &source, @@ -539,9 +544,10 @@ void NuPlayer::Decoder::handleOutputFormatChange(const sp<AMessage> &format) { uint32_t flags; int64_t durationUs; bool hasVideo = (mSource->getFormat(false /* audio */) != NULL); - if (!hasVideo && - mSource->getDuration(&durationUs) == OK && - durationUs > AUDIO_SINK_MIN_DEEP_BUFFER_DURATION_US) { + if (getAudioDeepBufferSetting() // override regardless of source duration + || (!hasVideo + && mSource->getDuration(&durationUs) == OK + && durationUs > AUDIO_SINK_MIN_DEEP_BUFFER_DURATION_US)) { flags = AUDIO_OUTPUT_FLAG_DEEP_BUFFER; } else { flags = AUDIO_OUTPUT_FLAG_NONE; |