[vlc-commits] iomx: make it work with honeycomb (api 11)

Thomas Guillem git at videolan.org
Sat Jul 26 13:08:50 CEST 2014


vlc | branch: master | Thomas Guillem <guillem at archos.com> | Fri Jul 25 15:45:42 2014 +0200| [7c937db6a772577054cfaba0602b3135cf2b0797] | committer: Martin Storsjö

iomx: make it work with honeycomb (api 11)

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7c937db6a772577054cfaba0602b3135cf2b0797
---

 modules/codec/omxil/iomx.cpp        |    4 ++++
 modules/codec/omxil/iomx_hwbuffer.c |   14 ++++++++------
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/modules/codec/omxil/iomx.cpp b/modules/codec/omxil/iomx.cpp
index 291bd8c..7b5c882 100644
--- a/modules/codec/omxil/iomx.cpp
+++ b/modules/codec/omxil/iomx.cpp
@@ -193,7 +193,11 @@ static OMX_ERRORTYPE iomx_use_buffer(OMX_HANDLETYPE component, OMX_BUFFERHEADERT
     OMXNode* node = (OMXNode*) ((OMX_COMPONENTTYPE*)component)->pComponentPrivate;
     OMXBuffer* info = new OMXBuffer;
     info->dealer = NULL;
+#if ANDROID_API == 11
+    info->graphicBuffer = new GraphicBuffer((android_native_buffer_t*) data, false);
+#else
     info->graphicBuffer = new GraphicBuffer((ANativeWindowBuffer*) data, false);
+#endif
     int ret = ctx->iomx->useGraphicBuffer(node->node, port_index, info->graphicBuffer, &info->id);
     if (ret != OK)
         return OMX_ErrorUndefined;
diff --git a/modules/codec/omxil/iomx_hwbuffer.c b/modules/codec/omxil/iomx_hwbuffer.c
index 50cf322..c22d8c7 100644
--- a/modules/codec/omxil/iomx_hwbuffer.c
+++ b/modules/codec/omxil/iomx_hwbuffer.c
@@ -27,7 +27,7 @@
 #include <errno.h>
 #include <stdio.h>
 
-#if ANDROID_API == 10
+#if ANDROID_API <= 11
 #include <ui/android_native_buffer.h>
 #include <ui/egl/android_natives.h>
 #else
@@ -41,7 +41,7 @@
 #define NO_ERROR 0
 typedef int32_t status_t;
 
-#if ANDROID_API == 10
+#if ANDROID_API <= 11
 typedef android_native_buffer_t ANativeWindowBuffer_t;
 #endif
 
@@ -78,8 +78,8 @@ int IOMXHWBuffer_Connect( void *window )
     ANativeWindow *anw = (ANativeWindow *)window;
     CHECK_ANW();
 
-#if ANDROID_API >= 11
-    if (native_window_api_connect( anw, NATIVE_WINDOW_API_MEDIA) != 0) {
+#if ANDROID_API > 11
+    if (native_window_api_connect( anw, NATIVE_WINDOW_API_MEDIA ) != 0) {
         LOGE( "native_window_api_connect FAIL"  );
         return -EINVAL;
     }
@@ -92,7 +92,7 @@ int IOMXHWBuffer_Disconnect( void *window )
 
     CHECK_ANW();
 
-#if ANDROID_API >= 11
+#if ANDROID_API > 11
     native_window_api_disconnect( anw, NATIVE_WINDOW_API_MEDIA );
 #endif
 
@@ -120,7 +120,7 @@ int IOMXHWBuffer_Setup( void *window, int w, int h, int hal_format, int hw_usage
     err = native_window_set_usage( anw, usage );
     CHECK_ERR();
 
-#if ANDROID_API == 10
+#if ANDROID_API <= 11
     err = native_window_set_buffers_geometry( anw, w, h, hal_format );
     CHECK_ERR();
 #else
@@ -132,7 +132,9 @@ int IOMXHWBuffer_Setup( void *window, int w, int h, int hal_format, int hw_usage
 
     err = native_window_set_buffers_format( anw, hal_format );
     CHECK_ERR();
+#endif
 
+#if ANDROID_API >= 11
     if( *min_undequeued == 0 )
     {
         anw->query( anw, NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, min_undequeued );



More information about the vlc-commits mailing list