library_entry_point.c

Go to the documentation of this file.
00001 
00035 #include <st_static_component_loader.h>
00036 #include <omx_audiodec_component.h>
00037 #include <omx_videodec_component.h>
00038 #include <omx_videoenc_component.h>
00039 #include <omx_ffmpeg_colorconv_component.h>
00040 
00054 int omx_component_library_Setup(stLoaderComponentType **stComponents) {
00055   OMX_U32 i;
00056   DEBUG(DEB_LEV_FUNCTION_NAME, "In %s \n",__func__);
00057 
00058   if (stComponents == NULL) {
00059     DEBUG(DEB_LEV_FUNCTION_NAME, "Out of %s \n",__func__);
00060     return 4; // Return Number of Components - one for audio, two for video
00061   }
00062 
00064   stComponents[0]->componentVersion.s.nVersionMajor = 1; 
00065   stComponents[0]->componentVersion.s.nVersionMinor = 1; 
00066   stComponents[0]->componentVersion.s.nRevision = 1;
00067   stComponents[0]->componentVersion.s.nStep = 1;
00068 
00069   stComponents[0]->name = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00070   if (stComponents[0]->name == NULL) {
00071     return OMX_ErrorInsufficientResources;
00072   }
00073   strcpy(stComponents[0]->name, "OMX.st.audio_decoder");
00074   stComponents[0]->name_specific_length = 3; 
00075   stComponents[0]->constructor = omx_audiodec_component_Constructor;  
00076 
00077   stComponents[0]->name_specific = calloc(stComponents[0]->name_specific_length,sizeof(char *));  
00078   stComponents[0]->role_specific = calloc(stComponents[0]->name_specific_length,sizeof(char *));  
00079 
00080   for(i=0;i<stComponents[0]->name_specific_length;i++) {
00081     stComponents[0]->name_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00082     if (stComponents[0]->name_specific[i] == NULL) {
00083       return OMX_ErrorInsufficientResources;
00084     }
00085   }
00086   for(i=0;i<stComponents[0]->name_specific_length;i++) {
00087     stComponents[0]->role_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00088     if (stComponents[0]->role_specific[i] == NULL) {
00089       return OMX_ErrorInsufficientResources;
00090     }
00091   }
00092 
00093   strcpy(stComponents[0]->name_specific[0], "OMX.st.audio_decoder.mp3");
00094   strcpy(stComponents[0]->name_specific[1], "OMX.st.audio_decoder.ogg");
00095   strcpy(stComponents[0]->name_specific[2], "OMX.st.audio_decoder.aac");
00096   strcpy(stComponents[0]->role_specific[0], "audio_decoder.mp3");
00097   strcpy(stComponents[0]->role_specific[1], "audio_decoder.ogg");
00098   strcpy(stComponents[0]->role_specific[2], "audio_decoder.aac");
00099 
00100 
00102   stComponents[1]->componentVersion.s.nVersionMajor = 1; 
00103   stComponents[1]->componentVersion.s.nVersionMinor = 1; 
00104   stComponents[1]->componentVersion.s.nRevision = 1;
00105   stComponents[1]->componentVersion.s.nStep = 1;
00106 
00107   stComponents[1]->name = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00108   if (stComponents[1]->name == NULL) {
00109     return OMX_ErrorInsufficientResources;
00110   }
00111   strcpy(stComponents[1]->name, "OMX.st.video_decoder");
00112   stComponents[1]->name_specific_length = 2; 
00113   stComponents[1]->constructor = omx_videodec_component_Constructor;  
00114 
00115   stComponents[1]->name_specific = calloc(stComponents[1]->name_specific_length,sizeof(char *));  
00116   stComponents[1]->role_specific = calloc(stComponents[1]->name_specific_length,sizeof(char *));  
00117 
00118   for(i=0;i<stComponents[1]->name_specific_length;i++) {
00119     stComponents[1]->name_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00120     if (stComponents[1]->name_specific[i] == NULL) {
00121       return OMX_ErrorInsufficientResources;
00122     }
00123   }
00124   for(i=0;i<stComponents[1]->name_specific_length;i++) {
00125     stComponents[1]->role_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00126     if (stComponents[1]->role_specific[i] == NULL) {
00127       return OMX_ErrorInsufficientResources;
00128     }
00129   }
00130 
00131   strcpy(stComponents[1]->name_specific[0], "OMX.st.video_decoder.mpeg4");
00132   strcpy(stComponents[1]->name_specific[1], "OMX.st.video_decoder.avc");
00133   strcpy(stComponents[1]->role_specific[0], "video_decoder.mpeg4");
00134   strcpy(stComponents[1]->role_specific[1], "video_decoder.avc");
00135 
00138   stComponents[2]->componentVersion.s.nVersionMajor = 1; 
00139   stComponents[2]->componentVersion.s.nVersionMinor = 1; 
00140   stComponents[2]->componentVersion.s.nRevision = 1;
00141   stComponents[2]->componentVersion.s.nStep = 1;
00142 
00143   stComponents[2]->name = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00144   if (stComponents[2]->name == NULL) {
00145     return OMX_ErrorInsufficientResources;
00146   }
00147   strcpy(stComponents[2]->name, "OMX.st.video_colorconv.ffmpeg");
00148   stComponents[2]->name_specific_length = 1; 
00149   stComponents[2]->constructor = omx_ffmpeg_colorconv_component_Constructor;  
00150 
00151   stComponents[2]->name_specific = calloc(stComponents[2]->name_specific_length,sizeof(char *));  
00152   stComponents[2]->role_specific = calloc(stComponents[2]->name_specific_length,sizeof(char *));  
00153 
00154   for(i=0;i<stComponents[2]->name_specific_length;i++) {
00155     stComponents[2]->name_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00156     if (stComponents[2]->name_specific[i] == NULL) {
00157       return OMX_ErrorInsufficientResources;
00158     }
00159   }
00160   for(i=0;i<stComponents[2]->name_specific_length;i++) {
00161     stComponents[2]->role_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00162     if (stComponents[2]->role_specific[i] == NULL) {
00163       return OMX_ErrorInsufficientResources;
00164     }
00165   }
00166 
00167   strcpy(stComponents[2]->name_specific[0], "OMX.st.video_colorconv.ffmpeg");
00168   strcpy(stComponents[2]->role_specific[0], "video_colorconv.ffmpeg"); 
00169 
00171   stComponents[3]->componentVersion.s.nVersionMajor = 1; 
00172   stComponents[3]->componentVersion.s.nVersionMinor = 1; 
00173   stComponents[3]->componentVersion.s.nRevision = 1;
00174   stComponents[3]->componentVersion.s.nStep = 1;
00175 
00176   stComponents[3]->name = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00177   if (stComponents[3]->name == NULL) {
00178     return OMX_ErrorInsufficientResources;
00179   }
00180   strcpy(stComponents[3]->name, "OMX.st.video_encoder");
00181   stComponents[3]->name_specific_length = 1; 
00182   stComponents[3]->constructor = omx_videoenc_component_Constructor;  
00183 
00184   stComponents[3]->name_specific = calloc(stComponents[3]->name_specific_length,sizeof(char *));  
00185   stComponents[3]->role_specific = calloc(stComponents[3]->name_specific_length,sizeof(char *));  
00186 
00187   for(i=0;i<stComponents[3]->name_specific_length;i++) {
00188     stComponents[3]->name_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00189     if (stComponents[3]->name_specific[i] == NULL) {
00190       return OMX_ErrorInsufficientResources;
00191     }
00192   }
00193   for(i=0;i<stComponents[3]->name_specific_length;i++) {
00194     stComponents[3]->role_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00195     if (stComponents[3]->role_specific[i] == NULL) {
00196       return OMX_ErrorInsufficientResources;
00197     }
00198   }
00199 
00200   strcpy(stComponents[3]->name_specific[0], "OMX.st.video_encoder.mpeg4");
00201   strcpy(stComponents[3]->role_specific[0], "video_encoder.mpeg4");
00202 
00203   DEBUG(DEB_LEV_FUNCTION_NAME, "Out of %s \n",__func__);
00204   return 4; 
00205 }

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