Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fb3719ce authored by Keith Mok's avatar Keith Mok
Browse files

stagefright: Fix cts testGetMaxSupportedInstances

Fix cts testGetMaxSupportedInstances on 64 bits system.

In FFMPEGSoftCodec.cpp, it tries to get OMX parameter
in function setRawAudioFormat by calling:
    OMX_PARAM_PORTDEFINITIONTYPE def;
    ...
    status_t err = OMXhandle->getParameter(
            nodeID, OMX_IndexParamPortDefinition, &def, sizeof(def));
However, this code runs in 64 bits, and mediaserver is running in 32 bits.
sizeof(OMX_PARAM_PORTDEFINITIONTYPE) is equals to 112 vs 96 in 32 bits mode,
since sizeof(OMX_PTR) are different.

In SimpleSoftOMXComponent::internalGetParameter which runs in 32 bits mode,
it checks defParams->nSize != sizeof(OMX_PARAM_PORTDEFINITIONTYPE)
and fails.

Declaring OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS in
FFMPEGSoftCodec.cpp solves it.

Change-Id: Ieb5a548c580e87c964c66f0b0d6ce8bb14dac690
parent 9ea60c76
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -14,6 +14,10 @@
 * limitations under the License.
 */

#ifdef __LP64__
#define OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS
#endif

//#define LOG_NDEBUG 0
#define LOG_TAG "FFMPEGSoftCodec"
#include <utils/Log.h>
@@ -330,7 +334,7 @@ status_t FFMPEGSoftCodec::setVideoFormat(

            xerr = OMXhandle->setParameter(
                    nodeID, (OMX_INDEXTYPE)OMX_QcomIndexEnableExtnUserData,
                    (OMX_PTR)&enableType, sizeof(enableType));
                    &enableType, sizeof(enableType));
            if (xerr != OK) {
                ALOGW("[%s] Failed to enable user-extradata", componentName);
            }