diff options
author | Ronghua Wu <ronghuawu@google.com> | 2015-04-22 13:51:35 -0700 |
---|---|---|
committer | Ronghua Wu <ronghuawu@google.com> | 2015-04-27 21:20:31 +0000 |
commit | 8db8813d39e3c8b5fbd580dfc3062830744afd63 (patch) | |
tree | e2573de1c55ee05a5c075153835cebaeadecb4eb /media/libstagefright | |
parent | 5e95559255d1abd62c78b308731ebe3991186e94 (diff) | |
download | frameworks_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/libstagefright')
-rw-r--r-- | media/libstagefright/ACodec.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index da22f11..c7df5a0 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -405,6 +405,7 @@ ACodec::ACodec() : mQuirks(0), mNode(0), mSentFormat(false), + mIsVideo(false), mIsEncoder(false), mUseMetadataOnEncoderOutput(false), mShutdownInProgress(false), @@ -1186,6 +1187,7 @@ status_t ACodec::configureCodec( mIsEncoder = encoder; + status_t err = setComponentRole(encoder /* isEncoder */, mime); if (err != OK) { @@ -1244,6 +1246,7 @@ status_t ACodec::configureCodec( // sps/pps to idr frames, since in metadata mode the bitstream is in an // opaque handle, to which we don't have access. int32_t video = !strncasecmp(mime, "video/", 6); + mIsVideo = video; if (encoder && video) { OMX_BOOL enable = (OMX_BOOL) (prependSPSPPS && msg->findInt32("store-metadata-in-buffers-output", &storeMeta) @@ -5684,6 +5687,15 @@ status_t ACodec::setParameters(const sp<AMessage> ¶ms) { } } + float rate; + if (params->findFloat("operating-rate", &rate) && rate > 0) { + status_t err = setOperatingRate(rate, mIsVideo); + if (err != OK) { + ALOGE("Failed to set parameter 'operating-rate' (err %d)", err); + return err; + } + } + return OK; } |