diff options
author | Andreas Huber <andih@google.com> | 2010-01-19 11:43:12 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-01-19 11:43:12 -0800 |
commit | cb6ffa28244e491b2ae8e3b1c68ba7c93a08e560 (patch) | |
tree | 7afba0a710069e77ef21f73d93292173e1eeaf8f /media/libmedia | |
parent | bfa05732a9b791ce49f3db2bb5c9ee30638fd6bb (diff) | |
parent | f1fe064d735698b09e4bc7b3a10e4dc3dba9a1d9 (diff) | |
download | frameworks_base-cb6ffa28244e491b2ae8e3b1c68ba7c93a08e560.zip frameworks_base-cb6ffa28244e491b2ae8e3b1c68ba7c93a08e560.tar.gz frameworks_base-cb6ffa28244e491b2ae8e3b1c68ba7c93a08e560.tar.bz2 |
Merge "Avoid unnecessary buffer copying if at all possible, detect if running in the mediaserver process."
Diffstat (limited to 'media/libmedia')
-rw-r--r-- | media/libmedia/IOMX.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/media/libmedia/IOMX.cpp b/media/libmedia/IOMX.cpp index b43e48f..277bce1 100644 --- a/media/libmedia/IOMX.cpp +++ b/media/libmedia/IOMX.cpp @@ -12,6 +12,7 @@ namespace android { enum { CONNECT = IBinder::FIRST_CALL_TRANSACTION, + LIVES_LOCALLY, LIST_NODES, ALLOCATE_NODE, FREE_NODE, @@ -75,6 +76,15 @@ public: : BpInterface<IOMX>(impl) { } + virtual bool livesLocally(pid_t pid) { + Parcel data, reply; + data.writeInterfaceToken(IOMX::getInterfaceDescriptor()); + data.writeInt32(pid); + remote()->transact(LIVES_LOCALLY, data, &reply); + + return reply.readInt32() != 0; + } + virtual status_t listNodes(List<ComponentInfo> *list) { list->clear(); @@ -369,6 +379,14 @@ IMPLEMENT_META_INTERFACE(OMX, "android.hardware.IOMX"); status_t BnOMX::onTransact( uint32_t code, const Parcel &data, Parcel *reply, uint32_t flags) { switch (code) { + case LIVES_LOCALLY: + { + CHECK_INTERFACE(IOMX, data, reply); + reply->writeInt32(livesLocally((pid_t)data.readInt32())); + + return OK; + } + case LIST_NODES: { CHECK_INTERFACE(IOMX, data, reply); @@ -408,7 +426,7 @@ status_t BnOMX::onTransact( if (err == OK) { reply->writeIntPtr((intptr_t)node); } - + return NO_ERROR; } @@ -419,7 +437,7 @@ status_t BnOMX::onTransact( node_id node = (void*)data.readIntPtr(); reply->writeInt32(freeNode(node)); - + return NO_ERROR; } @@ -631,7 +649,7 @@ status_t BnOMX::onTransact( node_id node = (void*)data.readIntPtr(); const char *parameter_name = data.readCString(); - + OMX_INDEXTYPE index; status_t err = getExtensionIndex(node, parameter_name, &index); |