26 #ifndef _OMX_BASE_COMPONENT_H_ 27 #define _OMX_BASE_COMPONENT_H_ 35 #include <asm/unistd.h> 37 #ifdef ANDROID_COMPILATION 38 #include <oscl_base_macros.h> 40 #define OSCL_IMPORT_REF 41 #define OSCL_EXPORT_REF 54 #define DEFAULT_IN_BUFFER_SIZE 4 * 1024 56 #define DEFAULT_OUT_BUFFER_SIZE 32 * 1024 // TODO - check this size is ok 58 #define DEFAULT_MIME_STRING_LENGTH 128 62 #define OMX_BUFFERFLAG_KEY_FRAME 0x11000000 123 #define omx_base_component_PrivateType_FIELDS \ 124 OMX_COMPONENTTYPE *openmaxStandComp; \ 125 omx_base_PortType **ports; \ 126 OMX_PORT_PARAM_TYPE sPortTypesParam[NUM_DOMAINS]; \ 129 OMX_STATETYPE state; \ 130 OMX_TRANS_STATETYPE transientState; \ 135 OMX_CALLBACKTYPE* callbacks; \ 137 OMX_PTR callbackData; \ 139 queue_t* messageQueue;\ 141 OMX_U32 nGroupPriority; \ 143 OMX_PARAM_BELLAGIOTHREADS_ID* bellagioThreads;\ 144 OMX_BOOL bIsEOSReached; \ 145 OMX_MARKTYPE pMark; \ 146 pthread_mutex_t flush_mutex; \ 147 tsem_t* flush_all_condition; \ 148 tsem_t* flush_condition; \ 151 pthread_t messageHandlerThread; \ 152 int bufferMgmtThreadID; \ 153 pthread_t bufferMgmtThread; \ 155 void* (*BufferMgmtFunction)(void* param); \ 156 OMX_ERRORTYPE (*messageHandler)(OMX_COMPONENTTYPE*,internalRequestMessageType*); \ 157 OMX_ERRORTYPE (*DoStateSet)(OMX_COMPONENTTYPE *openmaxStandComp, OMX_U32); \ 158 OMX_ERRORTYPE (*destructor)(OMX_COMPONENTTYPE *openmaxStandComp); \ 159 OMX_ERRORTYPE (*getQualityLevel)(OMX_COMPONENTTYPE *openmaxStandComp, OMX_U32* pQualityLevel); \ 160 OMX_ERRORTYPE (*setQualityLevel)(OMX_COMPONENTTYPE *openmaxStandComp, OMX_U32 nQualityLevel); \ 161 OMX_U32 nqualitylevels; \ 162 multiResourceDescriptor** multiResourceLevel; \ 163 int currentQualityLevel; 164 ENDCLASS(omx_base_component_PrivateType) 281 OMX_PTR ComponentParameterStructure);
294 OMX_PTR ComponentParameterStructure);
306 OMX_PTR pComponentConfigStructure);
318 OMX_PTR pComponentConfigStructure);
OMX_ERRORTYPE omx_base_component_UseBuffer(OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE **ppBufferHdr, OMX_U32 nPortIndex, OMX_PTR pAppPrivate, OMX_U32 nSizeBytes, OMX_U8 *pBuffer)
void * compMessageHandlerFunction(void *)
Component's message handler thread function.
OMX_ERRORTYPE omx_base_getQualityLevel(OMX_COMPONENTTYPE *openmaxStandComp, OMX_U32 *pQualityLevel)
struct OMX_VENDOR_EXTRADATATYPE OMX_VENDOR_EXTRADATATYPE
OMX_TUNNELSETUPTYPE nTunnelSetup
OMX_ERRORTYPE omx_base_component_SetCallbacks(OMX_HANDLETYPE hComponent, OMX_CALLBACKTYPE *pCallbacks, OMX_PTR pAppData)
standard OpenMAX function
OMX_ERRORTYPE omx_base_component_GetState(OMX_HANDLETYPE hComponent, OMX_STATETYPE *pState)
unsigned char OMX_UUIDTYPE[128]
OMX_ERRORTYPE omx_base_component_SetConfig(OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nIndex, OMX_PTR pComponentConfigStructure)
base SetConfig function
OMX_ERRORTYPE omx_base_component_MessageHandler(OMX_COMPONENTTYPE *openmaxStandComp, internalRequestMessageType *message)
Extended OMXIL component interface for quality-of-service.
void setHeader(OMX_PTR header, OMX_U32 size)
Simply fills the first two fields in any OMX structure with the size and the version.
The container of an internal message.
INTERNAL_MESSAGE_TYPE
Enumerates all the possible types of messages handled internally by the component.
OMX_ERRORTYPE omx_base_component_ParameterSanityCheck(OMX_HANDLETYPE hComponent, OMX_U32 nPortIndex, OMX_PTR pStructure, size_t size)
OMX_ERRORTYPE omx_base_component_FreeBuffer(OMX_HANDLETYPE hComponent, OMX_U32 nPortIndex, OMX_BUFFERHEADERTYPE *pBuffer)
void base_constructor_remove_garbage_collected(omx_base_component_PrivateType *omx_base_component_Private)
OMX_ERRORTYPE omx_base_component_GetConfig(OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nIndex, OMX_PTR pComponentConfigStructure)
base GetConfig function
OMX_ERRORTYPE omx_base_component_Destructor(OMX_COMPONENTTYPE *openmaxStandComp)
the base destructor for ST OpenMAX components
OMX_ERRORTYPE omx_base_component_GetExtensionIndex(OMX_HANDLETYPE hComponent, OMX_STRING cParameterName, OMX_INDEXTYPE *pIndexType)
base function not implemented
OMX_ERRORTYPE omx_base_component_FillThisBuffer(OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE omx_base_setQualityLevel(OMX_COMPONENTTYPE *openmaxStandComp, OMX_U32 nQualityLevel)
OMX_ERRORTYPE omx_base_component_EmptyThisBuffer(OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE omx_base_component_SendCommand(OMX_HANDLETYPE hComponent, OMX_COMMANDTYPE Cmd, OMX_U32 nParam, OMX_PTR pCmdData)
standard SendCommand 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_ComponentRoleEnum(OMX_HANDLETYPE hComponent, OMX_U8 *cRole, OMX_U32 nIndex)
Enumerates all the role of the component.
OMX_ERRORTYPE omx_base_component_DoStateSet(OMX_COMPONENTTYPE *openmaxStandComp, OMX_U32 destinationState)
struct OMX_VENDOR_PROP_TUNNELSETUPTYPE OMX_VENDOR_PROP_TUNNELSETUPTYPE
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_GetParameter(OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nParamIndex, OMX_PTR ComponentParameterStructure)
Part of the standard OpenMAX function.
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_SetParameter(OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nParamIndex, OMX_PTR ComponentParameterStructure)
part of the standard openmax function
struct internalRequestMessageType internalRequestMessageType
The container of an internal message.
OMX_ERRORTYPE omx_base_component_UseEGLImage(OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE **ppBufferHdr, OMX_U32 nPortIndex, OMX_PTR pAppPrivate, void *eglImage)
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_ComponentTunnelRequest(OMX_HANDLETYPE hComp, OMX_U32 nPort, OMX_HANDLETYPE hTunneledComp, OMX_U32 nTunneledPort, OMX_TUNNELSETUPTYPE *pTunnelSetup)
OMX_ERRORTYPE omx_base_component_AllocateBuffer(OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE **ppBuffer, OMX_U32 nPortIndex, OMX_PTR pAppPrivate, OMX_U32 nSizeBytes)