diff options
author | Ronghua Wu <ronghuawu@google.com> | 2015-03-16 16:37:29 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-03-16 16:37:30 +0000 |
commit | eb0ee0e842d3b8294aa6c0b797eaf7aff3fd2f89 (patch) | |
tree | 3a9991c2d7409caac8fca5747ea8cd1b6be83265 /media/libstagefright | |
parent | bd321b6ed912c492331216180b8677ee58c1eebd (diff) | |
parent | 8b806ea894ca098366629458bfdd1df4866afcdf (diff) | |
download | frameworks_av-eb0ee0e842d3b8294aa6c0b797eaf7aff3fd2f89.zip frameworks_av-eb0ee0e842d3b8294aa6c0b797eaf7aff3fd2f89.tar.gz frameworks_av-eb0ee0e842d3b8294aa6c0b797eaf7aff3fd2f89.tar.bz2 |
Merge "libstagefright: handle MediaFormat "priority" key."
Diffstat (limited to 'media/libstagefright')
-rw-r--r-- | media/libstagefright/ACodec.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index c75d4df..31e10ce 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -1676,6 +1676,11 @@ status_t ACodec::configureCodec( err = setMinBufferSize(kPortIndexInput, 8192); // XXX } + int32_t priority; + if (msg->findInt32("priority", &priority)) { + err = setPriority(priority); + } + mBaseOutputFormat = outputFormat; CHECK_EQ(getPortFormat(kPortIndexInput, inputFormat), (status_t)OK); @@ -1686,6 +1691,22 @@ status_t ACodec::configureCodec( return err; } +status_t ACodec::setPriority(int32_t priority) { + if (priority < 0) { + return BAD_VALUE; + } + OMX_PARAM_U32TYPE config; + InitOMXParams(&config); + config.nU32 = (OMX_U32)priority; + status_t temp = mOMX->setConfig( + mNode, (OMX_INDEXTYPE)OMX_IndexConfigPriority, + &config, sizeof(config)); + if (temp != OK) { + ALOGI("codec does not support config priority (err %d)", temp); + } + return OK; +} + status_t ACodec::setMinBufferSize(OMX_U32 portIndex, size_t size) { OMX_PARAM_PORTDEFINITIONTYPE def; InitOMXParams(&def); |