• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/intel/common/libva


Commit MetaInfo

Revision22bbdaab115af6d779194faa7742105254fb7169 (tree)
Zeit2017-05-02 11:46:27
AutorXiang, Haihao <haihao.xiang@inte...>
CommiterGitHub

Log Message

Merge pull request #37 from cwhuang/master

A series patches for Android

Ändern Zusammenfassung

Diff

--- a/va/Android.mk
+++ b/va/Android.mk
@@ -25,13 +25,8 @@
2525
2626 LOCAL_PATH:= $(call my-dir)
2727
28-LIBVA_DRIVERS_PATH_32 = /system/lib
29-LIBVA_DRIVERS_PATH_64 = /system/lib64
30-
31-# Version set to Android Jelly Bean
32-ALOG_VERSION_REQ := 4.1
33-ALOG_VERSION := $(filter $(ALOG_VERSION_REQ),$(firstword $(sort $(PLATFORM_VERSION) \
34- $(ALOG_VERSION_REQ))))
28+LIBVA_DRIVERS_PATH_32 := /vendor/lib/dri
29+LIBVA_DRIVERS_PATH_64 := /vendor/lib64/dri
3530
3631 include $(CLEAR_VARS)
3732
@@ -44,57 +39,39 @@ LOCAL_SRC_FILES := \
4439 va_fool.c
4540
4641 LOCAL_CFLAGS_32 += \
47- -DANDROID \
4842 -DVA_DRIVERS_PATH="\"$(LIBVA_DRIVERS_PATH_32)\"" \
49- -DLOG_TAG=\"libva\"
5043
5144 LOCAL_CFLAGS_64 += \
52- -DANDROID \
5345 -DVA_DRIVERS_PATH="\"$(LIBVA_DRIVERS_PATH_64)\"" \
54- -DLOG_TAG=\"libva\"
5546
56-# Android Jelly Bean defined ALOGx, older versions use LOGx
57-ifeq ($(ALOG_VERSION), $(ALOG_VERSION_REQ))
58-LOCAL_CFLAGS += -DANDROID_ALOG
59-else
60-LOCAL_CFLAGS += -DANDROID_LOG
61-endif
47+LOCAL_CFLAGS := \
48+ $(if $(filter user,$(TARGET_BUILD_VARIANT)),,-DENABLE_VA_MESSAGING) \
49+ -DLOG_TAG=\"libva\"
6250
63-LOCAL_C_INCLUDES += \
64- $(TARGET_OUT_HEADERS)/libva \
65- $(LOCAL_PATH)/x11 \
66- $(LOCAL_PATH)/..
67-
68-LOCAL_COPY_HEADERS := \
69- va.h \
70- va_backend.h \
71- va_dec_hevc.h \
72- va_dec_jpeg.h \
73- va_drmcommon.h \
74- va_enc_hevc.h \
75- va_enc_jpeg.h \
76- va_enc_vp8.h \
77- va_enc_vp9.h \
78- va_dec_vp9.h \
79- va_version.h
80-
81-LOCAL_COPY_HEADERS_TO := libva/va
51+LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
8252
8353 LOCAL_MODULE_TAGS := optional
8454 LOCAL_MODULE := libva
55+LOCAL_MODULE_CLASS := SHARED_LIBRARIES
56+LOCAL_PROPRIETARY_MODULE := true
8557
8658 LOCAL_SHARED_LIBRARIES := libdl libdrm libcutils liblog
8759
88-include $(BUILD_SHARED_LIBRARY)
60+intermediates := $(call local-generated-sources-dir)
61+
62+LOCAL_EXPORT_C_INCLUDE_DIRS := \
63+ $(intermediates) \
64+ $(LOCAL_C_INCLUDES)
8965
90-GEN := $(LOCAL_PATH)/va_version.h
66+GEN := $(intermediates)/va/va_version.h
9167 $(GEN): SCRIPT := $(LOCAL_PATH)/../build/gen_version.sh
92-$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
93-$(GEN): PRIVATE_CUSTOM_TOOL = sh $(SCRIPT) $(PRIVATE_PATH)/.. $(PRIVATE_PATH)/va_version.h.in > $@
94-$(GEN): $(LOCAL_PATH)/%.h : $(LOCAL_PATH)/%.h.in $(SCRIPT) $(LOCAL_PATH)/../configure.ac
68+$(GEN): PRIVATE_CUSTOM_TOOL = sh $(SCRIPT) $(<D)/.. $< > $@
69+$(GEN): $(intermediates)/va/%.h : $(LOCAL_PATH)/%.h.in $(LOCAL_PATH)/../configure.ac
9570 $(transform-generated-source)
9671 LOCAL_GENERATED_SOURCES += $(GEN)
9772
73+include $(BUILD_SHARED_LIBRARY)
74+
9875 # For libva-android
9976 # =====================================================
10077
@@ -105,17 +82,11 @@ LOCAL_SRC_FILES := \
10582 drm/va_drm_utils.c
10683
10784 LOCAL_CFLAGS += \
108- -DANDROID -DLOG_TAG=\"libva-android\"
85+ -DLOG_TAG=\"libva-android\"
10986
11087 LOCAL_C_INCLUDES += \
111- $(TARGET_OUT_HEADERS)/libva \
112- $(TARGET_OUT_HEADERS)/libdrm \
11388 $(LOCAL_PATH)/drm
11489
115-LOCAL_COPY_HEADERS_TO := libva/va
116-
117-LOCAL_COPY_HEADERS := va_android.h
118-
11990 LOCAL_MODULE_TAGS := optional
12091 LOCAL_MODULE := libva-android
12192
@@ -133,15 +104,7 @@ LOCAL_SRC_FILES := \
133104 egl/va_egl.c
134105
135106 LOCAL_CFLAGS += \
136- -DANDROID -DLOG_TAG=\"libva-egl\"
137-
138-LOCAL_C_INCLUDES += \
139- $(TARGET_OUT_HEADERS)/libva \
140- $(LOCAL_PATH)/x11
141-
142-LOCAL_COPY_HEADERS_TO := libva/va
143-
144-LOCAL_COPY_HEADERS := egl/va_egl.h egl/va_backend_egl.h
107+ -DLOG_TAG=\"libva-egl\"
145108
146109 LOCAL_MODULE_TAGS := optional
147110 LOCAL_MODULE := libva-egl
@@ -158,17 +121,7 @@ include $(CLEAR_VARS)
158121
159122 LOCAL_SRC_FILES := va_tpi.c
160123
161-LOCAL_CFLAGS += -DANDROID -DLOG_TAG=\"libva-tpi\"
162-
163-LOCAL_C_INCLUDES += \
164- $(TARGET_OUT_HEADERS)/libva \
165- $(LOCAL_PATH)/..
166-
167-LOCAL_COPY_HEADERS_TO := libva/va
168-
169-LOCAL_COPY_HEADERS := \
170- va_tpi.h \
171- va_backend_tpi.h
124+LOCAL_CFLAGS += -DLOG_TAG=\"libva-tpi\"
172125
173126 LOCAL_SHARED_LIBRARIES := libva
174127
--- a/va/android/va_android.cpp
+++ b/va/android/va_android.cpp
@@ -194,7 +194,7 @@ extern "C" {
194194 VAStatus vaPutSurface (
195195 VADisplay dpy,
196196 VASurfaceID surface,
197- sp<ISurface> draw, /* Android Surface/Window */
197+ sp<ANativeWindow> draw, /* Android Native Window */
198198 short srcx,
199199 short srcy,
200200 unsigned short srcw,
--- a/va/va.c
+++ b/va/va.c
@@ -37,6 +37,16 @@
3737 #include <string.h>
3838 #include <dlfcn.h>
3939 #include <unistd.h>
40+#ifdef ANDROID
41+#include <cutils/log.h>
42+/* support versions < JellyBean */
43+#ifndef ALOGE
44+#define ALOGE LOGE
45+#endif
46+#ifndef ALOGI
47+#define ALOGI LOGI
48+#endif
49+#endif
4050
4151 #define DRIVER_EXTENSION "_drv_video.so"
4252
@@ -108,10 +118,8 @@ int vaDisplayIsValid(VADisplay dpy)
108118
109119 static void default_log_error(const char *buffer)
110120 {
111-# ifdef ANDROID_ALOG
121+# ifdef ANDROID
112122 ALOGE("%s", buffer);
113-# elif ANDROID_LOG
114- LOGE("%s", buffer);
115123 # else
116124 fprintf(stderr, "libva error: %s", buffer);
117125 # endif
@@ -119,10 +127,8 @@ static void default_log_error(const char *buffer)
119127
120128 static void default_log_info(const char *buffer)
121129 {
122-# ifdef ANDROID_ALOG
130+# ifdef ANDROID
123131 ALOGI("%s", buffer);
124-# elif ANDROID_LOG
125- LOGI("%s", buffer);
126132 # else
127133 fprintf(stderr, "libva info: %s", buffer);
128134 # endif
--- a/va/va_android.h
+++ b/va/va_android.h
@@ -48,7 +48,8 @@ VADisplay vaGetDisplay (
4848
4949 #ifdef __cplusplus
5050 #ifdef ANDROID
51-#include <surfaceflinger/ISurface.h>
51+#include <system/window.h>
52+#include <utils/StrongPointer.h>
5253 using namespace android;
5354
5455 /*
@@ -62,7 +63,7 @@ using namespace android;
6263 VAStatus vaPutSurface (
6364 VADisplay dpy,
6465 VASurfaceID surface,
65- sp<ISurface> draw, /* Android Window/Surface */
66+ sp<ANativeWindow> draw, /* Android Native Window */
6667 short srcx,
6768 short srcy,
6869 unsigned short srcw,