diff options
author | Wei Jia <wjia@google.com> | 2015-10-08 20:10:39 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-10-08 20:10:39 +0000 |
commit | 91aa4a0aefa43ad53a20b3d4538a6a986c902818 (patch) | |
tree | 26f92a59a28b761d463006f652634d583058dbfc /media/libstagefright | |
parent | a6b9d752e7e266b63a2d9a694b3422198cb512a1 (diff) | |
parent | f106f9e4eacc1cb10ccc851a37619ed4b37bbb1b (diff) | |
download | frameworks_av-91aa4a0aefa43ad53a20b3d4538a6a986c902818.zip frameworks_av-91aa4a0aefa43ad53a20b3d4538a6a986c902818.tar.gz frameworks_av-91aa4a0aefa43ad53a20b3d4538a6a986c902818.tar.bz2 |
am f106f9e4: am 15e991bd: resolved conflicts for 0b09da7a to lmp-mr1-dev
* commit 'f106f9e4eacc1cb10ccc851a37619ed4b37bbb1b':
DO NOT MERGE - OMX: allow only secure codec to remotely call allocateBuffer.
Diffstat (limited to 'media/libstagefright')
-rw-r--r-- | media/libstagefright/include/OMX.h | 2 | ||||
-rw-r--r-- | media/libstagefright/include/OMXNodeInstance.h | 5 | ||||
-rw-r--r-- | media/libstagefright/omx/OMX.cpp | 5 | ||||
-rw-r--r-- | media/libstagefright/omx/OMXNodeInstance.cpp | 1 |
4 files changed, 13 insertions, 0 deletions
diff --git a/media/libstagefright/include/OMX.h b/media/libstagefright/include/OMX.h index e8c4970..2da5c6c 100644 --- a/media/libstagefright/include/OMX.h +++ b/media/libstagefright/include/OMX.h @@ -130,6 +130,8 @@ public: virtual void binderDied(const wp<IBinder> &the_late_who); + virtual bool isSecure(IOMX::node_id node); + OMX_ERRORTYPE OnEvent( node_id node, OMX_IN OMX_EVENTTYPE eEvent, diff --git a/media/libstagefright/include/OMXNodeInstance.h b/media/libstagefright/include/OMXNodeInstance.h index b26e940..4586aa2 100644 --- a/media/libstagefright/include/OMXNodeInstance.h +++ b/media/libstagefright/include/OMXNodeInstance.h @@ -114,6 +114,10 @@ struct OMXNodeInstance { const void *data, size_t size); + bool isSecure() const { + return mIsSecure; + } + void onMessage(const omx_message &msg); void onObserverDied(OMXMaster *master); void onGetHandleFailed(); @@ -129,6 +133,7 @@ private: OMX_HANDLETYPE mHandle; sp<IOMXObserver> mObserver; bool mDying; + bool mIsSecure; // Lock only covers mGraphicBufferSource. We can't always use mLock // because of rare instances where we'd end up locking it recursively. diff --git a/media/libstagefright/omx/OMX.cpp b/media/libstagefright/omx/OMX.cpp index f8d38ff..97b360d 100644 --- a/media/libstagefright/omx/OMX.cpp +++ b/media/libstagefright/omx/OMX.cpp @@ -187,6 +187,11 @@ void OMX::binderDied(const wp<IBinder> &the_late_who) { instance->onObserverDied(mMaster); } +bool OMX::isSecure(node_id node) { + OMXNodeInstance *instance = findInstance(node); + return (instance == NULL ? false : instance->isSecure()); +} + bool OMX::livesLocally(node_id /* node */, pid_t pid) { return pid == getpid(); } diff --git a/media/libstagefright/omx/OMXNodeInstance.cpp b/media/libstagefright/omx/OMXNodeInstance.cpp index 63c8f54..7ea34ff 100644 --- a/media/libstagefright/omx/OMXNodeInstance.cpp +++ b/media/libstagefright/omx/OMXNodeInstance.cpp @@ -180,6 +180,7 @@ OMXNodeInstance::OMXNodeInstance( mNumPortBuffers[1] = 0; mDebugLevelBumpPendingBuffers[0] = 0; mDebugLevelBumpPendingBuffers[1] = 0; + mIsSecure = AString(name).endsWith(".secure"); } OMXNodeInstance::~OMXNodeInstance() { |