summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
diff options
context:
space:
mode:
authorRonghua Wu <ronghuawu@google.com>2015-04-22 13:51:35 -0700
committerRonghua Wu <ronghuawu@google.com>2015-04-27 21:20:31 +0000
commit8db8813d39e3c8b5fbd580dfc3062830744afd63 (patch)
treee2573de1c55ee05a5c075153835cebaeadecb4eb /media/libmediaplayerservice/nuplayer/NuPlayer.cpp
parent5e95559255d1abd62c78b308731ebe3991186e94 (diff)
downloadframeworks_av-8db8813d39e3c8b5fbd580dfc3062830744afd63.zip
frameworks_av-8db8813d39e3c8b5fbd580dfc3062830744afd63.tar.gz
frameworks_av-8db8813d39e3c8b5fbd580dfc3062830744afd63.tar.bz2
DO NOT MERGE libmediaplayerservice: set priority and operating rate for the codec used by nuplayer.
Bug: 20481562 Change-Id: I9806414962352fbcda726f8274f1cd348c961de0 (cherry picked from commit f19f5d716b39a5d9dc1abdcd5a16a7aaf1b1ab8b)
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/NuPlayer.cpp')
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayer.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
index a028b01..b670d68 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
@@ -634,6 +634,17 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) {
if (mRenderer != NULL) {
mRenderer->setPlaybackRate(mPlaybackRate);
}
+
+ if (mVideoDecoder != NULL) {
+ sp<MetaData> meta = getFileMeta();
+ int32_t rate;
+ if (meta != NULL && meta->findInt32(kKeyFrameRate, &rate) && rate > 0) {
+ sp<AMessage> params = new AMessage();
+ params->setFloat("operating-rate", rate * mPlaybackRate);
+ mVideoDecoder->setParameters(params);
+ }
+ }
+
break;
}
@@ -1249,6 +1260,8 @@ status_t NuPlayer::instantiateDecoder(bool audio, sp<DecoderBase> *decoder) {
return -EWOULDBLOCK;
}
+ format->setInt32("priority", 0 /* realtime */);
+
if (!audio) {
AString mime;
CHECK(format->findString("mime", &mime));
@@ -1265,6 +1278,12 @@ status_t NuPlayer::instantiateDecoder(bool audio, sp<DecoderBase> *decoder) {
if (mSourceFlags & Source::FLAG_PROTECTED) {
format->setInt32("protected", true);
}
+
+ sp<MetaData> meta = getFileMeta();
+ int32_t rate;
+ if (meta != NULL && meta->findInt32(kKeyFrameRate, &rate) && rate > 0) {
+ format->setFloat("operating-rate", rate * mPlaybackRate);
+ }
}
if (audio) {