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 = 4; 
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]->name_specific[3], "OMX.st.audio_decoder.g726");
00097   strcpy(stComponents[0]->role_specific[0], "audio_decoder.mp3");
00098   strcpy(stComponents[0]->role_specific[1], "audio_decoder.ogg");
00099   strcpy(stComponents[0]->role_specific[2], "audio_decoder.aac");
00100   strcpy(stComponents[0]->role_specific[3], "audio_decoder.g726");
00101 
00102 
00104   stComponents[1]->componentVersion.s.nVersionMajor = 1; 
00105   stComponents[1]->componentVersion.s.nVersionMinor = 1; 
00106   stComponents[1]->componentVersion.s.nRevision = 1;
00107   stComponents[1]->componentVersion.s.nStep = 1;
00108 
00109   stComponents[1]->name = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00110   if (stComponents[1]->name == NULL) {
00111     return OMX_ErrorInsufficientResources;
00112   }
00113   strcpy(stComponents[1]->name, "OMX.st.video_decoder");
00114   stComponents[1]->name_specific_length = 2; 
00115   stComponents[1]->constructor = omx_videodec_component_Constructor;  
00116 
00117   stComponents[1]->name_specific = calloc(stComponents[1]->name_specific_length,sizeof(char *));  
00118   stComponents[1]->role_specific = calloc(stComponents[1]->name_specific_length,sizeof(char *));  
00119 
00120   for(i=0;i<stComponents[1]->name_specific_length;i++) {
00121     stComponents[1]->name_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00122     if (stComponents[1]->name_specific[i] == NULL) {
00123       return OMX_ErrorInsufficientResources;
00124     }
00125   }
00126   for(i=0;i<stComponents[1]->name_specific_length;i++) {
00127     stComponents[1]->role_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00128     if (stComponents[1]->role_specific[i] == NULL) {
00129       return OMX_ErrorInsufficientResources;
00130     }
00131   }
00132 
00133   strcpy(stComponents[1]->name_specific[0], "OMX.st.video_decoder.mpeg4");
00134   strcpy(stComponents[1]->name_specific[1], "OMX.st.video_decoder.avc");
00135   strcpy(stComponents[1]->role_specific[0], "video_decoder.mpeg4");
00136   strcpy(stComponents[1]->role_specific[1], "video_decoder.avc");
00137 
00140   stComponents[2]->componentVersion.s.nVersionMajor = 1; 
00141   stComponents[2]->componentVersion.s.nVersionMinor = 1; 
00142   stComponents[2]->componentVersion.s.nRevision = 1;
00143   stComponents[2]->componentVersion.s.nStep = 1;
00144 
00145   stComponents[2]->name = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00146   if (stComponents[2]->name == NULL) {
00147     return OMX_ErrorInsufficientResources;
00148   }
00149   strcpy(stComponents[2]->name, "OMX.st.video_colorconv.ffmpeg");
00150   stComponents[2]->name_specific_length = 1; 
00151   stComponents[2]->constructor = omx_ffmpeg_colorconv_component_Constructor;  
00152 
00153   stComponents[2]->name_specific = calloc(stComponents[2]->name_specific_length,sizeof(char *));  
00154   stComponents[2]->role_specific = calloc(stComponents[2]->name_specific_length,sizeof(char *));  
00155 
00156   for(i=0;i<stComponents[2]->name_specific_length;i++) {
00157     stComponents[2]->name_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00158     if (stComponents[2]->name_specific[i] == NULL) {
00159       return OMX_ErrorInsufficientResources;
00160     }
00161   }
00162   for(i=0;i<stComponents[2]->name_specific_length;i++) {
00163     stComponents[2]->role_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00164     if (stComponents[2]->role_specific[i] == NULL) {
00165       return OMX_ErrorInsufficientResources;
00166     }
00167   }
00168 
00169   strcpy(stComponents[2]->name_specific[0], "OMX.st.video_colorconv.ffmpeg");
00170   strcpy(stComponents[2]->role_specific[0], "video_colorconv.ffmpeg"); 
00171 
00173   stComponents[3]->componentVersion.s.nVersionMajor = 1; 
00174   stComponents[3]->componentVersion.s.nVersionMinor = 1; 
00175   stComponents[3]->componentVersion.s.nRevision = 1;
00176   stComponents[3]->componentVersion.s.nStep = 1;
00177 
00178   stComponents[3]->name = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00179   if (stComponents[3]->name == NULL) {
00180     return OMX_ErrorInsufficientResources;
00181   }
00182   strcpy(stComponents[3]->name, "OMX.st.video_encoder");
00183   stComponents[3]->name_specific_length = 1; 
00184   stComponents[3]->constructor = omx_videoenc_component_Constructor;  
00185 
00186   stComponents[3]->name_specific = calloc(stComponents[3]->name_specific_length,sizeof(char *));  
00187   stComponents[3]->role_specific = calloc(stComponents[3]->name_specific_length,sizeof(char *));  
00188 
00189   for(i=0;i<stComponents[3]->name_specific_length;i++) {
00190     stComponents[3]->name_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00191     if (stComponents[3]->name_specific[i] == NULL) {
00192       return OMX_ErrorInsufficientResources;
00193     }
00194   }
00195   for(i=0;i<stComponents[3]->name_specific_length;i++) {
00196     stComponents[3]->role_specific[i] = calloc(1, OMX_MAX_STRINGNAME_SIZE);
00197     if (stComponents[3]->role_specific[i] == NULL) {
00198       return OMX_ErrorInsufficientResources;
00199     }
00200   }
00201 
00202   strcpy(stComponents[3]->name_specific[0], "OMX.st.video_encoder.mpeg4");
00203   strcpy(stComponents[3]->role_specific[0], "video_encoder.mpeg4");
00204 
00205   DEBUG(DEB_LEV_FUNCTION_NAME, "Out of %s \n",__func__);
00206 
00207   return 4; 
00208 }

Generated for OpenMAX Bellagio rel. 0.9.0 by  doxygen 1.5.1
SourceForge.net Logo