hardware/intel/common/libva
Revision | 22bbdaab115af6d779194faa7742105254fb7169 (tree) |
---|---|
Zeit | 2017-05-02 11:46:27 |
Autor | Xiang, Haihao <haihao.xiang@inte...> |
Commiter | GitHub |
Merge pull request #37 from cwhuang/master
A series patches for Android
@@ -25,13 +25,8 @@ | ||
25 | 25 | |
26 | 26 | LOCAL_PATH:= $(call my-dir) |
27 | 27 | |
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 | |
35 | 30 | |
36 | 31 | include $(CLEAR_VARS) |
37 | 32 |
@@ -44,57 +39,39 @@ LOCAL_SRC_FILES := \ | ||
44 | 39 | va_fool.c |
45 | 40 | |
46 | 41 | LOCAL_CFLAGS_32 += \ |
47 | - -DANDROID \ | |
48 | 42 | -DVA_DRIVERS_PATH="\"$(LIBVA_DRIVERS_PATH_32)\"" \ |
49 | - -DLOG_TAG=\"libva\" | |
50 | 43 | |
51 | 44 | LOCAL_CFLAGS_64 += \ |
52 | - -DANDROID \ | |
53 | 45 | -DVA_DRIVERS_PATH="\"$(LIBVA_DRIVERS_PATH_64)\"" \ |
54 | - -DLOG_TAG=\"libva\" | |
55 | 46 | |
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\" | |
62 | 50 | |
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)/.. | |
82 | 52 | |
83 | 53 | LOCAL_MODULE_TAGS := optional |
84 | 54 | LOCAL_MODULE := libva |
55 | +LOCAL_MODULE_CLASS := SHARED_LIBRARIES | |
56 | +LOCAL_PROPRIETARY_MODULE := true | |
85 | 57 | |
86 | 58 | LOCAL_SHARED_LIBRARIES := libdl libdrm libcutils liblog |
87 | 59 | |
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) | |
89 | 65 | |
90 | -GEN := $(LOCAL_PATH)/va_version.h | |
66 | +GEN := $(intermediates)/va/va_version.h | |
91 | 67 | $(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 | |
95 | 70 | $(transform-generated-source) |
96 | 71 | LOCAL_GENERATED_SOURCES += $(GEN) |
97 | 72 | |
73 | +include $(BUILD_SHARED_LIBRARY) | |
74 | + | |
98 | 75 | # For libva-android |
99 | 76 | # ===================================================== |
100 | 77 |
@@ -105,17 +82,11 @@ LOCAL_SRC_FILES := \ | ||
105 | 82 | drm/va_drm_utils.c |
106 | 83 | |
107 | 84 | LOCAL_CFLAGS += \ |
108 | - -DANDROID -DLOG_TAG=\"libva-android\" | |
85 | + -DLOG_TAG=\"libva-android\" | |
109 | 86 | |
110 | 87 | LOCAL_C_INCLUDES += \ |
111 | - $(TARGET_OUT_HEADERS)/libva \ | |
112 | - $(TARGET_OUT_HEADERS)/libdrm \ | |
113 | 88 | $(LOCAL_PATH)/drm |
114 | 89 | |
115 | -LOCAL_COPY_HEADERS_TO := libva/va | |
116 | - | |
117 | -LOCAL_COPY_HEADERS := va_android.h | |
118 | - | |
119 | 90 | LOCAL_MODULE_TAGS := optional |
120 | 91 | LOCAL_MODULE := libva-android |
121 | 92 |
@@ -133,15 +104,7 @@ LOCAL_SRC_FILES := \ | ||
133 | 104 | egl/va_egl.c |
134 | 105 | |
135 | 106 | 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\" | |
145 | 108 | |
146 | 109 | LOCAL_MODULE_TAGS := optional |
147 | 110 | LOCAL_MODULE := libva-egl |
@@ -158,17 +121,7 @@ include $(CLEAR_VARS) | ||
158 | 121 | |
159 | 122 | LOCAL_SRC_FILES := va_tpi.c |
160 | 123 | |
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\" | |
172 | 125 | |
173 | 126 | LOCAL_SHARED_LIBRARIES := libva |
174 | 127 |
@@ -194,7 +194,7 @@ extern "C" { | ||
194 | 194 | VAStatus vaPutSurface ( |
195 | 195 | VADisplay dpy, |
196 | 196 | VASurfaceID surface, |
197 | - sp<ISurface> draw, /* Android Surface/Window */ | |
197 | + sp<ANativeWindow> draw, /* Android Native Window */ | |
198 | 198 | short srcx, |
199 | 199 | short srcy, |
200 | 200 | unsigned short srcw, |
@@ -37,6 +37,16 @@ | ||
37 | 37 | #include <string.h> |
38 | 38 | #include <dlfcn.h> |
39 | 39 | #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 | |
40 | 50 | |
41 | 51 | #define DRIVER_EXTENSION "_drv_video.so" |
42 | 52 |
@@ -108,10 +118,8 @@ int vaDisplayIsValid(VADisplay dpy) | ||
108 | 118 | |
109 | 119 | static void default_log_error(const char *buffer) |
110 | 120 | { |
111 | -# ifdef ANDROID_ALOG | |
121 | +# ifdef ANDROID | |
112 | 122 | ALOGE("%s", buffer); |
113 | -# elif ANDROID_LOG | |
114 | - LOGE("%s", buffer); | |
115 | 123 | # else |
116 | 124 | fprintf(stderr, "libva error: %s", buffer); |
117 | 125 | # endif |
@@ -119,10 +127,8 @@ static void default_log_error(const char *buffer) | ||
119 | 127 | |
120 | 128 | static void default_log_info(const char *buffer) |
121 | 129 | { |
122 | -# ifdef ANDROID_ALOG | |
130 | +# ifdef ANDROID | |
123 | 131 | ALOGI("%s", buffer); |
124 | -# elif ANDROID_LOG | |
125 | - LOGI("%s", buffer); | |
126 | 132 | # else |
127 | 133 | fprintf(stderr, "libva info: %s", buffer); |
128 | 134 | # endif |
@@ -48,7 +48,8 @@ VADisplay vaGetDisplay ( | ||
48 | 48 | |
49 | 49 | #ifdef __cplusplus |
50 | 50 | #ifdef ANDROID |
51 | -#include <surfaceflinger/ISurface.h> | |
51 | +#include <system/window.h> | |
52 | +#include <utils/StrongPointer.h> | |
52 | 53 | using namespace android; |
53 | 54 | |
54 | 55 | /* |
@@ -62,7 +63,7 @@ using namespace android; | ||
62 | 63 | VAStatus vaPutSurface ( |
63 | 64 | VADisplay dpy, |
64 | 65 | VASurfaceID surface, |
65 | - sp<ISurface> draw, /* Android Window/Surface */ | |
66 | + sp<ANativeWindow> draw, /* Android Native Window */ | |
66 | 67 | short srcx, |
67 | 68 | short srcy, |
68 | 69 | unsigned short srcw, |