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);
109 *(line+index_readline) = fgetc(omxregistryfp);
110 if ((*(line+index_readline) ==
'\n') || (*(line+index_readline) ==
'\0')) {
115 *(line+index_readline) =
'\0';
119 if ((*line ==
' ') && (*(line+1) ==
'=')) {
123 strcpy(libname, line);
125 if((handle = dlopen(libname, RTLD_NOW)) == NULL) {
130 if ((fptr = dlsym(handle,
"omx_component_library_Setup")) == NULL) {
131 DEBUG(
DEB_LEV_ERR,
"the library %s is not compatible with ST static component loader - %s\n", libname, dlerror());
133 num_of_comp = (int)(*fptr)(NULL);
134 templateList = realloc(templateList, (listindex + num_of_comp + 1) *
sizeof (
stLoaderComponentType*));
135 templateList[listindex + num_of_comp] = NULL;
137 for (i = 0; i<num_of_comp; i++) {
140 (*fptr)(stComponentsTemp);
141 for (i = 0; i<num_of_comp; i++) {
142 templateList[listindex + i] = stComponentsTemp[i];
143 DEBUG(
DEB_LEV_FULL_SEQ,
"In %s comp name[%d]=%s\n",__func__,listindex + i,templateList[listindex + i]->name);
145 free(stComponentsTemp);
146 stComponentsTemp = NULL;
157 fclose(omxregistryfp);
180 while(templateList[i]) {
181 if(templateList[i]->name_requested){
182 free(templateList[i]->name_requested);
187 if(templateList[i]->name_specific[j]) {
188 free(templateList[i]->name_specific[j]);
191 if(templateList[i]->role_specific[j]){
192 free(templateList[i]->role_specific[j]);
197 if(templateList[i]->name_specific){
198 free(templateList[i]->name_specific);
201 if(templateList[i]->role_specific){
202 free(templateList[i]->role_specific);
205 if(templateList[i]->name){
206 free(templateList[i]->name);
207 templateList[i]->
name=NULL;
209 free(templateList[i]);
210 templateList[i] = NULL;
221 DEBUG(
DEB_LEV_ERR,
"In %s Error %d in dlclose of lib %i\n", __func__,err,i);
248 int componentPosition = -1;
257 while(templateList[i]) {
258 if(!strcmp(templateList[i]->name, cComponentName)) {
260 componentPosition = i;
264 if(!strcmp(templateList[i]->name_specific[j], cComponentName)) {
266 componentPosition = i;
270 if(componentPosition != -1) {
276 if (componentPosition == -1) {
277 DEBUG(
DEB_LEV_ERR,
"Component not found with current ST static component loader.\n");
284 if (templateList[componentPosition]->name_requested == NULL)
290 if (!openmaxStandComp) {
293 eError = templateList[componentPosition]->
constructor(openmaxStandComp,cComponentName);
296 *pHandle = openmaxStandComp;
303 free(openmaxStandComp);
304 openmaxStandComp = NULL;
310 *pHandle = openmaxStandComp;
325 if (priv->
loader != loader) {
350 unsigned int j, index = 0;
356 while(templateList[i]) {
357 if (index == nIndex) {
358 strncpy(cComponentName, templateList[i]->name, nNameLength);
363 if (templateList[i]->name_specific_length > 0) {
365 if (index == nIndex) {
366 strncpy(cComponentName,templateList[i]->name_specific[j], nNameLength);
400 unsigned int j, index;
401 unsigned int max_roles = *pNumRoles;
407 while (templateList[i]) {
408 if(!strcmp(templateList[i]->name, compName)) {
417 if (index < max_roles) {
418 strcpy ((
char*)*(roles+index), templateList[i]->role_specific[index]);
424 if(!strcmp(templateList[i]-> name_specific[j], compName)) {
432 strcpy ((
char*)*roles , templateList[i]->role_specific[j]);
443 DEBUG(
DEB_LEV_ERR,
"no component match in whole template list has been found\n");
467 int max_entries = *pNumComps;
472 while(templateList[i]) {
474 if (!strcmp(templateList[i]->role_specific[j], role)) {
475 if (compNames != NULL) {
476 if (num_comp < max_entries) {
477 strcpy((
char*)(compNames[num_comp]), templateList[i]->name);
486 *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
char * componentsRegistryGetFilename()
Get registry filename This function returns the name of the registry file for the components loaded w...
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.
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.