26 #ifndef _OMX_BASE_COMPONENT_H_
27 #define _OMX_BASE_COMPONENT_H_
35 #if defined(__linux__)
36 #include <asm/unistd.h>
39 #ifdef ANDROID_COMPILATION
40 #include <oscl_base_macros.h>
42 #define OSCL_IMPORT_REF
43 #define OSCL_EXPORT_REF
56 #define DEFAULT_IN_BUFFER_SIZE 4 * 1024
58 #define DEFAULT_OUT_BUFFER_SIZE 32 * 1024
60 #define DEFAULT_MIME_STRING_LENGTH 128
64 #define OMX_BUFFERFLAG_KEY_FRAME 0x11000000
125 #define omx_base_component_PrivateType_FIELDS \
126 OMX_COMPONENTTYPE *openmaxStandComp; \
127 omx_base_PortType **ports; \
128 OMX_PORT_PARAM_TYPE sPortTypesParam[NUM_DOMAINS]; \
131 OMX_STATETYPE state; \
132 OMX_TRANS_STATETYPE transientState; \
137 OMX_CALLBACKTYPE* callbacks; \
139 OMX_PTR callbackData; \
141 queue_t* messageQueue;\
143 OMX_U32 nGroupPriority; \
145 OMX_PARAM_BELLAGIOTHREADS_ID* bellagioThreads;\
146 OMX_BOOL bIsEOSReached; \
147 OMX_MARKTYPE pMark; \
148 pthread_mutex_t flush_mutex; \
149 tsem_t* flush_all_condition; \
150 tsem_t* flush_condition; \
153 pthread_t messageHandlerThread; \
154 int bufferMgmtThreadID; \
155 pthread_t bufferMgmtThread; \
157 void* (*BufferMgmtFunction)(void* param); \
158 OMX_ERRORTYPE (*messageHandler)(OMX_COMPONENTTYPE*,internalRequestMessageType*); \
159 OMX_ERRORTYPE (*DoStateSet)(OMX_COMPONENTTYPE *openmaxStandComp, OMX_U32); \
160 OMX_ERRORTYPE (*destructor)(OMX_COMPONENTTYPE *openmaxStandComp); \
161 OMX_ERRORTYPE (*getQualityLevel)(OMX_COMPONENTTYPE *openmaxStandComp, OMX_U32* pQualityLevel); \
162 OMX_ERRORTYPE (*setQualityLevel)(OMX_COMPONENTTYPE *openmaxStandComp, OMX_U32 nQualityLevel); \
163 OMX_U32 nqualitylevels; \
164 multiResourceDescriptor** multiResourceLevel; \
165 int currentQualityLevel;
283 OMX_PTR ComponentParameterStructure);
296 OMX_PTR ComponentParameterStructure);
308 OMX_PTR pComponentConfigStructure);
320 OMX_PTR pComponentConfigStructure);
@ OMX_IndexVendorStartUnused
unsigned char OMX_UUIDTYPE[128]
Extended OMXIL component interface for quality-of-service.
OMX_ERRORTYPE omx_base_component_Constructor(OMX_COMPONENTTYPE *openmaxStandComp, OMX_STRING cComponentName)
The base constructor for the OpenMAX ST components.
OMX_ERRORTYPE omx_base_component_EmptyThisBuffer(OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE omx_base_component_GetState(OMX_HANDLETYPE hComponent, OMX_STATETYPE *pState)
OMX_ERRORTYPE omx_base_component_ComponentDeInit(OMX_HANDLETYPE hComponent)
This standard functionality is called when the component is destroyed in the FreeHandle standard call...
OMX_ERRORTYPE omx_base_component_MessageHandler(OMX_COMPONENTTYPE *openmaxStandComp, internalRequestMessageType *message)
OMX_ERRORTYPE omx_base_component_AllocateBuffer(OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE **ppBuffer, OMX_U32 nPortIndex, OMX_PTR pAppPrivate, OMX_U32 nSizeBytes)
OMX_ERRORTYPE omx_base_component_GetComponentVersion(OMX_HANDLETYPE hComponent, OMX_STRING pComponentName, OMX_VERSIONTYPE *pComponentVersion, OMX_VERSIONTYPE *pSpecVersion, OMX_UUIDTYPE *pComponentUUID)
standard openmax function
OMX_ERRORTYPE omx_base_component_SendCommand(OMX_HANDLETYPE hComponent, OMX_COMMANDTYPE Cmd, OMX_U32 nParam, OMX_PTR pCmdData)
standard SendCommand function
OMX_ERRORTYPE omx_base_component_SetParameter(OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nParamIndex, OMX_PTR ComponentParameterStructure)
part of the standard openmax function
OMX_ERRORTYPE omx_base_component_UseBuffer(OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE **ppBufferHdr, OMX_U32 nPortIndex, OMX_PTR pAppPrivate, OMX_U32 nSizeBytes, OMX_U8 *pBuffer)
OMX_ERRORTYPE omx_base_component_FillThisBuffer(OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE omx_base_component_DoStateSet(OMX_COMPONENTTYPE *openmaxStandComp, OMX_U32 destinationState)
OMX_ERRORTYPE omx_base_component_Destructor(OMX_COMPONENTTYPE *openmaxStandComp)
the base destructor for ST OpenMAX components
OMX_ERRORTYPE omx_base_component_ParameterSanityCheck(OMX_HANDLETYPE hComponent, OMX_U32 nPortIndex, OMX_PTR pStructure, size_t size)
OMX_ERRORTYPE omx_base_getQualityLevel(OMX_COMPONENTTYPE *openmaxStandComp, OMX_U32 *pQualityLevel)
void setHeader(OMX_PTR header, OMX_U32 size)
Simply fills the first two fields in any OMX structure with the size and the version.
OMX_ERRORTYPE omx_base_component_SetCallbacks(OMX_HANDLETYPE hComponent, OMX_CALLBACKTYPE *pCallbacks, OMX_PTR pAppData)
standard OpenMAX function
OMX_ERRORTYPE omx_base_component_GetParameter(OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nParamIndex, OMX_PTR ComponentParameterStructure)
Part of the standard OpenMAX function.
OMX_ERRORTYPE omx_base_component_SetConfig(OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nIndex, OMX_PTR pComponentConfigStructure)
base SetConfig function
struct OMX_VENDOR_EXTRADATATYPE OMX_VENDOR_EXTRADATATYPE
struct internalRequestMessageType internalRequestMessageType
The container of an internal message.
OMX_ERRORTYPE omx_base_component_GetExtensionIndex(OMX_HANDLETYPE hComponent, OMX_STRING cParameterName, OMX_INDEXTYPE *pIndexType)
base function not implemented
@ OMX_IndexVendorOutputFilename
@ OMX_IndexVendorInputFilename
@ OMX_IndexParameterThreadsID
@ OMX_IndexVendorCompPropTunnelFlags
void base_constructor_remove_garbage_collected(omx_base_component_PrivateType *omx_base_component_Private)
OMX_ERRORTYPE omx_base_component_UseEGLImage(OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE **ppBufferHdr, OMX_U32 nPortIndex, OMX_PTR pAppPrivate, void *eglImage)
INTERNAL_MESSAGE_TYPE
Enumerates all the possible types of messages handled internally by the component.
struct OMX_VENDOR_PROP_TUNNELSETUPTYPE OMX_VENDOR_PROP_TUNNELSETUPTYPE
OMX_ERRORTYPE omx_base_component_GetConfig(OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nIndex, OMX_PTR pComponentConfigStructure)
base GetConfig function
void * compMessageHandlerFunction(void *)
Component's message handler thread function.
OMX_ERRORTYPE checkHeader(OMX_PTR header, OMX_U32 size)
Checks the header of a structure for consistency with size and spec version.
OMX_ERRORTYPE omx_base_component_FreeBuffer(OMX_HANDLETYPE hComponent, OMX_U32 nPortIndex, OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE omx_base_setQualityLevel(OMX_COMPONENTTYPE *openmaxStandComp, OMX_U32 nQualityLevel)
OMX_ERRORTYPE omx_base_component_ComponentTunnelRequest(OMX_HANDLETYPE hComp, OMX_U32 nPort, OMX_HANDLETYPE hTunneledComp, OMX_U32 nTunneledPort, OMX_TUNNELSETUPTYPE *pTunnelSetup)
@ OMX_TransStateExecutingToPause
@ OMX_TransStatePauseToExecuting
@ OMX_TransStateExecutingToIdle
@ OMX_TransStateIdleToLoaded
@ OMX_TransStatePauseToIdle
@ OMX_TransStateIdleToPause
@ OMX_TransStateIdleToExecuting
@ OMX_TransStateLoadedToIdle
OMX_ERRORTYPE omx_base_component_ComponentRoleEnum(OMX_HANDLETYPE hComponent, OMX_U8 *cRole, OMX_U32 nIndex)
Enumerates all the role of the component.
OMX_TUNNELSETUPTYPE nTunnelSetup
The container of an internal message.