From 1fb99dbff14e8d5d433f50d2e7d597e6fd02edd7 Mon Sep 17 00:00:00 2001 From: Yunji Kim Date: Sat, 27 Oct 2012 10:10:59 +0900 Subject: [PATCH] exynos_omx: Add BOARD_USE_KHRONOS_OMX_HEADER flag. BOARD_USE_KHRONOS_OMX_HEADER flag is needed to include proper openMAX spec header file. If BOARD_USE_KHRONOS_OMX_HEADER is true, use khronos's original omx header files. - $(EXYNOS_OMX_TOP)/include/khronos/ else, use android's omx header files. - frameworks/native/include/media/openmax Google extends OMX header files of Khronos. - OMX_COLOR_FormatAndroidOpaque was added in OMX_COLOR_FORMATTYPE. - OMX_VIDEO_CodingVPX was added in OMX_VIDEO_CODINGTYPE. - FLAC type for audio was added. - etc.. So this BOARD_USE_KHRONOS_OMX_HEADER flag is needed to avoid conflict error about OMX_COLOR_FormatAndroidOpaque, etc. Change-Id: Ib03ad0ea83669e58125da32d590368ac11d36677 Signed-off-by: Yunji Kim Signed-off-by: Huisung Kang --- Android.mk | 7 +++++++ component/audio/dec/Android.mk | 9 ++++++++- component/audio/dec/mp3/Android.mk | 9 ++++++++- component/common/Android.mk | 18 ++++++++++++++++-- component/video/dec/Android.mk | 9 ++++++++- component/video/dec/h264/Android.mk | 9 ++++++++- component/video/dec/mpeg4/Android.mk | 9 ++++++++- component/video/dec/vp8/Android.mk | 9 +++++++-- component/video/enc/Android.mk | 13 ++++++++++++- component/video/enc/h264/Android.mk | 9 ++++++++- component/video/enc/mpeg4/Android.mk | 9 ++++++++- core/Android.mk | 9 ++++++++- include/exynos/Exynos_OMX_Def.h | 4 ++++ osal/Android.mk | 12 +++++++++--- 14 files changed, 119 insertions(+), 16 deletions(-) diff --git a/Android.mk b/Android.mk index 3a2778f..31c068f 100644 --- a/Android.mk +++ b/Android.mk @@ -6,6 +6,13 @@ include device/samsung/$(TARGET_DEVICE)/BoardConfig.mk BOARD_USE_ANB := true +# Set to false to use Android's OMX header files +BOARD_USE_KHRONOS_OMX_HEADER := false + +ifeq ($(BOARD_USE_KHRONOS_OMX_HEADER), false) +ANDROID_MEDIA_INC := $(TOP)/frameworks/native/include/media +endif + EXYNOS_OMX_TOP := $(LOCAL_PATH) EXYNOS_OMX_INC := $(EXYNOS_OMX_TOP)/include diff --git a/component/audio/dec/Android.mk b/component/audio/dec/Android.mk index 7b9992f..ed03cdd 100644 --- a/component/audio/dec/Android.mk +++ b/component/audio/dec/Android.mk @@ -10,7 +10,7 @@ LOCAL_MODULE_TAGS := optional LOCAL_STATIC_LIBRARIES := libsrpapi -LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \ +LOCAL_C_INCLUDES := \ $(EXYNOS_OMX_INC)/exynos \ $(EXYNOS_OMX_TOP)/osal \ $(EXYNOS_OMX_TOP)/core \ @@ -18,4 +18,11 @@ LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \ $(EXYNOS_OMX_COMPONENT)/audio/dec \ $(EXYNOS_AUDIO_CODEC)/alp/include +ifeq ($(BOARD_USE_KHRONOS_OMX_HEADER), true) +LOCAL_CFLAGS += -DUSE_KHRONOS_OMX_HEADER +LOCAL_C_INCLUDES += $(EXYNOS_OMX_INC)/khronos +else +LOCAL_C_INCLUDES += $(ANDROID_MEDIA_INC)/openmax +endif + include $(BUILD_STATIC_LIBRARY) diff --git a/component/audio/dec/mp3/Android.mk b/component/audio/dec/mp3/Android.mk index 6b636c5..31d94ca 100644 --- a/component/audio/dec/mp3/Android.mk +++ b/component/audio/dec/mp3/Android.mk @@ -20,7 +20,7 @@ LOCAL_STATIC_LIBRARIES := libExynosOMX_Adec libExynosOMX_OSAL libExynosOMX_Basec LOCAL_SHARED_LIBRARIES := libc libdl libcutils libutils libui \ libExynosOMX_Resourcemanager -LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \ +LOCAL_C_INCLUDES := \ $(EXYNOS_OMX_INC)/exynos \ $(EXYNOS_OMX_TOP)/osal \ $(EXYNOS_OMX_TOP)/core \ @@ -28,4 +28,11 @@ LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \ $(EXYNOS_OMX_COMPONENT)/audio/dec \ $(EXYNOS_AUDIO_CODEC)/alp/include +ifeq ($(BOARD_USE_KHRONOS_OMX_HEADER), true) +LOCAL_CFLAGS += -DUSE_KHRONOS_OMX_HEADER +LOCAL_C_INCLUDES += $(EXYNOS_OMX_INC)/khronos +else +LOCAL_C_INCLUDES += $(ANDROID_MEDIA_INC)/openmax +endif + include $(BUILD_SHARED_LIBRARY) diff --git a/component/common/Android.mk b/component/common/Android.mk index c1e6124..05c8d30 100644 --- a/component/common/Android.mk +++ b/component/common/Android.mk @@ -14,10 +14,17 @@ LOCAL_CFLAGS := LOCAL_STATIC_LIBRARIES := libExynosOMX_OSAL LOCAL_SHARED_LIBRARIES := libcutils libutils -LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \ +LOCAL_C_INCLUDES := \ $(EXYNOS_OMX_INC)/exynos \ $(EXYNOS_OMX_TOP)/osal +ifeq ($(BOARD_USE_KHRONOS_OMX_HEADER), true) +LOCAL_CFLAGS += -DUSE_KHRONOS_OMX_HEADER +LOCAL_C_INCLUDES += $(EXYNOS_OMX_INC)/khronos +else +LOCAL_C_INCLUDES += $(ANDROID_MEDIA_INC)/openmax +endif + include $(BUILD_STATIC_LIBRARY) include $(CLEAR_VARS) @@ -35,8 +42,15 @@ LOCAL_CFLAGS := LOCAL_STATIC_LIBRARIES := libExynosOMX_OSAL LOCAL_SHARED_LIBRARIES := libcutils libutils -LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \ +LOCAL_C_INCLUDES := \ $(EXYNOS_OMX_INC)/exynos \ $(EXYNOS_OMX_TOP)/osal +ifeq ($(BOARD_USE_KHRONOS_OMX_HEADER), true) +LOCAL_CFLAGS += -DUSE_KHRONOS_OMX_HEADER +LOCAL_C_INCLUDES += $(EXYNOS_OMX_INC)/khronos +else +LOCAL_C_INCLUDES += $(ANDROID_MEDIA_INC)/openmax +endif + include $(BUILD_SHARED_LIBRARY) diff --git a/component/video/dec/Android.mk b/component/video/dec/Android.mk index 642159d..9a718a6 100644 --- a/component/video/dec/Android.mk +++ b/component/video/dec/Android.mk @@ -9,7 +9,7 @@ LOCAL_MODULE := libExynosOMX_Vdec LOCAL_ARM_MODE := arm LOCAL_MODULE_TAGS := optional -LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \ +LOCAL_C_INCLUDES := \ $(EXYNOS_OMX_INC)/exynos \ $(EXYNOS_OMX_TOP)/osal \ $(EXYNOS_OMX_TOP)/core \ @@ -22,6 +22,13 @@ LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \ LOCAL_STATIC_LIBRARIES := libExynosVideoApi +ifeq ($(BOARD_USE_KHRONOS_OMX_HEADER), true) +LOCAL_CFLAGS += -DUSE_KHRONOS_OMX_HEADER +LOCAL_C_INCLUDES += $(EXYNOS_OMX_INC)/khronos +else +LOCAL_C_INCLUDES += $(ANDROID_MEDIA_INC)/openmax +endif + ifeq ($(BOARD_USE_ANB), true) LOCAL_STATIC_LIBRARIES += libExynosOMX_OSAL libcsc_helper LOCAL_CFLAGS += -DUSE_ANB diff --git a/component/video/dec/h264/Android.mk b/component/video/dec/h264/Android.mk index 3c7c6ba..a3eba98 100644 --- a/component/video/dec/h264/Android.mk +++ b/component/video/dec/h264/Android.mk @@ -28,7 +28,7 @@ LOCAL_STATIC_LIBRARIES := libExynosOMX_Vdec libExynosOMX_OSAL libExynosOMX_Basec LOCAL_SHARED_LIBRARIES := libc libdl libcutils libutils libui \ libExynosOMX_Resourcemanager libcsc libexynosv4l2 libion_exynos libexynosgscaler -LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \ +LOCAL_C_INCLUDES := \ $(EXYNOS_OMX_INC)/exynos \ $(EXYNOS_OMX_TOP)/osal \ $(EXYNOS_OMX_TOP)/core \ @@ -39,4 +39,11 @@ LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \ $(TOP)/hardware/samsung_slsi/exynos/libcsc \ $(TOP)/hardware/samsung_slsi/$(TARGET_BOARD_PLATFORM)/include +ifeq ($(BOARD_USE_KHRONOS_OMX_HEADER), true) +LOCAL_CFLAGS += -DUSE_KHRONOS_OMX_HEADER +LOCAL_C_INCLUDES += $(EXYNOS_OMX_INC)/khronos +else +LOCAL_C_INCLUDES += $(ANDROID_MEDIA_INC)/openmax +endif + include $(BUILD_SHARED_LIBRARY) diff --git a/component/video/dec/mpeg4/Android.mk b/component/video/dec/mpeg4/Android.mk index a41c613..cd7f657 100644 --- a/component/video/dec/mpeg4/Android.mk +++ b/component/video/dec/mpeg4/Android.mk @@ -24,7 +24,7 @@ LOCAL_STATIC_LIBRARIES := libExynosOMX_Vdec libExynosOMX_OSAL libExynosOMX_Basec LOCAL_SHARED_LIBRARIES := libc libdl libcutils libutils libui \ libExynosOMX_Resourcemanager libcsc libexynosv4l2 libion_exynos libexynosgscaler -LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \ +LOCAL_C_INCLUDES := \ $(EXYNOS_OMX_INC)/exynos \ $(EXYNOS_OMX_TOP)/osal \ $(EXYNOS_OMX_TOP)/core \ @@ -35,4 +35,11 @@ LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \ $(TOP)/hardware/samsung_slsi/exynos/libcsc \ $(TOP)/hardware/samsung_slsi/$(TARGET_BOARD_PLATFORM)/include +ifeq ($(BOARD_USE_KHRONOS_OMX_HEADER), true) +LOCAL_CFLAGS += -DUSE_KHRONOS_OMX_HEADER +LOCAL_C_INCLUDES += $(EXYNOS_OMX_INC)/khronos +else +LOCAL_C_INCLUDES += $(ANDROID_MEDIA_INC)/openmax +endif + include $(BUILD_SHARED_LIBRARY) diff --git a/component/video/dec/vp8/Android.mk b/component/video/dec/vp8/Android.mk index 29cc883..b16fdb8 100644 --- a/component/video/dec/vp8/Android.mk +++ b/component/video/dec/vp8/Android.mk @@ -24,7 +24,7 @@ LOCAL_STATIC_LIBRARIES := libExynosOMX_Vdec libExynosOMX_OSAL libExynosOMX_Basec LOCAL_SHARED_LIBRARIES := libc libdl libcutils libutils libui \ libExynosOMX_Resourcemanager libcsc libexynosv4l2 libion_exynos libexynosgscaler -LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \ +LOCAL_C_INCLUDES := \ $(EXYNOS_OMX_INC)/exynos \ $(EXYNOS_OMX_TOP)/osal \ $(EXYNOS_OMX_TOP)/core \ @@ -35,6 +35,11 @@ LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \ $(TOP)/hardware/samsung_slsi/exynos/libcsc \ $(TOP)/hardware/samsung_slsi/$(TARGET_BOARD_PLATFORM)/include - +ifeq ($(BOARD_USE_KHRONOS_OMX_HEADER), true) +LOCAL_CFLAGS += -DUSE_KHRONOS_OMX_HEADER +LOCAL_C_INCLUDES += $(EXYNOS_OMX_INC)/khronos +else +LOCAL_C_INCLUDES += $(ANDROID_MEDIA_INC)/openmax +endif include $(BUILD_SHARED_LIBRARY) diff --git a/component/video/enc/Android.mk b/component/video/enc/Android.mk index 22cee81..4950e70 100644 --- a/component/video/enc/Android.mk +++ b/component/video/enc/Android.mk @@ -9,7 +9,7 @@ LOCAL_MODULE := libExynosOMX_Venc LOCAL_ARM_MODE := arm LOCAL_MODULE_TAGS := optional -LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \ +LOCAL_C_INCLUDES := \ $(EXYNOS_OMX_INC)/exynos \ $(EXYNOS_OMX_TOP)/osal \ $(EXYNOS_OMX_TOP)/core \ @@ -20,6 +20,17 @@ LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \ $(TOP)/hardware/samsung_slsi/exynos/libcsc \ $(TOP)/hardware/samsung_slsi/$(TARGET_BOARD_PLATFORM)/include +ifeq ($(BOARD_USE_KHRONOS_OMX_HEADER), true) +LOCAL_CFLAGS += -DUSE_KHRONOS_OMX_HEADER +LOCAL_C_INCLUDES += $(EXYNOS_OMX_INC)/khronos +else +LOCAL_C_INCLUDES += $(ANDROID_MEDIA_INC)/openmax +endif + +ifeq ($(BOARD_USE_ANB), true) +LOCAL_CFLAGS += -DUSE_ANB +endif + ifeq ($(BOARD_USE_METADATABUFFERTYPE), true) LOCAL_CFLAGS += -DUSE_METADATABUFFERTYPE endif diff --git a/component/video/enc/h264/Android.mk b/component/video/enc/h264/Android.mk index ea894d1..d94c4d6 100644 --- a/component/video/enc/h264/Android.mk +++ b/component/video/enc/h264/Android.mk @@ -25,7 +25,7 @@ LOCAL_STATIC_LIBRARIES := libExynosOMX_Venc libExynosOMX_OSAL libExynosOMX_Basec LOCAL_SHARED_LIBRARIES := libc libdl libcutils libutils libui \ libExynosOMX_Resourcemanager libcsc libexynosv4l2 libion_exynos -LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \ +LOCAL_C_INCLUDES := \ $(EXYNOS_OMX_INC)/exynos \ $(EXYNOS_OMX_TOP)/osal \ $(EXYNOS_OMX_TOP)/core \ @@ -36,4 +36,11 @@ LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \ $(TOP)/hardware/samsung_slsi/exynos/libcsc \ $(TOP)/hardware/samsung_slsi/$(TARGET_BOARD_PLATFORM)/include +ifeq ($(BOARD_USE_KHRONOS_OMX_HEADER), true) +LOCAL_CFLAGS += -DUSE_KHRONOS_OMX_HEADER +LOCAL_C_INCLUDES += $(EXYNOS_OMX_INC)/khronos +else +LOCAL_C_INCLUDES += $(ANDROID_MEDIA_INC)/openmax +endif + include $(BUILD_SHARED_LIBRARY) diff --git a/component/video/enc/mpeg4/Android.mk b/component/video/enc/mpeg4/Android.mk index 739f770..9671be8 100644 --- a/component/video/enc/mpeg4/Android.mk +++ b/component/video/enc/mpeg4/Android.mk @@ -24,7 +24,7 @@ LOCAL_STATIC_LIBRARIES := libExynosOMX_Venc libExynosOMX_OSAL libExynosOMX_Basec LOCAL_SHARED_LIBRARIES := libc libdl libcutils libutils libui \ libExynosOMX_Resourcemanager libcsc libexynosv4l2 libion_exynos -LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \ +LOCAL_C_INCLUDES := \ $(EXYNOS_OMX_INC)/exynos \ $(EXYNOS_OMX_TOP)/osal \ $(EXYNOS_OMX_TOP)/core \ @@ -35,4 +35,11 @@ LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \ $(TOP)/hardware/samsung_slsi/exynos/libcsc \ $(TOP)/hardware/samsung_slsi/$(TARGET_BOARD_PLATFORM)/include +ifeq ($(BOARD_USE_KHRONOS_OMX_HEADER), true) +LOCAL_CFLAGS += -DUSE_KHRONOS_OMX_HEADER +LOCAL_C_INCLUDES += $(EXYNOS_OMX_INC)/khronos +else +LOCAL_C_INCLUDES += $(ANDROID_MEDIA_INC)/openmax +endif + include $(BUILD_SHARED_LIBRARY) diff --git a/core/Android.mk b/core/Android.mk index 0e0bcb6..4b66d26 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -18,10 +18,17 @@ LOCAL_STATIC_LIBRARIES := libExynosOMX_OSAL libExynosOMX_Basecomponent LOCAL_SHARED_LIBRARIES := libc libdl libcutils libutils \ libExynosOMX_Resourcemanager -LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \ +LOCAL_C_INCLUDES := \ $(EXYNOS_OMX_INC)/exynos \ $(EXYNOS_OMX_TOP)/osal \ $(EXYNOS_OMX_TOP)/component/common +ifeq ($(BOARD_USE_KHRONOS_OMX_HEADER), true) +LOCAL_CFLAGS += -DUSE_KHRONOS_OMX_HEADER +LOCAL_C_INCLUDES += $(EXYNOS_OMX_INC)/khronos +else +LOCAL_C_INCLUDES += $(ANDROID_MEDIA_INC)/openmax +endif + include $(BUILD_SHARED_LIBRARY) diff --git a/include/exynos/Exynos_OMX_Def.h b/include/exynos/Exynos_OMX_Def.h index 94461ef..91ca2ba 100644 --- a/include/exynos/Exynos_OMX_Def.h +++ b/include/exynos/Exynos_OMX_Def.h @@ -127,8 +127,10 @@ typedef enum _EXYNOS_OMX_COLOR_FORMATTYPE { /* to copy a encoded data for drm component using gsc or fimc */ OMX_SEC_COLOR_FormatEncodedData = OMX_COLOR_FormatYCbYCr, +#ifdef USE_KHRONOS_OMX_HEADER /* for Android SurfaceMediaSource*/ OMX_COLOR_FormatAndroidOpaque = 0x7F000789 +#endif }EXYNOS_OMX_COLOR_FORMATTYPE; typedef enum _EXYNOS_OMX_SUPPORTFORMAT_TYPE @@ -158,7 +160,9 @@ typedef struct _EXYNOS_OMX_VIDEO_PROFILELEVEL OMX_S32 level; } EXYNOS_OMX_VIDEO_PROFILELEVEL; +#ifdef USE_KHRONOS_OMX_HEADER #define OMX_VIDEO_CodingVPX 0x09 /**< Google VPX, formerly known as On2 VP8 */ +#endif #ifndef __OMX_EXPORTS #define __OMX_EXPORTS diff --git a/osal/Android.mk b/osal/Android.mk index ef21a6d..2dd4b92 100644 --- a/osal/Android.mk +++ b/osal/Android.mk @@ -27,7 +27,7 @@ endif LOCAL_STATIC_LIBRARIES := liblog libcutils libExynosVideoApi -LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \ +LOCAL_C_INCLUDES := \ $(EXYNOS_OMX_INC)/exynos \ $(EXYNOS_OMX_TOP)/osal \ $(EXYNOS_OMX_COMPONENT)/common \ @@ -35,9 +35,15 @@ LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \ $(EXYNOS_OMX_COMPONENT)/video/enc \ $(EXYNOS_VIDEO_CODEC)/v4l2/include \ $(TOP)/hardware/samsung_slsi/exynos/include \ - frameworks/native/include/media/hardware \ - frameworks/native/include/media/openmax \ $(TOP)/hardware/samsung_slsi/$(TARGET_BOARD_PLATFORM)/include \ $(TOP)/hardware/samsung_slsi/$(TARGET_SOC)/include +ifeq ($(BOARD_USE_KHRONOS_OMX_HEADER), true) +LOCAL_CFLAGS += -DUSE_KHRONOS_OMX_HEADER +LOCAL_C_INCLUDES += $(EXYNOS_OMX_INC)/khronos +else +LOCAL_C_INCLUDES += $(ANDROID_MEDIA_INC)/hardware +LOCAL_C_INCLUDES += $(ANDROID_MEDIA_INC)/openmax +endif + include $(BUILD_STATIC_LIBRARY) -- 2.20.1