From f87e30fe71752dc431d8e8d5682c38271c03265a Mon Sep 17 00:00:00 2001 From: Andy Hung Date: Tue, 13 May 2014 18:37:59 -0700 Subject: Send 64 bit OMX codec handling to 32 bit MediaServer This is a temporary fix for 64 bit OMX handling until 64 bit codecs are more robust. Bug: 13938273 Change-Id: Ifc79e360f9606f6c909b859d322b7dd5d416b26b Signed-off-by: Andy Hung --- media/libstagefright/ACodec.cpp | 4 ++++ media/libstagefright/OMXClient.cpp | 12 ++++++++++++ media/libstagefright/OMXCodec.cpp | 6 ++++++ 3 files changed, 22 insertions(+) diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 0fe7ff2..4f66402 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -17,6 +17,10 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "ACodec" +#ifdef __LP64__ +#define OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS +#endif + #include #include diff --git a/media/libstagefright/OMXClient.cpp b/media/libstagefright/OMXClient.cpp index 72f2306..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 #include @@ -165,7 +170,14 @@ bool MuxOMX::isLocalNode_l(node_id node) const { // static 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 &MuxOMX::getOMX(node_id node) const { diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp index f248861..c028dbf 100644 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -18,6 +18,11 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "OMXCodec" + +#ifdef __LP64__ +#define OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS +#endif + #include #include "include/AACEncoder.h" @@ -130,6 +135,7 @@ private: template static void InitOMXParams(T *params) { + COMPILE_TIME_ASSERT_FUNCTION_SCOPE(sizeof(OMX_PTR) == 4); // check OMX_PTR is 4 bytes. params->nSize = sizeof(T); params->nVersion.s.nVersionMajor = 1; params->nVersion.s.nVersionMinor = 0; -- cgit v1.1