diff options
author | Haitao Huang <haitao.huang@intel.com> | 2012-07-06 14:02:05 +0200 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-07-06 16:29:07 +0200 |
commit | e695f9ff1d5479dc1a50ca5f2238ff87acb94314 (patch) | |
tree | 48a7e052ca5627c7db7f2b47ff1598b837a4491d | |
parent | c4f56113201fe07d2c1067356522dd0aea68e5d8 (diff) |
test/encode: add avcenc target for Android.mk.
Signed-off-by: Haitao Huang <haitao.huang@intel.com>
-rwxr-xr-x | test/encode/Android.mk | 20 | ||||
-rw-r--r-- | test/encode/avcenc.c | 13 |
2 files changed, 32 insertions, 1 deletions
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 <string.h> #include <stdlib.h> #include <getopt.h> +#ifndef ANDROID #include <X11/Xlib.h> - +#endif #include <unistd.h> #include <sys/time.h> @@ -47,7 +48,12 @@ #include <va/va.h> #include <va/va_enc_h264.h> +#ifdef ANDROID +#include <va/va_android.h> +#define Display unsigned int +#else #include <va/va_x11.h> +#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); |