summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
diff options
context:
space:
mode:
authorHaynes Mathew George <hgeorge@codeaurora.org>2015-03-30 17:59:47 -0700
committerRonghua Wu <ronghuawu@google.com>2015-04-02 15:49:10 -0700
commit8b63533e6aaff121378878998925c57dbe9a9e16 (patch)
tree1c4a4f96b9983991d39938eec2eb9a1a55110591 /media/libmediaplayerservice/nuplayer/NuPlayer.cpp
parent5c86635f1ce78210ebb7f6de96b94a01d2ad9b7d (diff)
downloadframeworks_av-8b63533e6aaff121378878998925c57dbe9a9e16.zip
frameworks_av-8b63533e6aaff121378878998925c57dbe9a9e16.tar.gz
frameworks_av-8b63533e6aaff121378878998925c57dbe9a9e16.tar.bz2
nuplayer: Has video hint for offload
Send a hint indicating whether the clip being played has a video stream from NuPlayer to NuPlayerDecoderPassThrough. This hint is used to open the audio sink with the correct offload config. Currently, NuPlayerDecoderPassthrough always calls openAudioSink with hasVideo set to false causing an unnecessary recreation of AudioTrack. Change-Id: I7bc6c73818b65f9237a6e606721b7d48e1d807b9 CRs-Fixed: 811510
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/NuPlayer.cpp')
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
index f4d3794..2f9f33c 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
@@ -1239,6 +1239,8 @@ status_t NuPlayer::instantiateDecoder(bool audio, sp<DecoderBase> *decoder) {
notify->setInt32("generation", mAudioDecoderGeneration);
if (mOffloadAudio) {
+ const bool hasVideo = (mSource->getFormat(false /*audio */) != NULL);
+ format->setInt32("has-video", hasVideo);
*decoder = new DecoderPassThrough(notify, mSource, mRenderer);
} else {
*decoder = new Decoder(notify, mSource, mRenderer);