31 #include <sys/types.h> 86 char *registry_filename;
87 int index_readline = 0;
92 omxregistryfp = fopen(registry_filename,
"r");
93 if (omxregistryfp == NULL){
94 DEBUG(
DEB_LEV_ERR,
"Cannot open OpenMAX registry file %s\n", registry_filename);
97 free(registry_filename);
101 templateList[0] = NULL;
103 fseek(omxregistryfp, 0, 0);
110 c1 = fgetc(omxregistryfp);
111 if (c1 == EOF)
break;
112 *(line+index_readline) = c1;
113 if ((*(line+index_readline) ==
'\n') || (*(line+index_readline) ==
'\0')) {
118 *(line+index_readline) =
'\0';
122 if ((*line ==
' ') && (*(line+1) ==
'=')) {
126 strcpy(libname, line);
128 if((handle = dlopen(libname, RTLD_NOW)) == NULL) {
133 if ((fptr = dlsym(handle,
"omx_component_library_Setup")) == NULL) {
134 DEBUG(
DEB_LEV_ERR,
"the library %s is not compatible with ST static component loader - %s\n", libname, dlerror());
136 num_of_comp = (int)(*fptr)(NULL);
137 templateList = realloc(templateList, (listindex + num_of_comp + 1) *
sizeof (
stLoaderComponentType*));
138 templateList[listindex + num_of_comp] = NULL;
140 for (i = 0; i<num_of_comp; i++) {
143 (*fptr)(stComponentsTemp);
144 for (i = 0; i<num_of_comp; i++) {
145 templateList[listindex + i] = stComponentsTemp[i];
146 DEBUG(
DEB_LEV_FULL_SEQ,
"In %s comp name[%d]=%s\n",__func__,listindex + i,templateList[listindex + i]->name);
148 free(stComponentsTemp);
149 stComponentsTemp = NULL;
160 fclose(omxregistryfp);
183 while(templateList[i]) {
184 if(templateList[i]->name_requested){
185 free(templateList[i]->name_requested);
190 if(templateList[i]->name_specific[j]) {
191 free(templateList[i]->name_specific[j]);
194 if(templateList[i]->role_specific[j]){
195 free(templateList[i]->role_specific[j]);
200 if(templateList[i]->name_specific){
201 free(templateList[i]->name_specific);
204 if(templateList[i]->role_specific){
205 free(templateList[i]->role_specific);
208 if(templateList[i]->name){
209 free(templateList[i]->name);
210 templateList[i]->
name=NULL;
212 free(templateList[i]);
213 templateList[i] = NULL;
224 DEBUG(
DEB_LEV_ERR,
"In %s Error %d in dlclose of lib %i\n", __func__,err,i);
251 int componentPosition = -1;
260 while(templateList[i]) {
261 if(!strcmp(templateList[i]->name, cComponentName)) {
263 componentPosition = i;
267 if(!strcmp(templateList[i]->name_specific[j], cComponentName)) {
269 componentPosition = i;
273 if(componentPosition != -1) {
279 if (componentPosition == -1) {
280 DEBUG(
DEB_LEV_ERR,
"Component not found with current ST static component loader.\n");
287 if (templateList[componentPosition]->name_requested == NULL)
293 if (!openmaxStandComp) {
296 eError = templateList[componentPosition]->
constructor(openmaxStandComp,cComponentName);
299 *pHandle = openmaxStandComp;
306 free(openmaxStandComp);
307 openmaxStandComp = NULL;
313 *pHandle = openmaxStandComp;
328 if (priv->
loader != loader) {
353 unsigned int j, index = 0;
359 while(templateList[i]) {
360 if (index == nIndex) {
361 strncpy(cComponentName, templateList[i]->name, nNameLength);
366 if (templateList[i]->name_specific_length > 0) {
368 if (index == nIndex) {
369 strncpy(cComponentName,templateList[i]->name_specific[j], nNameLength);
403 unsigned int j, index;
404 unsigned int max_roles = *pNumRoles;
410 while (templateList[i]) {
411 if(!strcmp(templateList[i]->name, compName)) {
420 if (index < max_roles) {
421 strcpy ((
char*)*(roles+index), templateList[i]->role_specific[index]);
427 if(!strcmp(templateList[i]-> name_specific[j], compName)) {
435 strcpy ((
char*)*roles , templateList[i]->role_specific[j]);
446 DEBUG(
DEB_LEV_ERR,
"no component match in whole template list has been found\n");
470 int max_entries = *pNumComps;
475 while(templateList[i]) {
477 if (!strcmp(templateList[i]->role_specific[j], role)) {
478 if (compNames != NULL) {
479 if (num_comp < max_entries) {
480 strcpy((
char*)(compNames[num_comp]), templateList[i]->name);
489 *pNumComps = num_comp;
OMX_ERRORTYPE(* BOSA_InitComponentLoader)(struct BOSA_COMPONENTLOADER *loader)
The constructor of the component loader.
OMX_ERRORTYPE BOSA_ST_GetComponentsOfRole(BOSA_COMPONENTLOADER *loader, OMX_STRING role, OMX_U32 *pNumComps, OMX_U8 **compNames)
The specific version of OMX_GetComponentsOfRole.
OMX_ERRORTYPE BOSA_ST_DeInitComponentLoader(BOSA_COMPONENTLOADER *loader)
The destructor of the ST specific component loader.
OMX_ERRORTYPE(* ComponentDeInit)(OMX_IN OMX_HANDLETYPE hComponent)
#define DEB_LEV_SIMPLE_SEQ
OMX_ERRORTYPE BOSA_ST_InitComponentLoader(BOSA_COMPONENTLOADER *loader)
the ST static loader constructor
#define DEBUG(n, fmt, args...)
Component loader entry points.
OMX_ERRORTYPE(* constructor)(OMX_COMPONENTTYPE *, OMX_STRING cComponentName)
OMX_ERRORTYPE(* BOSA_DestroyComponent)(struct BOSA_COMPONENTLOADER *loader, OMX_HANDLETYPE hComponent)
The component destructor of the current component loader.
void * handleLibList[100]
void * loaderPrivate
The reference to the current component loader private data.
OMX_ERRORTYPE BOSA_ST_GetRolesOfComponent(BOSA_COMPONENTLOADER *loader, OMX_STRING compName, OMX_U32 *pNumRoles, OMX_U8 **roles)
The specific version of OMX_GetRolesOfComponent.
OMX_ERRORTYPE BOSA_ST_DestroyComponent(BOSA_COMPONENTLOADER *loader, OMX_HANDLETYPE hComponent)
destructor of the requested OpenMAX component
OMX_ERRORTYPE(* BOSA_GetComponentsOfRole)(struct BOSA_COMPONENTLOADER *loader, OMX_STRING role, OMX_U32 *pNumComps, OMX_U8 **compNames)
This function implements the OMX_GetComponentsOfRole standard function for the current component load...
OMX_ERRORTYPE BOSA_ST_CreateComponent(BOSA_COMPONENTLOADER *loader, OMX_HANDLETYPE *pHandle, OMX_STRING cComponentName, OMX_PTR pAppData, OMX_CALLBACKTYPE *pCallBacks)
creator of the requested OpenMAX component
the private data structure handled by the ST static loader that described an OpenMAX component ...
#define OMX_MAX_STRINGNAME_SIZE
OMX_ERRORTYPE(* BOSA_DeInitComponentLoader)(struct BOSA_COMPONENTLOADER *loader)
The destructor of the component loader.
OMX_ERRORTYPE RM_Deinit()
OMX_PTR pComponentPrivate
OMX_ERRORTYPE(* BOSA_GetRolesOfComponent)(struct BOSA_COMPONENTLOADER *loader, OMX_STRING compName, OMX_U32 *pNumRoles, OMX_U8 **roles)
This function implements the OMX_GetRolesOfComponent standard function for the current component load...
#define DEB_LEV_FUNCTION_NAME
OMX_ERRORTYPE BOSA_ST_ComponentNameEnum(BOSA_COMPONENTLOADER *loader, OMX_STRING cComponentName, OMX_U32 nNameLength, OMX_U32 nIndex)
This function search for the index from 0 to end of the list.
char * componentsRegistryGetFilenameCheck(int check_exists)
OMX_ERRORTYPE(* BOSA_ComponentNameEnum)(struct BOSA_COMPONENTLOADER *loader, OMX_STRING cComponentName, OMX_U32 nNameLength, OMX_U32 nIndex)
An enumerator of the components handled by the current component loader.
OMX_ERRORTYPE(* BOSA_CreateComponent)(struct BOSA_COMPONENTLOADER *loader, OMX_HANDLETYPE *pHandle, OMX_STRING cComponentName, OMX_PTR pAppData, OMX_CALLBACKTYPE *pCallBacks)
The component constructor of the current component loader.
unsigned int name_specific_length
void st_static_setup_component_loader(BOSA_COMPONENTLOADER *st_static_loader)
The initialization of the ST specific component loader.