27 #ifndef OMX_COMPONENT_PATH
28 #define OMX_COMPONENT_PATH "/usr/lib/bellagio/"
34 #include <sys/types.h>
62 ste_static_loader = loader;
100 templateList[0] = NULL;
103 while((dp = readdir(dirp)) != NULL) {
104 int len = strlen(dp->d_name);
109 if(strncmp(dp->d_name+len-3,
".so", 3) == 0) {
113 strcat(lib_absolute_path, dp->d_name);
115 if((handle = dlopen(lib_absolute_path, RTLD_NOW)) == NULL) {
116 DEBUG(
DEB_LEV_ERR,
"could not load %s: %s\n", lib_absolute_path, dlerror());
120 if ((fptr = dlsym(handle,
"omx_component_library_Setup")) == NULL) {
121 DEBUG(
DEB_LEV_ERR,
"the library %s is not compatible with ST static component loader - %s\n", lib_absolute_path, dlerror());
123 num_of_comp = (int)(*fptr)(NULL);
125 templateList[listindex + num_of_comp] = NULL;
127 for (i = 0; i<num_of_comp; i++) {
130 (*fptr)(stComponentsTemp);
131 for (i = 0; i<num_of_comp; i++) {
132 templateList[listindex + i] = stComponentsTemp[i];
133 DEBUG(
DEB_LEV_FULL_SEQ,
"In %s comp name[%d]=%s\n",__func__,listindex + i,templateList[listindex + i]->name);
136 free(stComponentsTemp);
137 stComponentsTemp = NULL;
166 while(templateList[i]) {
167 if(templateList[i]->name_requested){
168 free(templateList[i]->name_requested);
173 if(templateList[i]->name_specific[j]) {
174 free(templateList[i]->name_specific[j]);
177 if(templateList[i]->role_specific[j]){
178 free(templateList[i]->role_specific[j]);
183 if(templateList[i]->name_specific){
184 free(templateList[i]->name_specific);
187 if(templateList[i]->role_specific){
188 free(templateList[i]->role_specific);
191 if(templateList[i]->name){
192 free(templateList[i]->name);
193 templateList[i]->
name=NULL;
195 free(templateList[i]);
196 templateList[i] = NULL;
207 DEBUG(
DEB_LEV_ERR,
"In %s Error %d in dlclose of lib %i\n", __func__,err,i);
234 int componentPosition = -1;
243 while(templateList[i]) {
244 if(!strcmp(templateList[i]->name, cComponentName)) {
246 componentPosition = i;
250 if(!strcmp(templateList[i]->name_specific[j], cComponentName)) {
252 componentPosition = i;
256 if(componentPosition != -1) {
262 if (componentPosition == -1) {
263 DEBUG(
DEB_LEV_ERR,
"Component not found with current ST static component loader.\n");
270 if (templateList[componentPosition]->name_requested == NULL)
276 if (!openmaxStandComp) {
279 eError = templateList[componentPosition]->
constructor(openmaxStandComp,cComponentName);
282 *pHandle = openmaxStandComp;
289 free(openmaxStandComp);
290 openmaxStandComp = NULL;
296 *pHandle = openmaxStandComp;
311 if (priv->
loader != loader) {
336 unsigned int j, index = 0;
342 while(templateList[i]) {
343 if (index == nIndex) {
344 strncpy(cComponentName, templateList[i]->name, nNameLength);
349 if (templateList[i]->name_specific_length > 0) {
351 if (index == nIndex) {
352 strncpy(cComponentName,templateList[i]->name_specific[j], nNameLength);
386 unsigned int j, index;
387 unsigned int max_roles = *pNumRoles;
393 while (templateList[i]) {
394 if(!strcmp(templateList[i]->name, compName)) {
403 if (index < max_roles) {
404 strcpy ((
char*)*(roles+index), templateList[i]->role_specific[index]);
410 if(!strcmp(templateList[i]-> name_specific[j], compName)) {
418 strcpy ((
char*)*roles , templateList[i]->role_specific[j]);
429 DEBUG(
DEB_LEV_ERR,
"no component match in whole template list has been found\n");
453 int max_entries = *pNumComps;
458 while(templateList[i]) {
460 if (!strcmp(templateList[i]->role_specific[j], role)) {
461 if (compNames != NULL) {
462 if (num_comp < max_entries) {
463 strcpy((
char*)(compNames[num_comp]), templateList[i]->name);
472 *pNumComps = num_comp;