Loading include/media/IOMX.h +5 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,11 @@ public: typedef void *buffer_id; typedef void *node_id; // Given the calling process' pid, returns true iff // the implementation of the OMX interface lives in the same // process. virtual bool livesLocally(pid_t pid) = 0; struct ComponentInfo { String8 mName; List<String8> mRoles; Loading include/media/stagefright/OMXCodec.h +1 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,7 @@ private: }; sp<IOMX> mOMX; bool mOMXLivesLocally; IOMX::node_id mNode; uint32_t mQuirks; bool mIsEncoder; Loading media/libmedia/IOMX.cpp +21 −3 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ namespace android { enum { CONNECT = IBinder::FIRST_CALL_TRANSACTION, LIVES_LOCALLY, LIST_NODES, ALLOCATE_NODE, FREE_NODE, Loading Loading @@ -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(); Loading Loading @@ -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); Loading media/libstagefright/OMXCodec.cpp +15 −4 Original line number Diff line number Diff line Loading @@ -1016,6 +1016,7 @@ OMXCodec::OMXCodec( const char *componentName, const sp<MediaSource> &source) : mOMX(omx), mOMXLivesLocally(omx->livesLocally(getpid())), mNode(node), mQuirks(quirks), mIsEncoder(isEncoder), Loading Loading @@ -1191,12 +1192,22 @@ status_t OMXCodec::allocateBuffersOnPort(OMX_U32 portIndex) { IOMX::buffer_id buffer; if (portIndex == kPortIndexInput && (mQuirks & kRequiresAllocateBufferOnInputPorts)) { if (mOMXLivesLocally) { err = mOMX->allocateBuffer( mNode, portIndex, def.nBufferSize, &buffer); } else { err = mOMX->allocateBufferWithBackup( mNode, portIndex, mem, &buffer); } } else if (portIndex == kPortIndexOutput && (mQuirks & kRequiresAllocateBufferOnOutputPorts)) { if (mOMXLivesLocally) { err = mOMX->allocateBuffer( mNode, portIndex, def.nBufferSize, &buffer); } else { err = mOMX->allocateBufferWithBackup( mNode, portIndex, mem, &buffer); } } else { err = mOMX->useBuffer(mNode, portIndex, mem, &buffer); } Loading media/libstagefright/include/OMX.h +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ class OMX : public BnOMX, public: OMX(); virtual bool livesLocally(pid_t pid); virtual status_t listNodes(List<ComponentInfo> *list); virtual status_t allocateNode( Loading Loading
include/media/IOMX.h +5 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,11 @@ public: typedef void *buffer_id; typedef void *node_id; // Given the calling process' pid, returns true iff // the implementation of the OMX interface lives in the same // process. virtual bool livesLocally(pid_t pid) = 0; struct ComponentInfo { String8 mName; List<String8> mRoles; Loading
include/media/stagefright/OMXCodec.h +1 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,7 @@ private: }; sp<IOMX> mOMX; bool mOMXLivesLocally; IOMX::node_id mNode; uint32_t mQuirks; bool mIsEncoder; Loading
media/libmedia/IOMX.cpp +21 −3 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ namespace android { enum { CONNECT = IBinder::FIRST_CALL_TRANSACTION, LIVES_LOCALLY, LIST_NODES, ALLOCATE_NODE, FREE_NODE, Loading Loading @@ -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(); Loading Loading @@ -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); Loading
media/libstagefright/OMXCodec.cpp +15 −4 Original line number Diff line number Diff line Loading @@ -1016,6 +1016,7 @@ OMXCodec::OMXCodec( const char *componentName, const sp<MediaSource> &source) : mOMX(omx), mOMXLivesLocally(omx->livesLocally(getpid())), mNode(node), mQuirks(quirks), mIsEncoder(isEncoder), Loading Loading @@ -1191,12 +1192,22 @@ status_t OMXCodec::allocateBuffersOnPort(OMX_U32 portIndex) { IOMX::buffer_id buffer; if (portIndex == kPortIndexInput && (mQuirks & kRequiresAllocateBufferOnInputPorts)) { if (mOMXLivesLocally) { err = mOMX->allocateBuffer( mNode, portIndex, def.nBufferSize, &buffer); } else { err = mOMX->allocateBufferWithBackup( mNode, portIndex, mem, &buffer); } } else if (portIndex == kPortIndexOutput && (mQuirks & kRequiresAllocateBufferOnOutputPorts)) { if (mOMXLivesLocally) { err = mOMX->allocateBuffer( mNode, portIndex, def.nBufferSize, &buffer); } else { err = mOMX->allocateBufferWithBackup( mNode, portIndex, mem, &buffer); } } else { err = mOMX->useBuffer(mNode, portIndex, mem, &buffer); } Loading
media/libstagefright/include/OMX.h +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ class OMX : public BnOMX, public: OMX(); virtual bool livesLocally(pid_t pid); virtual status_t listNodes(List<ComponentInfo> *list); virtual status_t allocateNode( Loading