diff options
Diffstat (limited to 'media/libstagefright/OMXClient.cpp')
-rw-r--r-- | media/libstagefright/OMXClient.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/media/libstagefright/OMXClient.cpp b/media/libstagefright/OMXClient.cpp index 9f9352d..aca21cf 100644 --- a/media/libstagefright/OMXClient.cpp +++ b/media/libstagefright/OMXClient.cpp @@ -16,6 +16,11 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "OMXClient" + +#ifdef __LP64__ +#define OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS +#endif + #include <utils/Log.h> #include <binder/IServiceManager.h> @@ -141,7 +146,7 @@ private: const sp<IOMX> &getOMX(node_id node) const; const sp<IOMX> &getOMX_l(node_id node) const; - static bool IsSoftwareComponent(const char *name); + static bool CanLiveLocally(const char *name); DISALLOW_EVIL_CONSTRUCTORS(MuxOMX); }; @@ -164,8 +169,15 @@ bool MuxOMX::isLocalNode_l(node_id node) const { } // static -bool MuxOMX::IsSoftwareComponent(const char *name) { +bool MuxOMX::CanLiveLocally(const char *name) { +#ifdef __LP64__ + (void)name; // disable unused parameter warning + // 64 bit processes always run OMX remote on MediaServer + return false; +#else + // 32 bit processes run only OMX.google.* components locally return !strncasecmp(name, "OMX.google.", 11); +#endif } const sp<IOMX> &MuxOMX::getOMX(node_id node) const { @@ -197,7 +209,7 @@ status_t MuxOMX::allocateNode( sp<IOMX> omx; - if (IsSoftwareComponent(name)) { + if (CanLiveLocally(name)) { if (mLocalOMX == NULL) { mLocalOMX = new OMX; } @@ -382,7 +394,7 @@ status_t OMXClient::connect() { mOMX = service->getOMX(); CHECK(mOMX.get() != NULL); - if (!mOMX->livesLocally(NULL /* node */, getpid())) { + if (!mOMX->livesLocally(0 /* node */, getpid())) { ALOGI("Using client-side OMX mux."); mOMX = new MuxOMX(mOMX); } |