char *tComponentName[MAXCOMP][2] = {
{"OMX.TI.JPEG.Encoder", "image_encoder.jpeg"},
{"OMX.TI.Video.Decoder", "video_decoder.avc"},
{"OMX.TI.Video.Decoder", "video_decoder.mpeg4"},
{"OMX.TI.Video.Decoder", "video_decoder.wmv"},
{"OMX.TI.Video.encoder", "video_encoder.mpeg4"},
{"OMX.TI.Video.encoder", "video_encoder.h263"},
{"OMX.TI.Video.encoder", "video_encoder.avc"},
#ifdef BUILD_WITH_TI_AUDIO
{"OMX.TI.MP3.decode", "audio_decoder.mp3"},
{"OMX.TI.AAC.encode", "audio_encoder.aac"},
{"OMX.TI.AAC.decode", "audio_decoder.aac"},
{"OMX.TI.WMA.decode", "audio_decoder.wma"},
{"OMX.TI.WBAMR.decode", "audio_decoder.amrwb"},
{"OMX.TI.AMR.decode", "audio_decoder.amrnb"},
{"OMX.TI.AMR.encode", "audio_encoder.amrnb"},
{"OMX.TI.WBAMR.encode", "audio_encoder.amrwb"},
#endif
{NULL, NULL},
};
typedef struct _ComponentTable {
OMX_STRING name;
OMX_U16 nRoles;
OMX_STRING pRoleArray[MAX_ROLES];
OMX_HANDLETYPE* pHandle[MAX_CONCURRENT_INSTANCES];
int refCount;
}ComponentTable;
OMX_ERRORTYPE TIOMX_BuildComponentTable()
{
OMX_ERRORTYPE eError = OMX_ErrorNone;
OMX_CALLBACKTYPE sCallbacks;
int j = 0;
int numFiles = 0;
int i;
for (i = 0, numFiles = 0; i < MAXCOMP; i ++) {
if (tComponentName[i][0] == NULL) {
break;
}
if (numFiles <= MAX_TABLE_SIZE){
for (j = 0; j < numFiles; j ++) {
if (!strcmp(componentTable[j].name, tComponentName[i][0])) {
if (tComponentName[i][1] != NULL)
{
componentTable[j].pRoleArray[componentTable[j].nRoles] = tComponentName[i][1];
componentTable[j].pHandle[componentTable[j].nRoles] = NULL;
componentTable[j].nRoles ++;
}
break;
}
}
if (j == numFiles) {
if (tComponentName[i][1] != NULL){
componentTable[numFiles].pRoleArray[0] = tComponentName[i][1];
componentTable[numFiles].nRoles = 1;
}
strcpy(compName[numFiles], tComponentName[i][0]);
componentTable[numFiles].name = compName[numFiles];
componentTable[numFiles].refCount = 0;
numFiles ++;
}
}
}
tableCount = numFiles;
if (eError != OMX_ErrorNone){
ALOGE("Could not build Component Table\n");
}
return eError;
}