27#ifndef OMX_COMPONENT_PATH
28#define OMX_COMPONENT_PATH "/usr/lib/bellagio/"
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;
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;
#define OMX_MAX_STRINGNAME_SIZE
@ OMX_ErrorInsufficientResources
@ OMX_ErrorComponentNotFound
#define DEB_LEV_FUNCTION_NAME
#define DEB_LEV_SIMPLE_SEQ
#define DEBUG(n, fmt, args...)
OMX_ERRORTYPE RM_Deinit()
OMX_ERRORTYPE BOSA_STE_InitComponentLoader(BOSA_COMPONENTLOADER *loader)
the ST static loader constructor
void setup_component_loader(BOSA_COMPONENTLOADER *loader)
The initialization of the ST specific component loader.
#define OMX_COMPONENT_PATH
OMX_ERRORTYPE BOSA_STE_CreateComponent(BOSA_COMPONENTLOADER *loader, OMX_HANDLETYPE *pHandle, OMX_STRING cComponentName, OMX_PTR pAppData, OMX_CALLBACKTYPE *pCallBacks)
creator of the requested OpenMAX component
OMX_ERRORTYPE BOSA_STE_GetRolesOfComponent(BOSA_COMPONENTLOADER *loader, OMX_STRING compName, OMX_U32 *pNumRoles, OMX_U8 **roles)
The specific version of OMX_GetRolesOfComponent.
OMX_ERRORTYPE BOSA_STE_DeInitComponentLoader(BOSA_COMPONENTLOADER *loader)
The destructor of the ST specific component loader.
OMX_ERRORTYPE BOSA_STE_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_STE_DestroyComponent(BOSA_COMPONENTLOADER *loader, OMX_HANDLETYPE hComponent)
destructor of the requested OpenMAX component
OMX_ERRORTYPE BOSA_STE_GetComponentsOfRole(BOSA_COMPONENTLOADER *loader, OMX_STRING role, OMX_U32 *pNumComps, OMX_U8 **compNames)
The specific version of OMX_GetComponentsOfRole.
void * handleLibList[100]
Component loader entry points.
OMX_ERRORTYPE(* BOSA_InitComponentLoader)(struct BOSA_COMPONENTLOADER *loader)
The constructor of the component loader.
void * loaderPrivate
The reference to the current component loader private data.
OMX_ERRORTYPE(* SetCallbacks)(OMX_HANDLETYPE hComponent, OMX_CALLBACKTYPE *pCallbacks, OMX_PTR pAppData)
OMX_ERRORTYPE(* ComponentDeInit)(OMX_HANDLETYPE hComponent)
OMX_PTR pComponentPrivate
the private data structure handled by the ST static loader that described an OpenMAX component
unsigned int name_specific_length
OMX_ERRORTYPE(* constructor)(OMX_COMPONENTTYPE *, OMX_STRING cComponentName)