From a1ff5fe5dbf5736fa13ab64ac6ee784f993210f3 Mon Sep 17 00:00:00 2001 From: Jerry Dong Date: Wed, 7 Jul 2010 13:42:36 +0800 Subject: Add "Android.mk" for "vainfo"; update "vainfo.c" for Android --- Android.mk | 4 +--- test/Android.mk | 22 ++++++++++++++++++++++ test/vainfo.c | 10 ++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 test/Android.mk diff --git a/Android.mk b/Android.mk index 5e7744e..89e2004 100644 --- a/Android.mk +++ b/Android.mk @@ -1,5 +1,3 @@ # Recursive call sub-folder Android.mk # -LOCAL_PATH := $(my-dir) - -include $(LOCAL_PATH)/va/Android.mk +include $(call all-subdir-makefiles) diff --git a/test/Android.mk b/test/Android.mk new file mode 100644 index 0000000..7ae4a1a --- /dev/null +++ b/test/Android.mk @@ -0,0 +1,22 @@ +# For vainfo +# ===================================================== + +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + vainfo.c + +LOCAL_CFLAGS += \ + -DANDROID + +LOCAL_C_INCLUDES += \ + $(TARGET_OUT_HEADERS)/libva + +LOCAL_MODULE := vainfo + +LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils + +include $(BUILD_EXECUTABLE) + diff --git a/test/vainfo.c b/test/vainfo.c index 33d6ea4..bf8dbb9 100644 --- a/test/vainfo.c +++ b/test/vainfo.c @@ -22,7 +22,12 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#ifndef ANDROID #include +#else +#include "va/va_android.h" +#define Display unsigned int +#endif #include #include @@ -87,7 +92,12 @@ int main(int argc, const char* argv[]) else name = argv[0]; +#ifndef ANDROID dpy = XOpenDisplay(":0.0"); +#else + dpy = (Display*)malloc(sizeof(Display)); + *(dpy) = 0x18c34078; +#endif if (NULL == dpy) { fprintf(stderr, "%s: Error, can't open display: '%s'\n", name, display ? display : ""); -- cgit v1.2.3