author | Lawrence Mok <lawrence.mok@amlogic.com> | 2013-11-09 21:32:21 (GMT) |
---|---|---|
committer | Lawrence Mok <lawrence.mok@amlogic.com> | 2013-11-09 21:32:21 (GMT) |
commit | 5a26f38447ba29ff1903794e80d43f9d5c95eda8 (patch) | |
tree | 1dd979c3de3aaf787fa9088bd364d06079f3d720 | |
parent | 8643ecc31d8a8a1afe40a2a7359a825265956a09 (diff) | |
download | hwcomposer-5a26f38447ba29ff1903794e80d43f9d5c95eda8.zip hwcomposer-5a26f38447ba29ff1903794e80d43f9d5c95eda8.tar.gz hwcomposer-5a26f38447ba29ff1903794e80d43f9d5c95eda8.tar.bz2 |
make LibPlayer dependency optional
-rwxr-xr-x | Android.mk | 21 | ||||
-rwxr-xr-x | hwcomposer.cpp | 8 |
2 files changed, 21 insertions, 8 deletions
@@ -7,22 +7,29 @@ LOCAL_PATH := $(call my-dir) # HAL module implemenation, not prelinked and stored in # /system/lib/hw/hwcomposer.amlogic.so include $(CLEAR_VARS) + LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw -LOCAL_SHARED_LIBRARIES := liblog libEGL libutils libamavutils libcutils +LOCAL_SHARED_LIBRARIES := liblog libEGL libutils libcutils LOCAL_SRC_FILES := hwcomposer.cpp ifneq (,$(wildcard hardware/amlogic/gralloc)) -GRALLOC_DIR := hardware/amlogic/gralloc -else +GRALLOC_DIR := hardware/amlogic/gralloc +else GRALLOC_DIR := hardware/libhardware/modules/gralloc endif +LOCAL_C_INCLUDES += \ + $(GRALLOC_DIR) + +ifneq ($(WITH_LIBPLAYER_MODULE),false) +LOCAL_SHARED_LIBRARIES += libamavutils AMPLAYER_APK_DIR=$(TOP)/packages/amlogic/LibPlayer/ -LOCAL_C_INCLUDES +=\ - $(AMPLAYER_APK_DIR)/amavutils/include \ - $(GRALLOC_DIR) \ +LOCAL_C_INCLUDES += \ + $(AMPLAYER_APK_DIR)/amavutils/include +LOCAL_CFLAGS += -DWITH_LIBPLAYER_MODULE=1 +endif LOCAL_MODULE := hwcomposer.amlogic -LOCAL_CFLAGS:= -DLOG_TAG=\"hwcomposer\" +LOCAL_CFLAGS += -DLOG_TAG=\"hwcomposer\" LOCAL_MODULE_TAGS := optional include $(BUILD_SHARED_LIBRARY) diff --git a/hwcomposer.cpp b/hwcomposer.cpp index fb5cc71..4216b7a 100755 --- a/hwcomposer.cpp +++ b/hwcomposer.cpp @@ -50,7 +50,10 @@ // for private_handle_t #include <gralloc_priv.h> +#if WITH_LIBPLAYER_MODULE #include <Amavutils.h> +#endif + #include <system/graphics.h> #ifndef LOGD #define LOGD ALOGD @@ -122,9 +125,9 @@ static void hwc_overlay_compose(hwc_composer_device_1_t *dev, hwc_layer_1_t cons int angle; struct hwc_context_1_t* ctx = (struct hwc_context_1_t*)dev; +#if WITH_LIBPLAYER_MODULE static char last_val[32] = "0"; int vpp_changed = 0; - char buf[40] = {0}; if (video_on_vpp2_enabled()) { char val[32]; memset(val, 0, sizeof(val)); @@ -173,6 +176,7 @@ static void hwc_overlay_compose(hwc_composer_device_1_t *dev, hwc_layer_1_t cons * to match the relationship between the UI and video overlay window position. */ amvideo_utils_set_screen_mode(0); +#endif ctx->saved_layer = l; ctx->saved_transform = l->transform; @@ -238,6 +242,7 @@ static int hwc_set(struct hwc_composer_device_1 *dev, return 0; } +#if WITH_LIBPLAYER_MODULE hwc_display_contents_1_t *list = displays[0]; for (size_t i=0 ; i<list->numHwLayers ; i++) { hwc_layer_1_t* l = &list->hwLayers[i]; @@ -248,6 +253,7 @@ static int hwc_set(struct hwc_composer_device_1 *dev, } } } +#endif EGLBoolean success = eglSwapBuffers(displays[0]->dpy, displays[0]->sur); |