]> git.sesse.net Git - vlc/commitdiff
omxil: Set OMX version 1.0.0 on android
authorMartin Storsjö <martin@martin.st>
Thu, 22 Sep 2011 11:42:46 +0000 (14:42 +0300)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 22 Sep 2011 11:56:05 +0000 (13:56 +0200)
The Samsung OMX components on e.g. Nexus S require major == 1
and minor == 0, otherwise they simply return errors on all
SetParameter/GetParameter calls.

Stagefright's OMX client always sets version 1.0.0, which thus
probably should be a safe choice for all android cases.

An alternative would be to store the version to set as a
variable in decoder_sys_t, and set that to 1.0.0 conditionally
only for Samsung OMX components, but that would make
OMX_INIT_COMMON more complex.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/codec/omxil/omxil_utils.h

index 5667bf4f2267070065163baf5081e2e0392e0eb3..d3517e2a3cdafe030c7de57a636f97a3555a5a7c 100644 (file)
 /*****************************************************************************
  * OMX macros
  *****************************************************************************/
+#ifdef __ANDROID__
+#define OMX_VERSION_MAJOR 1
+#define OMX_VERSION_MINOR 0
+#define OMX_VERSION_REV   0
+#define OMX_VERSION_STEP  0
+#else
+#define OMX_VERSION_MAJOR 1
+#define OMX_VERSION_MINOR 1
+#define OMX_VERSION_REV   1
+#define OMX_VERSION_STEP  0
+#endif
+
 #define OMX_INIT_COMMON(a) \
   (a).nSize = sizeof(a); \
-  (a).nVersion.s.nVersionMajor = 1; \
-  (a).nVersion.s.nVersionMinor = 1; \
-  (a).nVersion.s.nRevision = 1; \
-  (a).nVersion.s.nStep = 0
+  (a).nVersion.s.nVersionMajor = OMX_VERSION_MAJOR; \
+  (a).nVersion.s.nVersionMinor = OMX_VERSION_MINOR; \
+  (a).nVersion.s.nRevision = OMX_VERSION_REV; \
+  (a).nVersion.s.nStep = OMX_VERSION_STEP
 
 #define OMX_INIT_STRUCTURE(a) \
   memset(&(a), 0, sizeof(a)); \