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_LICENSE_KINDS             := SPDX-license-identifier-BSD
112LOCAL_LICENSE_CONDITIONS        := notice
113LOCAL_NOTICE_FILE               := $(LOCAL_PATH)/../../../NOTICE
114LOCAL_MODULE_TAGS               := optional
115LOCAL_VENDOR_MODULE             := true
116LOCAL_CFLAGS                    := $(libmm-vdec-def) -Werror
117LOCAL_C_INCLUDES                += $(libmm-vdec-inc)
118LOCAL_ADDITIONAL_DEPENDENCIES   := $(libmm-vdec-add-dep)
119LOCAL_HEADER_LIBRARIES          := \
120    libnativebase_headers \
121    libhardware_headers \
122    media_plugin_headers \
123
124LOCAL_PRELINK_MODULE    := false
125LOCAL_SHARED_LIBRARIES  := liblog libcutils libdl libutils
126
127LOCAL_SHARED_LIBRARIES  += libqdMetaData
128
129LOCAL_SRC_FILES         := src/frameparser.cpp
130LOCAL_SRC_FILES         += src/h264_utils.cpp
131LOCAL_SRC_FILES         += src/ts_parser.cpp
132LOCAL_SRC_FILES         += src/mp4_utils.cpp
133LOCAL_SRC_FILES         += src/hevc_utils.cpp
134LOCAL_STATIC_LIBRARIES  := libOmxVidcCommon
135LOCAL_SRC_FILES         += src/omx_vdec_v4l2.cpp
136
137LOCAL_CFLAGS            += -Wno-error
138
139# Allow implicit fallthrough in omx_vdec_v4l2.cpp:5409 until it is fixed.
140LOCAL_CFLAGS += -Wno-implicit-fallthrough
141
142include $(BUILD_SHARED_LIBRARY)
143
144
145
146# ---------------------------------------------------------------------------------
147# 			Make the Shared library (libOmxSwVdec)
148# ---------------------------------------------------------------------------------
149
150include $(CLEAR_VARS)
151ifneq "$(wildcard $(QCPATH) )" ""
152ifeq ($(call is-board-platform-in-list, $(TARGETS_THAT_NEED_SW_VDEC)),true)
153
154LOCAL_MODULE                  := libOmxSwVdec
155LOCAL_LICENSE_KINDS           := SPDX-license-identifier-BSD
156LOCAL_LICENSE_CONDITIONS      := notice
157LOCAL_NOTICE_FILE             := $(LOCAL_PATH)/../../../NOTICE
158LOCAL_MODULE_TAGS             := optional
159LOCAL_VENDOR_MODULE           := true
160LOCAL_CFLAGS                  := $(libmm-vdec-def)
161LOCAL_C_INCLUDES              += $(libmm-vdec-inc)
162LOCAL_ADDITIONAL_DEPENDENCIES := $(libmm-vdec-add-dep)
163
164LOCAL_PRELINK_MODULE          := false
165LOCAL_SHARED_LIBRARIES        := liblog libcutils libutils
166LOCAL_SHARED_LIBRARIES        += libswvdec
167
168LOCAL_SRC_FILES               := src/omx_swvdec.cpp
169LOCAL_SRC_FILES               += src/omx_swvdec_utils.cpp
170
171include $(BUILD_SHARED_LIBRARY)
172endif
173endif
174
175# ---------------------------------------------------------------------------------
176#                END
177# ---------------------------------------------------------------------------------
178