56 if (omx_base_component_Private->
name) {
57 free(omx_base_component_Private->
name);
59 if (omx_base_component_Private->
bStateSem) {
61 free(omx_base_component_Private->
bStateSem);
63 if (omx_base_component_Private->
bMgmtSem) {
65 free(omx_base_component_Private->
bMgmtSem);
75 if (omx_base_component_Private) {
76 free(omx_base_component_Private);
106 if (!omx_base_component_Private) {
126 if (!omx_base_component_Private->
messageSem) {
136 if(!omx_base_component_Private->
bMgmtSem) {
138 if (!omx_base_component_Private->
bMgmtSem) {
149 if(!omx_base_component_Private->
bStateSem) {
151 if (!omx_base_component_Private->
bStateSem) {
191 if (!omx_base_component_Private->
name) {
195 strcpy(omx_base_component_Private->
name,cComponentName);
198 omx_base_component_Private->
callbacks = NULL;
201 omx_base_component_Private->
nGroupID = 0;
222 pthread_mutex_init(&omx_base_component_Private->
flush_mutex, NULL);
276 omx_base_component_Private->
callbacks=NULL;
296 if(omx_base_component_Private->
bMgmtSem){
298 free(omx_base_component_Private->
bMgmtSem);
299 omx_base_component_Private->
bMgmtSem=NULL;
309 if(omx_base_component_Private->
bStateSem){
311 free(omx_base_component_Private->
bStateSem);
312 omx_base_component_Private->
bStateSem=NULL;
315 if(omx_base_component_Private->
name){
316 free(omx_base_component_Private->
name);
317 omx_base_component_Private->
name=NULL;
320 pthread_mutex_destroy(&omx_base_component_Private->
flush_mutex);
352 omx_base_component_Private->
destructor(openmaxStandComp);
391 switch(omx_base_component_Private->
state){
410 pPort = omx_base_component_Private->
ports[i];
467 switch(omx_base_component_Private->
state){
488 switch(omx_base_component_Private->
state){
501 pPort = omx_base_component_Private->
ports[i];
559 pPort = omx_base_component_Private->
ports[i];
575 pPort = omx_base_component_Private->
ports[i];
595 switch(omx_base_component_Private->
state) {
617 switch(omx_base_component_Private->
state) {
630 pPort = omx_base_component_Private->
ports[i];
653 pPort=omx_base_component_Private->
ports[i];
654 DEBUG(
DEB_LEV_PARAMS,
"In %s: state transition Paused 2 Executing, nelem=%d,semval=%d,Buf Count Actual=%d\n", __func__,
682 switch(omx_base_component_Private->
state) {
722 if (header == NULL) {
727 if(*((
OMX_U32*)header) != size) {
728 DEBUG(
DEB_LEV_ERR,
"In %s the header has a wrong size %i should be %i\n",__func__,(
int)*((
OMX_U32*)header),(
int)size);
774 if (nPortIndex >= nNumPorts) {
775 DEBUG(
DEB_LEV_ERR,
"Bad Port index %i when the component has %i ports\n", (
int)nPortIndex, (
int)nNumPorts);
779 pPort = omx_base_component_Private->
ports[nPortIndex];
783 DEBUG(
DEB_LEV_ERR,
"In %s Incorrect State=%x lineno=%d\n",__func__,omx_base_component_Private->
state,__LINE__);
814 strcpy(pComponentName, omx_base_component_Private->
name);
827 uuid[0] = (
OMX_U32)omx_component;
830 memcpy(*pComponentUUID, uuid,
sizeof(uuid));
848 strcat((
char*)cRole,
"\0");
868 omx_base_component_Private->
callbacks = pCallbacks;
876 pPort = omx_base_component_Private->
ports[i];
899 OMX_PTR ComponentParameterStructure) {
914 if (ComponentParameterStructure == NULL) {
917 switch(nParamIndex) {
963 pPort = omx_base_component_Private->
ports[pBufferSupplier->
nPortIndex];
1002 DEBUG(
DEB_LEV_ERR,
"In %s OMX_IndexVendorCompPropTunnelFlags nPortIndex=%d Line=%d \n",
1003 __func__,(
int)pPropTunnelSetup->
nPortIndex,__LINE__);
1008 pPort = omx_base_component_Private->
ports[pPropTunnelSetup->
nPortIndex];
1033 OMX_PTR ComponentParameterStructure) {
1045 if (ComponentParameterStructure == NULL) {
1050 switch(nParamIndex) {
1074 OMX_U32 j,old_nBufferCountActual=0;
1112 DEBUG(
DEB_LEV_ERR,
"In %s wrong port domain. Out of OpenMAX scope\n",__func__);
1154 if(pBufferSupplier == NULL) {
1182 pPort = omx_base_component_Private->
ports[pBufferSupplier->
nPortIndex];
1235 OMX_PTR pComponentConfigStructure) {
1249 OMX_PTR pComponentConfigStructure) {
1264 if(strcmp(cParameterName,
"OMX.st.index.param.BellagioThreadsID") == 0) {
1283 *pState = omx_base_component_Private->
state;
1309 messageQueue = omx_base_component_Private->
messageQueue;
1310 messageSem = omx_base_component_Private->
messageSem;
1331 pPort = omx_base_component_Private->
ports[i];
1422 errQue =
queue(messageQueue, message);
1453 if (omx_base_component_Private == NULL) {
1465 if(message == NULL){
1470 omx_base_component_Private->
messageHandler(openmaxStandComp, message);
1519 if (omx_base_component_Private->
callbacks) {
1548 pPort=omx_base_component_Private->
ports[i];
1580 pPort=omx_base_component_Private->
ports[i];
1622 pPort=omx_base_component_Private->
ports[i];
1632 pPort=omx_base_component_Private->
ports[i];
1690 pPort=omx_base_component_Private->
ports[i];
1748 pPort=omx_base_component_Private->
ports[i];
1794 pPort = omx_base_component_Private->
ports[nPortIndex];
1797 DEBUG(
DEB_LEV_ERR,
"Out of %s for component %p with err %i\n", __func__, hComponent, (
int)
err);
1823 pPort = omx_base_component_Private->
ports[nPortIndex];
1824 err = pPort->
Port_UseBuffer(pPort, ppBufferHdr, nPortIndex, pAppPrivate, nSizeBytes, pBuffer);
1826 DEBUG(
DEB_LEV_ERR,
"Out of %s for component %p with err %i\n", __func__, hComponent, (
int)
err);
1859 pPort = omx_base_component_Private->
ports[nPortIndex];
1862 DEBUG(
DEB_LEV_ERR,
"Out of %s for component %p with err %i\n", __func__, hComponent, (
int)
err);
1887 DEBUG(
DEB_LEV_ERR,
"In %s: wrong port direction in Component %s\n", __func__,omx_base_component_Private->
name);
1917 DEBUG(
DEB_LEV_ERR,
"In %s: wrong port(%d) direction(%x) pBuffer=%p in Component %s\n", __func__,
1949 pPort = omx_base_component_Private->
ports[nPort];
1952 DEBUG(
DEB_LEV_ERR,
"Out of %s for component %p with err %i\n", __func__, hComponent, (
int)
err);
1972 if ((nQualityLevel > 0) && (nQualityLevel <= omx_base_component_Private->nqualitylevels)) {
#define OMX_MAX_STRINGNAME_SIZE
@ OMX_ErrorInsufficientResources
@ OMX_ErrorNotImplemented
@ OMX_ErrorUnsupportedIndex
@ OMX_ErrorIncorrectStateTransition
@ OMX_ErrorVersionMismatch
@ OMX_ErrorIncorrectStateOperation
@ OMX_IndexParamPriorityMgmt
@ OMX_IndexParamVideoInit
@ OMX_IndexParamImageInit
@ OMX_IndexParamAudioInit
@ OMX_IndexParamCompBufferSupplier
@ OMX_IndexParamPortDefinition
@ OMX_IndexParamOtherInit
unsigned char OMX_UUIDTYPE[128]
OMX_ERRORTYPE(* AllocateBuffer)(OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE **ppBuffer, OMX_U32 nPortIndex, OMX_PTR pAppPrivate, OMX_U32 nSizeBytes)
OMX_ERRORTYPE(* EmptyBufferDone)(OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE(* FreeBuffer)(OMX_HANDLETYPE hComponent, OMX_U32 nPortIndex, OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE(* UseBuffer)(OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE **ppBufferHdr, OMX_U32 nPortIndex, OMX_PTR pAppPrivate, OMX_U32 nSizeBytes, OMX_U8 *pBuffer)
OMX_ERRORTYPE(* EmptyThisBuffer)(OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE(* UseEGLImage)(OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE **ppBufferHdr, OMX_U32 nPortIndex, OMX_PTR pAppPrivate, void *eglImage)
OMX_ERRORTYPE(* FillThisBuffer)(OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE(* FillBufferDone)(OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_BUFFERHEADERTYPE *pBuffer)
@ OMX_BufferSupplyUnspecified
struct OMX_COMPONENTTYPE OMX_COMPONENTTYPE
#define OMX_SetParameter( hComponent, nParamIndex, pComponentParameterStructure)
@ OMX_StateWaitForResources
OMX_ERRORTYPE(* ComponentTunnelRequest)(OMX_HANDLETYPE hComp, OMX_U32 nPort, OMX_HANDLETYPE hTunneledComp, OMX_U32 nTunneledPort, OMX_TUNNELSETUPTYPE *pTunnelSetup)
void * compMessageHandlerFunction(void *param)
Component's message handler thread function.
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_ComponentTunnelRequest(OMX_HANDLETYPE hComponent, OMX_U32 nPort, OMX_HANDLETYPE hTunneledComp, OMX_U32 nTunneledPort, OMX_TUNNELSETUPTYPE *pTunnelSetup)
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
OMX_ERRORTYPE omx_base_component_GetExtensionIndex(OMX_HANDLETYPE hComponent, OMX_STRING cParameterName, OMX_INDEXTYPE *pIndexType)
base function not implemented
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)
OMX_ERRORTYPE omx_base_component_GetConfig(OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nIndex, OMX_PTR pComponentConfigStructure)
base GetConfig 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_ComponentRoleEnum(OMX_HANDLETYPE hComponent, OMX_U8 *cRole, OMX_U32 nIndex)
Enumerates all the roles of the component.
@ OMX_IndexParameterThreadsID
@ OMX_IndexVendorCompPropTunnelFlags
@ OMX_TransStateExecutingToIdle
@ OMX_TransStateIdleToLoaded
@ OMX_TransStatePauseToIdle
@ OMX_TransStateLoadedToIdle
#define PORT_IS_TUNNELED_N_BUFFER_SUPPLIER(pPort)
#define PORT_IS_BUFFER_SUPPLIER(pPort)
#define PORT_IS_TUNNELED(pPort)
#define PORT_IS_ENABLED(pPort)
#define DEB_LEV_FUNCTION_NAME
#define DEB_LEV_SIMPLE_SEQ
#define DEBUG(n, fmt, args...)
OMX_ERRORTYPE RM_removeFromWaitForResource(OMX_COMPONENTTYPE *openmaxStandComp)
OMX_ERRORTYPE RM_getResource(OMX_COMPONENTTYPE *openmaxStandComp)
OMX_ERRORTYPE RM_releaseResource(OMX_COMPONENTTYPE *openmaxStandComp)
OMX_ERRORTYPE RM_waitForResource(OMX_COMPONENTTYPE *openmaxStandComp)
int queue(queue_t *queue, void *data)
void * dequeue(queue_t *queue)
void queue_deinit(queue_t *queue)
int queue_init(queue_t *queue)
OMX_ERRORTYPE(* EventHandler)(OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_EVENTTYPE eEvent, OMX_U32 nData1, OMX_U32 nData2, OMX_PTR pEventData)
OMX_ERRORTYPE(* SendCommand)(OMX_HANDLETYPE hComponent, OMX_COMMANDTYPE Cmd, OMX_U32 nParam1, OMX_PTR pCmdData)
OMX_ERRORTYPE(* ComponentRoleEnum)(OMX_HANDLETYPE hComponent, OMX_U8 *cRole, OMX_U32 nIndex)
OMX_ERRORTYPE(* SetCallbacks)(OMX_HANDLETYPE hComponent, OMX_CALLBACKTYPE *pCallbacks, OMX_PTR pAppData)
OMX_ERRORTYPE(* GetParameter)(OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nParamIndex, OMX_PTR pComponentParameterStructure)
OMX_ERRORTYPE(* SetParameter)(OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nIndex, OMX_PTR pComponentParameterStructure)
OMX_ERRORTYPE(* ComponentDeInit)(OMX_HANDLETYPE hComponent)
OMX_ERRORTYPE(* SetConfig)(OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nIndex, OMX_PTR pComponentConfigStructure)
OMX_ERRORTYPE(* GetExtensionIndex)(OMX_HANDLETYPE hComponent, OMX_STRING cParameterName, OMX_INDEXTYPE *pIndexType)
OMX_PTR pApplicationPrivate
OMX_ERRORTYPE(* GetComponentVersion)(OMX_HANDLETYPE hComponent, OMX_STRING pComponentName, OMX_VERSIONTYPE *pComponentVersion, OMX_VERSIONTYPE *pSpecVersion, OMX_UUIDTYPE *pComponentUUID)
OMX_PTR pComponentPrivate
OMX_ERRORTYPE(* GetConfig)(OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nIndex, OMX_PTR pComponentConfigStructure)
OMX_ERRORTYPE(* GetState)(OMX_HANDLETYPE hComponent, OMX_STATETYPE *pState)
OMX_BOOL bFlagErrorConcealment
OMX_IMAGE_CODINGTYPE eCompressionFormat
OMX_NATIVE_WINDOWTYPE pNativeWindow
OMX_COLOR_FORMATTYPE eColorFormat
OMX_HANDLETYPE hMarkTargetComponent
long int nThreadBufferMngtID
long int nThreadMessageID
OMX_BUFFERSUPPLIERTYPE eBufferSupplier
union OMX_PARAM_PORTDEFINITIONTYPE::@0 format
OMX_PORTDOMAINTYPE eDomain
OMX_AUDIO_PORTDEFINITIONTYPE audio
OMX_OTHER_PORTDEFINITIONTYPE other
OMX_U32 nBufferCountActual
OMX_IMAGE_PORTDEFINITIONTYPE image
OMX_VIDEO_PORTDEFINITIONTYPE video
OMX_BUFFERSUPPLIERTYPE eSupplier
OMX_TUNNELSETUPTYPE nTunnelSetup
OMX_VIDEO_CODINGTYPE eCompressionFormat
OMX_NATIVE_DEVICETYPE pNativeRender
OMX_NATIVE_WINDOWTYPE pNativeWindow
OMX_BOOL bFlagErrorConcealment
OMX_COLOR_FORMATTYPE eColorFormat
The container of an internal message.
OMX_PARAM_PORTDEFINITIONTYPE sPortParam
OMX_ERRORTYPE(* Port_DisablePort)(omx_base_PortType *openmaxStandPort)
OMX_ERRORTYPE(* BufferProcessedCallback)(OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_BUFFERHEADERTYPE *pBuffer)
OMX_BOOL bIsTransientToEnabled
OMX_ERRORTYPE(* FlushProcessingBuffers)(omx_base_PortType *openmaxStandPort)
OMX_ERRORTYPE(* Port_EnablePort)(omx_base_PortType *openmaxStandPort)
OMX_ERRORTYPE(* Port_SendBufferFunction)(omx_base_PortType *openmaxStandPort, OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE(* Port_AllocateTunnelBuffer)(omx_base_PortType *openmaxStandPort, OMX_U32 nPortIndex)
pthread_mutex_t exitMutex
OMX_HANDLETYPE hTunneledComponent
OMX_ERRORTYPE(* ComponentTunnelRequest)(omx_base_PortType *openmaxStandPort, OMX_HANDLETYPE hTunneledComp, OMX_U32 nTunneledPort, OMX_TUNNELSETUPTYPE *pTunnelSetup)
BUFFER_STATUS_FLAG * bBufferStateAllocated
OMX_BUFFERSUPPLIERTYPE eBufferSupplier
OMX_ERRORTYPE(* Port_FreeBuffer)(omx_base_PortType *openmaxStandPort, OMX_U32 nPortIndex, OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE(* Port_UseBuffer)(omx_base_PortType *openmaxStandPort, OMX_BUFFERHEADERTYPE **ppBufferHdr, OMX_U32 nPortIndex, OMX_PTR pAppPrivate, OMX_U32 nSizeBytes, OMX_U8 *pBuffer)
OMX_BOOL bIsTransientToDisabled
OMX_BUFFERHEADERTYPE ** pInternalBufferStorage
OMX_ERRORTYPE(* Port_FreeTunnelBuffer)(omx_base_PortType *openmaxStandPort, OMX_U32 nPortIndex)
OMX_ERRORTYPE(* Port_AllocateBuffer)(omx_base_PortType *openmaxStandPort, OMX_BUFFERHEADERTYPE **pBuffer, OMX_U32 nPortIndex, OMX_PTR pAppPrivate, OMX_U32 nSizeBytes)
OMX_PARAM_BELLAGIOTHREADS_ID * bellagioThreads
OMX_CALLBACKTYPE * callbacks
tsem_t * flush_all_condition
OMX_COMPONENTTYPE * openmaxStandComp
pthread_t bufferMgmtThread
pthread_mutex_t flush_mutex
OMX_ERRORTYPE(* messageHandler)(OMX_COMPONENTTYPE *, internalRequestMessageType *)
OMX_ERRORTYPE(* DoStateSet)(OMX_COMPONENTTYPE *openmaxStandComp, OMX_U32)
OMX_ERRORTYPE(* getQualityLevel)(OMX_COMPONENTTYPE *openmaxStandComp, OMX_U32 *pQualityLevel)
OMX_ERRORTYPE(* setQualityLevel)(OMX_COMPONENTTYPE *openmaxStandComp, OMX_U32 nQualityLevel)
pthread_t messageHandlerThread
OMX_ERRORTYPE(* destructor)(OMX_COMPONENTTYPE *openmaxStandComp)
void *(* BufferMgmtFunction)(void *param)
OMX_TRANS_STATETYPE transientState
OMX_PORT_PARAM_TYPE sPortTypesParam[4]
omx_base_PortType ** ports
void tsem_deinit(tsem_t *tsem)
void tsem_signal(tsem_t *tsem)
void tsem_up(tsem_t *tsem)
int tsem_init(tsem_t *tsem, unsigned int val)
void tsem_down(tsem_t *tsem)
struct OMX_VERSIONTYPE::@1 s
char * errorName(OMX_ERRORTYPE error)