st/omx: provide constant number of components
authorEmil Velikov <emil.l.velikov@gmail.com>
Tue, 10 Jun 2014 01:28:00 +0000 (02:28 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 26 Jun 2014 13:05:12 +0000 (14:05 +0100)
The number of components and their names/roles should
be kept constant as all of that information cached.

Note: Make sure to rebuild the .omxregister file, by executing
   $ omxregister-bellagio.

Cc: Leo Liu <leo.liu@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
src/gallium/state_trackers/omx/entrypoint.c

index d6f149e623eaadf95dd1744f883907c059a80490..a7656660e8c52a4a36d42ab6c87d9d2b36d05491 100644 (file)
@@ -51,22 +51,21 @@ static unsigned omx_usecount = 0;
 int omx_component_library_Setup(stLoaderComponentType **stComponents)
 {
    OMX_ERRORTYPE r;
-   unsigned i = 0;
 
    if (stComponents == NULL)
       return 2;
 
    /* component 0 - video decoder */
-   r = vid_dec_LoaderComponent(stComponents[i]);
-   if (r == OMX_ErrorNone)
-      ++i;
+   r = vid_dec_LoaderComponent(stComponents[0]);
+   if (r != OMX_ErrorNone)
+      return OMX_ErrorInsufficientResources;
 
    /* component 1 - video encoder */
-   r = vid_enc_LoaderComponent(stComponents[i]);
-   if (r == OMX_ErrorNone)
-      ++i;
+   r = vid_enc_LoaderComponent(stComponents[1]);
+   if (r != OMX_ErrorNone)
+      return OMX_ErrorInsufficientResources;
 
-   return i;
+   return 2;
 }
 
 struct vl_screen *omx_get_screen(void)