[vlc-devel] [PATCH v2 1/3] omxil: Set OMX version 1.0.0 on android
Martin Storsjö
martin at martin.st
Thu Sep 22 13:42:46 CEST 2011
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.
---
modules/codec/omxil/omxil_utils.h | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/modules/codec/omxil/omxil_utils.h b/modules/codec/omxil/omxil_utils.h
index 5667bf4..d3517e2 100644
--- a/modules/codec/omxil/omxil_utils.h
+++ b/modules/codec/omxil/omxil_utils.h
@@ -24,12 +24,24 @@
/*****************************************************************************
* 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)); \
--
1.7.2.5
More information about the vlc-devel
mailing list