library_entry_point.c

Go to the documentation of this file.
00001 
00035 #include <st_static_component_loader.h>
00036 #include <omx_volume_component.h>
00037 #include <omx_audiomixer_component.h>
00038 
00052 int omx_component_library_Setup(stLoaderComponentType **stComponents) {
00053   unsigned int i;
00054   DEBUG(DEB_LEV_FUNCTION_NAME, "In %s \n",__func__);
00055 
00056   if (stComponents == NULL) {
00057     DEBUG(DEB_LEV_FUNCTION_NAME, "Out of %s \n",__func__);
00058     return 2; // Return Number of Components - one for audio volume component
00059   }
00060 
00062   stComponents[0]->componentVersion.s.nVersionMajor = 1; 
00063   stComponents[0]->componentVersion.s.nVersionMinor = 1; 
00064   stComponents[0]->componentVersion.s.nRevision = 1;
00065   stComponents[0]->componentVersion.s.nStep = 1;
00066 
00067   stComponents[0]->name = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00068   if (stComponents[0]->name == NULL) {
00069     return OMX_ErrorInsufficientResources;
00070   }
00071   strcpy(stComponents[0]->name, "OMX.st.volume.component");
00072   stComponents[0]->name_specific_length = 1; 
00073   stComponents[0]->constructor = omx_volume_component_Constructor;  
00074 
00075   stComponents[0]->name_specific = calloc(stComponents[0]->name_specific_length,sizeof(char *));  
00076   stComponents[0]->role_specific = calloc(stComponents[0]->name_specific_length,sizeof(char *));  
00077 
00078   for(i=0;i<stComponents[0]->name_specific_length;i++) {
00079     stComponents[0]->name_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00080     if (stComponents[0]->name_specific[i] == NULL) {
00081       return OMX_ErrorInsufficientResources;
00082     }
00083   }
00084   for(i=0;i<stComponents[0]->name_specific_length;i++) {
00085     stComponents[0]->role_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00086     if (stComponents[0]->role_specific[i] == NULL) {
00087       return OMX_ErrorInsufficientResources;
00088     }
00089   }
00090 
00091   strcpy(stComponents[0]->name_specific[0], "OMX.st.volume.component");
00092   strcpy(stComponents[0]->role_specific[0], "volume.component");
00093 
00095   stComponents[1]->componentVersion.s.nVersionMajor = 1;
00096   stComponents[1]->componentVersion.s.nVersionMinor = 1;
00097   stComponents[1]->componentVersion.s.nRevision = 1;
00098   stComponents[1]->componentVersion.s.nStep = 1;
00099 
00100   stComponents[1]->name = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00101   if (stComponents[1]->name == NULL) {
00102     return OMX_ErrorInsufficientResources;
00103   }
00104   strcpy(stComponents[1]->name, "OMX.st.audio.mixer");
00105   stComponents[1]->name_specific_length = 1;
00106   stComponents[1]->constructor = omx_audio_mixer_component_Constructor; 
00107 
00108   stComponents[1]->name_specific = calloc(stComponents[0]->name_specific_length,sizeof(char *));       
00109   stComponents[1]->role_specific = calloc(stComponents[0]->name_specific_length,sizeof(char *));       
00110 
00111   for(i=0;i<stComponents[1]->name_specific_length;i++) {
00112     stComponents[1]->name_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00113     if (stComponents[1]->name_specific[i] == NULL) {
00114       return OMX_ErrorInsufficientResources;
00115     }
00116   }
00117   for(i=0;i<stComponents[1]->name_specific_length;i++) {
00118     stComponents[1]->role_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00119     if (stComponents[1]->role_specific[i] == NULL) {
00120       return OMX_ErrorInsufficientResources;
00121     }
00122   }
00123 
00124   strcpy(stComponents[1]->name_specific[0], "OMX.st.audio.mixer");
00125   strcpy(stComponents[1]->role_specific[0], "audio.mixer");
00126 
00127   DEBUG(DEB_LEV_FUNCTION_NAME, "Out of %s \n",__func__);
00128   return 2; 
00129 }

Generated for OpenMAX Bellagio rel. 0.3.5-svn by  doxygen 1.5.1
SourceForge.net Logo