From e695f9ff1d5479dc1a50ca5f2238ff87acb94314 Mon Sep 17 00:00:00 2001 From: Haitao Huang Date: Fri, 6 Jul 2012 14:02:05 +0200 Subject: [PATCH] test/encode: add avcenc target for Android.mk. Signed-off-by: Haitao Huang --- test/encode/Android.mk | 20 ++++++++++++++++++++ test/encode/avcenc.c | 13 ++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/test/encode/Android.mk b/test/encode/Android.mk index acb6fac..6c0190a 100755 --- a/test/encode/Android.mk +++ b/test/encode/Android.mk @@ -24,3 +24,23 @@ LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils li include $(BUILD_EXECUTABLE) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + avcenc.c + +LOCAL_CFLAGS += \ + -DANDROID + +LOCAL_C_INCLUDES += \ + $(TARGET_OUT_HEADERS)/libva \ + +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE := avcenc + +LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils +libutils libgui + +include $(BUILD_EXECUTABLE) + diff --git a/test/encode/avcenc.c b/test/encode/avcenc.c index c4f3b3b..d6f9ac0 100644 --- a/test/encode/avcenc.c +++ b/test/encode/avcenc.c @@ -32,8 +32,9 @@ #include #include #include +#ifndef ANDROID #include - +#endif #include #include @@ -47,7 +48,12 @@ #include #include +#ifdef ANDROID +#include +#define Display unsigned int +#else #include +#endif #define NAL_REF_IDC_NONE 0 #define NAL_REF_IDC_LOW 1 @@ -142,7 +148,12 @@ static void create_encode_pipe() int major_ver, minor_ver; VAStatus va_status; +#ifdef ANDROID + x11_display = (Display*)malloc(sizeof(Display)); + *(x11_display ) = 0x18c34078; +#else x11_display = XOpenDisplay(":0.0"); +#endif assert(x11_display); va_dpy = vaGetDisplay(x11_display); -- 2.7.4