[Libva] [android-build v2 3/3] android-test: compile tests for all android versions

Daniel Charles daniel.charles at intel.com
Fri Aug 17 11:44:53 PDT 2012


Tests can be compiled for android if the libraries needed are included
with the correct directory paths depending on Android version

Jelly-bean change the headers location so this is addressed by the
Android.mk selector for version

Change-Id: If0ed62fa44d462c5790df27a8e1716671483991b
Signed-off-by: Daniel Charles <daniel.charles at intel.com>
---
 Android.mk                             |    1 +
 test/basic/Android.mk                  |   22 +++++++++++-----------
 test/common/va_display_android.cpp     |    7 +++++++
 test/decode/Android.mk                 |    2 +-
 test/encode/Android.mk                 |    6 +++---
 test/encode/h264encode_android.cpp     |    7 +++++++
 test/putsurface/Android.mk             |    4 ++--
 test/putsurface/putsurface_android.cpp |    7 +++++++
 test/transcode/mpeg2transcode.cpp      |    7 +++++++
 test/vainfo/Android.mk                 |    2 +-
 10 files changed, 47 insertions(+), 18 deletions(-)

diff --git a/Android.mk b/Android.mk
index 4e28d3e..b3fea75 100644
--- a/Android.mk
+++ b/Android.mk
@@ -12,6 +12,7 @@ ifeq ($(ALOG_VERSION), $(ALOG_VERSION_REQ))
 VERSION_CFLAGS := -DANDROID_JB
 else
 VERSION_CFLAGS := -DANDROID_PRE_JB
+VERSION_SHARED_LIBS := libstagefright_client
 endif
 
  include $(call all-subdir-makefiles)
diff --git a/test/basic/Android.mk b/test/basic/Android.mk
index 708d98f..f66a231 100755
--- a/test/basic/Android.mk
+++ b/test/basic/Android.mk
@@ -18,7 +18,7 @@ LOCAL_C_INCLUDES += \
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE :=	test_001
 
-LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger_client
+LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui $(VERSION_SHARED_LIBS)
 
 include $(BUILD_EXECUTABLE)
 
@@ -39,7 +39,7 @@ LOCAL_C_INCLUDES += \
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE :=	test_02_android
 
-LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger_client
+LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui $(VERSION_SHARED_LIBS)
 
 include $(BUILD_EXECUTABLE)
 
@@ -60,7 +60,7 @@ LOCAL_C_INCLUDES += \
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE :=	test_03_android
 
-LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger_client
+LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui $(VERSION_SHARED_LIBS)
 
 include $(BUILD_EXECUTABLE)
 
@@ -81,7 +81,7 @@ LOCAL_C_INCLUDES += \
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE :=	test_04_android
 
-LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger_client
+LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui $(VERSION_SHARED_LIBS)
 
 include $(BUILD_EXECUTABLE)
 
@@ -102,7 +102,7 @@ LOCAL_C_INCLUDES += \
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE :=	test_05_android
 
-LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger_client
+LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui $(VERSION_SHARED_LIBS)
 
 include $(BUILD_EXECUTABLE)
 
@@ -123,7 +123,7 @@ LOCAL_C_INCLUDES += \
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE :=	test_06_android
 
-LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger_client
+LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui $(VERSION_SHARED_LIBS)
 
 include $(BUILD_EXECUTABLE)
 
@@ -144,7 +144,7 @@ LOCAL_C_INCLUDES += \
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE :=	test_07_android
 
-LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger_client
+LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui $(VERSION_SHARED_LIBS)
 
 include $(BUILD_EXECUTABLE)
 
@@ -165,7 +165,7 @@ LOCAL_C_INCLUDES += \
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE :=	test_08_android
 
-LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger_client
+LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui $(VERSION_SHARED_LIBS)
 
 include $(BUILD_EXECUTABLE)
 
@@ -186,7 +186,7 @@ LOCAL_C_INCLUDES += \
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE :=	test_09_android
 
-LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger_client
+LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui $(VERSION_SHARED_LIBS)
 
 include $(BUILD_EXECUTABLE)
 
@@ -207,7 +207,7 @@ LOCAL_C_INCLUDES += \
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE :=	test_10_android
 
-LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger_client
+LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui $(VERSION_SHARED_LIBS)
 
 include $(BUILD_EXECUTABLE)
 
@@ -228,7 +228,7 @@ LOCAL_C_INCLUDES += \
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE :=	test_11_android
 
-LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger_client
+LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui $(VERSION_SHARED_LIBS)
 
 include $(BUILD_EXECUTABLE)
 
diff --git a/test/common/va_display_android.cpp b/test/common/va_display_android.cpp
index 1e45ae9..223b2dc 100644
--- a/test/common/va_display_android.cpp
+++ b/test/common/va_display_android.cpp
@@ -29,10 +29,17 @@
 #include <binder/ProcessState.h>
 #include <binder/IServiceManager.h>
 #include <utils/Log.h>
+#ifdef ANDROID_PRE_JB
 #include <surfaceflinger/ISurfaceComposer.h>
 #include <surfaceflinger/Surface.h>
 #include <surfaceflinger/ISurface.h>
 #include <surfaceflinger/SurfaceComposerClient.h>
+#elif ANDROID_JB
+#include <gui/ISurfaceComposer.h>
+#include <gui/Surface.h>
+#include <gui/ISurface.h>
+#include <gui/SurfaceComposerClient.h>
+#endif
 #include <binder/MemoryHeapBase.h>
 
 static unsigned int fake_display = 0xdeada01d;
diff --git a/test/decode/Android.mk b/test/decode/Android.mk
index 5eca804..ef84d07 100755
--- a/test/decode/Android.mk
+++ b/test/decode/Android.mk
@@ -11,7 +11,7 @@ LOCAL_SRC_FILES := \
 	../common/va_display_android.cpp
 
 LOCAL_CFLAGS += \
-    -DANDROID
+    -DANDROID $(VERSION_CFLAGS)
 
 LOCAL_C_INCLUDES += \
   $(LOCAL_PATH)/../common \
diff --git a/test/encode/Android.mk b/test/encode/Android.mk
index 1eb7894..bf38f99 100755
--- a/test/encode/Android.mk
+++ b/test/encode/Android.mk
@@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \
   h264encode_android.cpp	\
 
 LOCAL_CFLAGS += \
-    -DANDROID
+    -DANDROID $(VERSION_CFLAGS)
 
 LOCAL_C_INCLUDES += \
   $(TARGET_OUT_HEADERS)/libva	\
@@ -30,7 +30,7 @@ LOCAL_SRC_FILES := \
 	avcenc.c
 
 LOCAL_CFLAGS += \
-    -DANDROID
+    -DANDROID $(VERSION_CFLAGS)
 
 LOCAL_C_INCLUDES += \
   $(LOCAL_PATH)/../common \
@@ -39,7 +39,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 $(VERSION_SHARED_LIBS)
 
 include $(BUILD_EXECUTABLE)
 
diff --git a/test/encode/h264encode_android.cpp b/test/encode/h264encode_android.cpp
index a3f4db4..a6d5eac 100644
--- a/test/encode/h264encode_android.cpp
+++ b/test/encode/h264encode_android.cpp
@@ -34,10 +34,17 @@
 #include <binder/ProcessState.h>
 #include <binder/IServiceManager.h>
 #include <utils/Log.h>
+#ifdef ANDROID_PRE_JB
 #include <surfaceflinger/ISurfaceComposer.h>
 #include <surfaceflinger/Surface.h>
 #include <surfaceflinger/ISurface.h>
 #include <surfaceflinger/SurfaceComposerClient.h>
+#elif ANDROID_JB
+#include <gui/ISurfaceComposer.h>
+#include <gui/Surface.h>
+#include <gui/ISurface.h>
+#include <gui/SurfaceComposerClient.h>
+#endif
 #include <binder/MemoryHeapBase.h>
 #define Display unsigned int
 
diff --git a/test/putsurface/Android.mk b/test/putsurface/Android.mk
index 03edb61..e763358 100644
--- a/test/putsurface/Android.mk
+++ b/test/putsurface/Android.mk
@@ -10,7 +10,7 @@ LOCAL_SRC_FILES := \
   #putsurface_x11.c
 
 LOCAL_CFLAGS += \
-    -DANDROID
+    -DANDROID $(VERSION_CFLAGS)
 
 LOCAL_C_INCLUDES += \
   $(TARGET_OUT_HEADERS)/libva
@@ -18,7 +18,7 @@ LOCAL_C_INCLUDES += \
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE := putsurface
 
-LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libgui
+LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libgui $(VERSION_SHARED_LIBS)
 
 include $(BUILD_EXECUTABLE)
 
diff --git a/test/putsurface/putsurface_android.cpp b/test/putsurface/putsurface_android.cpp
index 8b70480..d562b67 100644
--- a/test/putsurface/putsurface_android.cpp
+++ b/test/putsurface/putsurface_android.cpp
@@ -28,10 +28,17 @@
 #include <binder/ProcessState.h>
 #include <binder/IServiceManager.h>
 #include <utils/Log.h>
+#ifdef ANDROID_PRE_JB
 #include <surfaceflinger/ISurfaceComposer.h>
 #include <surfaceflinger/Surface.h>
 #include <surfaceflinger/ISurface.h>
 #include <surfaceflinger/SurfaceComposerClient.h>
+#elif ANDROID_JB
+#include <gui/ISurfaceComposer.h>
+#include <gui/Surface.h>
+#include <gui/ISurface.h>
+#include <gui/SurfaceComposerClient.h>
+#endif
 #include <binder/MemoryHeapBase.h>
 #include <assert.h>
 #include <pthread.h>
diff --git a/test/transcode/mpeg2transcode.cpp b/test/transcode/mpeg2transcode.cpp
index fb2e06f..822ad40 100644
--- a/test/transcode/mpeg2transcode.cpp
+++ b/test/transcode/mpeg2transcode.cpp
@@ -54,10 +54,17 @@
 #include <binder/ProcessState.h>
 #include <binder/IServiceManager.h>
 #include <utils/Log.h>
+#ifdef ANDROID_PRE_JB
 #include <surfaceflinger/ISurfaceComposer.h>
 #include <surfaceflinger/Surface.h>
 #include <surfaceflinger/ISurface.h>
 #include <surfaceflinger/SurfaceComposerClient.h>
+#elif ANDROID_JB
+#include <gui/ISurfaceComposer.h>
+#include <gui/Surface.h>
+#include <gui/ISurface.h>
+#include <gui/SurfaceComposerClient.h>
+#endif
 #include <binder/MemoryHeapBase.h>
 #define Display unsigned int
 
diff --git a/test/vainfo/Android.mk b/test/vainfo/Android.mk
index 6ad550d..be8a080 100644
--- a/test/vainfo/Android.mk
+++ b/test/vainfo/Android.mk
@@ -11,7 +11,7 @@ LOCAL_SRC_FILES := \
 	../common/va_display_android.cpp
 
 LOCAL_CFLAGS += \
-  -DANDROID
+  -DANDROID $(VERSION_CFLAGS)
 
 LOCAL_C_INCLUDES += \
   $(LOCAL_PATH)/../common \
-- 
1.7.7.6



More information about the Libva mailing list