OpenMAXBellagio 0.9.3
library_entry_point.c
Go to the documentation of this file.
00001 
00032 #include <st_static_component_loader.h>
00033 #include <omx_video_scheduler_component.h>
00034 
00048 int omx_component_library_Setup(stLoaderComponentType **stComponents) {
00049     int i;
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 Components - one for fbdev sink component
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     strcpy(stComponents[0]->name, VIDEO_SCHEDULER_COMP_NAME);
00067     stComponents[0]->name_specific_length = 1;
00068     stComponents[0]->constructor =  omx_video_scheduler_component_Constructor;
00069 
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], VIDEO_SCHEDULER_COMP_NAME);
00088     strcpy(stComponents[0]->role_specific[0], VIDEO_SCHEDULER_COMP_ROLE);
00089 
00090     stComponents[0]->nqualitylevels = VIDEOSCHED_QUALITY_LEVELS;
00091     stComponents[0]->multiResourceLevel = malloc(stComponents[0]->nqualitylevels * sizeof(multiResourceDescriptor *));
00092     for (i=0; i<stComponents[0]->nqualitylevels; i++) {
00093         stComponents[0]->multiResourceLevel[i] = malloc(sizeof(multiResourceDescriptor));
00094         stComponents[0]->multiResourceLevel[i]->CPUResourceRequested = videoSchedQualityLevels[i * 2];
00095         stComponents[0]->multiResourceLevel[i]->MemoryResourceRequested = videoSchedQualityLevels[i * 2 + 1];
00096     }
00097     DEBUG(DEB_LEV_FUNCTION_NAME, "Out of %s \n",__func__);
00098     return 1;
00099 }