[Libva] [PATCH 2/4] libva: fix for Android ICS

Haitao Huang haitao.huang at intel.com
Mon Aug 20 12:52:43 PDT 2012


This fixes existing tests for Android ICS build.
updated headers exported for new drm changes
Removed dependencies on deprecated Android APIs.
Added LIBVA_VERSION_S defines.
Removed unsupported encoder test

Change-Id: I478063713883fbb5fb1fac372dbc418b19ff7d2b
Signed-off-by: Haitao Huang <haitao.huang at intel.com>
---
 test/Android.mk            |    2 +-
 test/android_winsys.cpp    |   19 +++----------------
 test/decode/Android.mk     |    6 ++----
 test/encode/Android.mk     |   24 +-----------------------
 test/putsurface/Android.mk |    2 +-
 test/vainfo/Android.mk     |    5 +++--
 test/vainfo/vainfo.c       |    1 +
 va/Android.mk              |    3 ++-
 va/sysdeps.h               |    3 +++
 9 files changed, 17 insertions(+), 48 deletions(-)

diff --git a/test/Android.mk b/test/Android.mk
index 7d60473..f3f122c 100644
--- a/test/Android.mk
+++ b/test/Android.mk
@@ -1,4 +1,4 @@
 # Recursive call sub-folder Android.mk
 #
-# include $(call all-subdir-makefiles)
+ include $(call all-subdir-makefiles)
 
diff --git a/test/android_winsys.cpp b/test/android_winsys.cpp
index 93489cd..3c6a245 100644
--- a/test/android_winsys.cpp
+++ b/test/android_winsys.cpp
@@ -24,12 +24,6 @@
 #include <ui/DisplayInfo.h>
 
 namespace android {
-    class Test {
-        public:
-                static const sp<ISurface>& getISurface(const sp<Surface>& s) {
-                            return s->getISurface();
-                }
-    };
 };
 
 #define min(a,b) (a<b?a:b)
@@ -44,21 +38,14 @@ do {                                                                    \
     /*h = min(win_height, info.h);*/                                    \
     w = win_width, h = win_height;                                      \
                                                                         \
-    surface_ctrl = client->createSurface(getpid(), 0, w, h, PIXEL_FORMAT_RGB_565, ISurfaceComposer::ePushBuffers); \
+    surface_ctrl = client->createSurface(getpid(), 0, w, h, PIXEL_FORMAT_RGB_565); \
     android_surface = surface_ctrl->getSurface();                       \
-    android_isurface = Test::getISurface(android_surface);              \
                                                                         \
-    client->openTransaction();                                          \
+    client->openGlobalTransaction();                                          \
     surface_ctrl->setPosition(x, y);                                    \
-    client->closeTransaction();                                         \
-                                                                        \
-    client->openTransaction();                                          \
     surface_ctrl->setSize(w, h);                                        \
-    client->closeTransaction();                                         \
-                                                                        \
-    client->openTransaction();                                          \
     surface_ctrl->setLayer(0x100000);                                   \
-    client->closeTransaction();                                         \
+    client->closeGlobalTransaction();                                         \
 } while (0)
 
 
diff --git a/test/decode/Android.mk b/test/decode/Android.mk
index e94b5d9..5eca804 100755
--- a/test/decode/Android.mk
+++ b/test/decode/Android.mk
@@ -15,14 +15,12 @@ LOCAL_CFLAGS += \
 
 LOCAL_C_INCLUDES += \
   $(LOCAL_PATH)/../common \
-  $(TARGET_OUT_HEADERS)/libva	\
-  $(TOPDIR)/hardware/intel/libva/va/	\
-  $(TARGET_OUT_HEADERS)/X11	
+  $(TARGET_OUT_HEADERS)/libva
 
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE :=	mpeg2vldemo
 
-LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger_client
+LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libgui
 
 include $(BUILD_EXECUTABLE)
 
diff --git a/test/encode/Android.mk b/test/encode/Android.mk
index 8b58aa2..d2f4514 100755
--- a/test/encode/Android.mk
+++ b/test/encode/Android.mk
@@ -6,28 +6,6 @@ LOCAL_PATH:= $(call my-dir)
 include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := \
-  h264encode_android.cpp	\
-  #h264encode_x11.c	\
-
-LOCAL_CFLAGS += \
-    -DANDROID
-
-LOCAL_C_INCLUDES += \
-  $(TARGET_OUT_HEADERS)/libva	\
-  $(TOPDIR)/hardware/intel/libva/va/	\
-  $(TARGET_OUT_HEADERS)/X11	
-
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE :=	h264encode
-
-LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger_client
-
-include $(BUILD_EXECUTABLE)
-
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
 	../common/va_display.c			\
 	../common/va_display_android.cpp	\
 	avcenc.c
@@ -42,7 +20,7 @@ LOCAL_C_INCLUDES += \
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE :=	avcenc
 
-LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libgui libsurfaceflinger_client
+LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libgui
 
 include $(BUILD_EXECUTABLE)
 
diff --git a/test/putsurface/Android.mk b/test/putsurface/Android.mk
index 0b5d438..03edb61 100644
--- a/test/putsurface/Android.mk
+++ b/test/putsurface/Android.mk
@@ -18,7 +18,7 @@ LOCAL_C_INCLUDES += \
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE := putsurface
 
-LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger_client
+LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libgui
 
 include $(BUILD_EXECUTABLE)
 
diff --git a/test/vainfo/Android.mk b/test/vainfo/Android.mk
index 91ea526..6ad550d 100644
--- a/test/vainfo/Android.mk
+++ b/test/vainfo/Android.mk
@@ -14,12 +14,13 @@ LOCAL_CFLAGS += \
   -DANDROID
 
 LOCAL_C_INCLUDES += \
-  $(TARGET_OUT_HEADERS)/libva
+  $(LOCAL_PATH)/../common \
+  $(LOCAL_PATH)/../.. \
 
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE := vainfo
 
-LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils
+LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libgui
 
 include $(BUILD_EXECUTABLE)
 
diff --git a/test/vainfo/vainfo.c b/test/vainfo/vainfo.c
index 95e8531..7ef27bb 100644
--- a/test/vainfo/vainfo.c
+++ b/test/vainfo/vainfo.c
@@ -27,6 +27,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include "va_display.h"
+#include "va/sysdeps.h"
 
 #define CHECK_VASTATUS(va_status,func, ret)                             \
 if (va_status != VA_STATUS_SUCCESS) {                                   \
diff --git a/va/Android.mk b/va/Android.mk
index cea186e..e4e1d41 100755
--- a/va/Android.mk
+++ b/va/Android.mk
@@ -64,7 +64,8 @@ LOCAL_COPY_HEADERS := \
 	va_enc.h \
 	va_enc_h264.h \
 	va_backend.h \
-	x11/va_dricommon.h \
+        x11/va_dricommon.h \
+	va_drmcommon.h \
 	va_vpp.h \
 	va_backend_vpp.h
 
diff --git a/va/sysdeps.h b/va/sysdeps.h
index 730735b..1dbccdd 100644
--- a/va/sysdeps.h
+++ b/va/sysdeps.h
@@ -41,6 +41,9 @@
 # define True  1
 # define False 0
 
+// macros generated from configure
+# define LIBVA_VERSION "1.2.0.pre1"
+# define LIBVA_VERSION_S LIBVA_VERSION
 /* Android logging utilities */
 # define LOG_TAG "lib-va"
 # include <utils/Log.h>
-- 
1.7.5.4



More information about the Libva mailing list