• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

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

Révision3889bbdce23ff216af4400dd3c9703277c79b91e (tree)
l'heure2017-06-12 10:41:00
AuteurChih-Wei Huang <cwhuang@linu...>
CommiterXiang, Haihao

Message de Log

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)

Change Summary

Modification

--- a/va/Android.mk
+++ b/va/Android.mk
@@ -28,11 +28,6 @@ LOCAL_PATH:= $(call my-dir)
2828 LIBVA_DRIVERS_PATH_32 = /system/lib
2929 LIBVA_DRIVERS_PATH_64 = /system/lib64
3030
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-
3631 include $(CLEAR_VARS)
3732
3833 #LIBVA_MINOR_VERSION := 31
@@ -51,13 +46,6 @@ LOCAL_CFLAGS_64 += \
5146 -DVA_DRIVERS_PATH="\"$(LIBVA_DRIVERS_PATH_64)\"" \
5247 -DLOG_TAG=\"libva\"
5348
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-
6149 LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
6250
6351 LOCAL_MODULE_TAGS := optional
--- 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