Allow OMX pointer types to be forced to 32 bits

Enabled by #define.  Is used for 64 bit compilation to
force structs to use 32 bit pointer values for eventual
IPC to 32 bit OMX codecs.

May change later if we support 64 bit OMX codecs.

Change-Id: I0d12f86774f6f7ce9c39c8abea5d51988a7eef11
Signed-off-by: Andy Hung <hunga@google.com>
This commit is contained in:
Andy Hung 2014-05-01 18:58:55 -07:00
parent 4522f5749d
commit abec6ad341

View File

@ -211,7 +211,25 @@ typedef enum OMX_BOOL {
OMX_TRUE = !OMX_FALSE,
OMX_BOOL_MAX = 0x7FFFFFFF
} OMX_BOOL;
/*
* Temporary Android 64 bit modification
*
* #define OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS
* overrides all OMX pointer types to be uint32_t.
*
* After this change, OMX codecs will work in 32 bit only, so 64 bit processes
* must communicate to a remote 32 bit process for OMX to work.
*/
#ifdef OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS
typedef uint32_t OMX_PTR;
typedef OMX_PTR OMX_STRING;
typedef OMX_PTR OMX_BYTE;
#else /* OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS */
/** The OMX_PTR type is intended to be used to pass pointers between the OMX
applications and the OMX Core and components. This is a 32 bit pointer and
is aligned on a 32 bit boundary.
@ -232,6 +250,8 @@ typedef char* OMX_STRING;
*/
typedef unsigned char* OMX_BYTE;
#endif /* OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS */
/** OMX_UUIDTYPE is a very long unique identifier to uniquely identify
at runtime. This identifier should be generated by a component in a way
that guarantees that every instance of the identifier running on the system
@ -312,7 +332,7 @@ typedef struct OMX_TICKS
/** Define the public interface for the OMX Handle. The core will not use
this value internally, but the application should only use this value.
*/
typedef void* OMX_HANDLETYPE;
typedef OMX_PTR OMX_HANDLETYPE;
typedef struct OMX_MARKTYPE
{
@ -328,11 +348,11 @@ typedef struct OMX_MARKTYPE
/** OMX_NATIVE_DEVICETYPE is used to map a OMX video port to the
* platform & operating specific object used to reference the display
* or can be used by a audio port for native audio rendering */
typedef void* OMX_NATIVE_DEVICETYPE;
typedef OMX_PTR OMX_NATIVE_DEVICETYPE;
/** OMX_NATIVE_WINDOWTYPE is used to map a OMX video port to the
* platform & operating specific object used to reference the window */
typedef void* OMX_NATIVE_WINDOWTYPE;
typedef OMX_PTR OMX_NATIVE_WINDOWTYPE;
/** The OMX_VERSIONTYPE union is used to specify the version for
a structure or component. For a component, the version is entirely