1LOCAL_PATH := $(call my-dir)
2include $(CLEAR_VARS)
3
4# ---------------------------------------------------------------------------------
5# 				Common definitons
6# ---------------------------------------------------------------------------------
7
8libmm-vdec-def := -D__alignx\(x\)=__attribute__\(\(__aligned__\(x\)\)\)
9libmm-vdec-def += -D__align=__alignx
10libmm-vdec-def += -Dinline=__inline
11libmm-vdec-def += -g -O3
12libmm-vdec-def += -DIMAGE_APPS_PROC
13libmm-vdec-def += -D_ANDROID_
14libmm-vdec-def += -DCDECL
15libmm-vdec-def += -DT_ARM
16libmm-vdec-def += -DNO_ARM_CLZ
17libmm-vdec-def += -UENABLE_DEBUG_LOW
18libmm-vdec-def += -UENABLE_DEBUG_HIGH
19libmm-vdec-def += -DENABLE_DEBUG_ERROR
20libmm-vdec-def += -UINPUT_BUFFER_LOG
21libmm-vdec-def += -UOUTPUT_BUFFER_LOG
22libmm-vdec-def += -Wno-parentheses
23libmm-vdec-def += -D_ANDROID_ICS_
24libmm-vdec-def += -D_MSM8974_
25libmm-vdec-def += -DPROCESS_EXTRADATA_IN_OUTPUT_PORT
26libmm-vdec-def += -DMAX_RES_1080P
27libmm-vdec-def += -DMAX_RES_1080P_EBI
28
29TARGETS_THAT_USE_HEVC_ADSP_HEAP := msm8226 msm8974
30TARGETS_THAT_HAVE_VENUS_HEVC := apq8084 msm8994 msm8996
31TARGETS_THAT_SUPPORT_UBWC := msm8996 msm8953 msm8998 sdm660
32TARGETS_THAT_NEED_SW_VDEC := msm8937 msm8909
33
34ifeq ($(call is-board-platform-in-list, $(TARGETS_THAT_USE_HEVC_ADSP_HEAP)),true)
35libmm-vdec-def += -D_HEVC_USE_ADSP_HEAP_
36endif
37
38ifeq ($(call is-board-platform-in-list, $(TARGETS_THAT_HAVE_VENUS_HEVC)),true)
39libmm-vdec-def += -DVENUS_HEVC
40endif
41
42ifeq ($(TARGET_BOARD_PLATFORM),msm8610)
43libmm-vdec-def += -DSMOOTH_STREAMING_DISABLED
44libmm-vdec-def += -DH264_PROFILE_LEVEL_CHECK
45endif
46
47ifeq ($(call is-board-platform-in-list, $(TARGETS_THAT_SUPPORT_UBWC)),true)
48libmm-vdec-def += -D_UBWC_
49endif
50
51ifeq ($(TARGET_USES_ION),true)
52libmm-vdec-def += -DUSE_ION
53endif
54
55ifneq (1,$(filter 1,$(shell echo "$$(( $(PLATFORM_SDK_VERSION) >= 18 ))" )))
56libmm-vdec-def += -DANDROID_JELLYBEAN_MR1=1
57endif
58
59ifeq ($(call is-board-platform-in-list, $(MASTER_SIDE_CP_TARGET_LIST)),true)
60libmm-vdec-def += -DMASTER_SIDE_CP
61endif
62
63include $(CLEAR_VARS)
64
65# Common Includes
66libmm-vdec-inc          := $(LOCAL_PATH)/inc
67libmm-vdec-inc          += $(QCOM_MEDIA_ROOT)/mm-video-v4l2/vidc/common/inc
68libmm-vdec-inc          += $(QCOM_MEDIA_ROOT)/mm-core/inc
69libmm-vdec-inc          += $(TARGET_OUT_HEADERS)/qcom/display
70libmm-vdec-inc          += $(TARGET_OUT_HEADERS)/adreno
71libmm-vdec-inc          += $(TOP)/frameworks/native/include/media/openmax
72libmm-vdec-inc          += $(TOP)/frameworks/native/include/media/hardware
73libmm-vdec-inc          += $(TOP)/frameworks/native/libs/nativewindow/include
74libmm-vdec-inc          += $(TOP)/frameworks/native/libs/nativebase/include
75libmm-vdec-inc      	+= $(QCOM_MEDIA_ROOT)/libc2dcolorconvert
76libmm-vdec-inc      	+= $(TARGET_OUT_HEADERS)/mm-video/SwVdec
77libmm-vdec-inc      	+= $(TARGET_OUT_HEADERS)/mm-video/swvdec
78ifeq ($(TARGET_COMPILE_WITH_MSM_KERNEL),true)
79libmm-vdec-inc      	+= $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
80endif
81
82ifeq ($(PLATFORM_SDK_VERSION), 18)  #JB_MR2
83libmm-vdec-def += -DANDROID_JELLYBEAN_MR2=1
84libmm-vdec-inc += $(QCOM_MEDIA_ROOT)/libstagefrighthw
85endif
86
87ifeq ($(TARGET_COMPILE_WITH_MSM_KERNEL),true)
88# Common Dependencies
89libmm-vdec-add-dep := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
90endif
91
92ifeq ($(call is-platform-sdk-version-at-least, 19),true)
93# This feature is enabled for Android KK+
94libmm-vdec-def += -DADAPTIVE_PLAYBACK_SUPPORTED
95endif
96
97ifeq ($(call is-platform-sdk-version-at-least, 22),true)
98# This feature is enabled for Android LMR1
99libmm-vdec-def += -DFLEXYUV_SUPPORTED
100endif
101
102libmm-vdec-def += -DALLOCATE_OUTPUT_NATIVEHANDLE
103
104# ---------------------------------------------------------------------------------
105# 			Make the Shared library (libOmxVdec)
106# ---------------------------------------------------------------------------------
107
108include $(CLEAR_VARS)
109
110LOCAL_MODULE                    := libOmxVdec
111LOCAL_MODULE_TAGS               := optional
112LOCAL_VENDOR_MODULE             := true
113LOCAL_CFLAGS                    := $(libmm-vdec-def) -Werror
114LOCAL_C_INCLUDES                += $(libmm-vdec-inc)
115LOCAL_ADDITIONAL_DEPENDENCIES   := $(libmm-vdec-add-dep)
116LOCAL_HEADER_LIBRARIES          := \
117    libnativebase_headers \
118    libhardware_headers \
119    media_plugin_headers \
120
121LOCAL_PRELINK_MODULE    := false
122LOCAL_SHARED_LIBRARIES  := liblog libcutils libdl libutils
123
124LOCAL_SHARED_LIBRARIES  += libqdMetaData
125
126LOCAL_SRC_FILES         := src/frameparser.cpp
127LOCAL_SRC_FILES         += src/h264_utils.cpp
128LOCAL_SRC_FILES         += src/ts_parser.cpp
129LOCAL_SRC_FILES         += src/mp4_utils.cpp
130LOCAL_SRC_FILES         += src/hevc_utils.cpp
131LOCAL_STATIC_LIBRARIES  := libOmxVidcCommon
132LOCAL_SRC_FILES         += src/omx_vdec_v4l2.cpp
133
134LOCAL_CFLAGS            += -Wno-error
135
136include $(BUILD_SHARED_LIBRARY)
137
138
139
140# ---------------------------------------------------------------------------------
141# 			Make the Shared library (libOmxSwVdec)
142# ---------------------------------------------------------------------------------
143
144include $(CLEAR_VARS)
145ifneq "$(wildcard $(QCPATH) )" ""
146ifeq ($(call is-board-platform-in-list, $(TARGETS_THAT_NEED_SW_VDEC)),true)
147
148LOCAL_MODULE                  := libOmxSwVdec
149LOCAL_MODULE_TAGS             := optional
150LOCAL_VENDOR_MODULE           := true
151LOCAL_CFLAGS                  := $(libmm-vdec-def)
152LOCAL_C_INCLUDES              += $(libmm-vdec-inc)
153LOCAL_ADDITIONAL_DEPENDENCIES := $(libmm-vdec-add-dep)
154
155LOCAL_PRELINK_MODULE          := false
156LOCAL_SHARED_LIBRARIES        := liblog libcutils libutils
157LOCAL_SHARED_LIBRARIES        += libswvdec
158
159LOCAL_SRC_FILES               := src/omx_swvdec.cpp
160LOCAL_SRC_FILES               += src/omx_swvdec_utils.cpp
161
162include $(BUILD_SHARED_LIBRARY)
163endif
164endif
165
166# ---------------------------------------------------------------------------------
167#                END
168# ---------------------------------------------------------------------------------
169