OpenMAXBellagio 0.9.3
library_entry_point.c
Go to the documentation of this file.
00001 
00031 #include <st_static_component_loader.h>
00032 #include <omx_clocksrc_component.h>
00033 
00047 int omx_component_library_Setup(stLoaderComponentType **stComponents) {
00048   OMX_U32 i;
00049 
00050   DEBUG(DEB_LEV_FUNCTION_NAME, "In %s \n",__func__);
00051 
00052   if (stComponents == NULL) {
00053     DEBUG(DEB_LEV_FUNCTION_NAME, "Out of %s \n",__func__);
00054     return 1; // Return Number of Component/s
00055   }
00056 
00057   stComponents[0]->componentVersion.s.nVersionMajor = 1;
00058   stComponents[0]->componentVersion.s.nVersionMinor = 1;
00059   stComponents[0]->componentVersion.s.nRevision = 1;
00060   stComponents[0]->componentVersion.s.nStep = 1;
00061 
00062   stComponents[0]->name = calloc(1,OMX_MAX_STRINGNAME_SIZE);
00063   if (stComponents[0]->name == NULL) {
00064     return OMX_ErrorInsufficientResources;
00065   }
00066 
00067   strcpy(stComponents[0]->name, CLOCK_COMP_NAME);
00068   stComponents[0]->name_specific_length = 1;
00069   stComponents[0]->constructor = omx_clocksrc_component_Constructor;
00070 
00071   stComponents[0]->name_specific = calloc(stComponents[0]->name_specific_length,sizeof(char *));
00072   stComponents[0]->role_specific = calloc(stComponents[0]->name_specific_length,sizeof(char *));
00073 
00074   for(i=0;i<stComponents[0]->name_specific_length;i++) {
00075     stComponents[0]->name_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00076     if (stComponents[0]->name_specific[i] == NULL) {
00077       return OMX_ErrorInsufficientResources;
00078     }
00079   }
00080   for(i=0;i<stComponents[0]->name_specific_length;i++) {
00081     stComponents[0]->role_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00082     if (stComponents[0]->role_specific[i] == NULL) {
00083       return OMX_ErrorInsufficientResources;
00084     }
00085   }
00086 
00087   strcpy(stComponents[0]->name_specific[0], CLOCK_COMP_NAME);
00088   strcpy(stComponents[0]->role_specific[0], CLOCK_COMP_ROLE);
00089 
00090   DEBUG(DEB_LEV_FUNCTION_NAME, "Out of %s \n",__func__);
00091   return 1;
00092 }
00093