hardware/intel/common/libva
Révision | 3889bbdce23ff216af4400dd3c9703277c79b91e (tree) |
---|---|
l'heure | 2017-06-12 10:41:00 |
Auteur | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Xiang, Haihao |
android: simplify Android logging
To support older versions, just check if ALOGx are defined.
Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
(cherry picked from commit 340d99b62600c1f86eabdefbfa778559d5ac5a7c)
@@ -28,11 +28,6 @@ LOCAL_PATH:= $(call my-dir) | ||
28 | 28 | LIBVA_DRIVERS_PATH_32 = /system/lib |
29 | 29 | LIBVA_DRIVERS_PATH_64 = /system/lib64 |
30 | 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)))) | |
35 | - | |
36 | 31 | include $(CLEAR_VARS) |
37 | 32 | |
38 | 33 | #LIBVA_MINOR_VERSION := 31 |
@@ -51,13 +46,6 @@ LOCAL_CFLAGS_64 += \ | ||
51 | 46 | -DVA_DRIVERS_PATH="\"$(LIBVA_DRIVERS_PATH_64)\"" \ |
52 | 47 | -DLOG_TAG=\"libva\" |
53 | 48 | |
54 | -# Android Jelly Bean defined ALOGx, older versions use LOGx | |
55 | -ifeq ($(ALOG_VERSION), $(ALOG_VERSION_REQ)) | |
56 | -LOCAL_CFLAGS += -DANDROID_ALOG | |
57 | -else | |
58 | -LOCAL_CFLAGS += -DANDROID_LOG | |
59 | -endif | |
60 | - | |
61 | 49 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. |
62 | 50 | |
63 | 51 | LOCAL_MODULE_TAGS := optional |
@@ -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 |