1OLD_LOCAL_PATH := $(LOCAL_PATH)
2LOCAL_PATH:=$(call my-dir)
3
4# Build command line test app: mm-qcamera-app
5include $(LOCAL_PATH)/../../../common.mk
6include $(CLEAR_VARS)
7
8LOCAL_CFLAGS:= \
9        -DAMSS_VERSION=$(AMSS_VERSION) \
10        $(mmcamera_debug_defines) \
11        $(mmcamera_debug_cflags) \
12        $(USE_SERVER_TREE)
13
14ifeq ($(strip $(TARGET_USES_ION)),true)
15LOCAL_CFLAGS += -DUSE_ION
16endif
17
18LOCAL_CFLAGS += -D_ANDROID_ -DQCAMERA_REDEFINE_LOG
19
20# System header file path prefix
21LOCAL_CFLAGS += -DSYSTEM_HEADER_PREFIX=sys
22
23LOCAL_SRC_FILES:= \
24        src/mm_qcamera_main_menu.c \
25        src/mm_qcamera_app.c \
26        src/mm_qcamera_unit_test.c \
27        src/mm_qcamera_video.c \
28        src/mm_qcamera_preview.c \
29        src/mm_qcamera_snapshot.c \
30        src/mm_qcamera_rdi.c \
31        src/mm_qcamera_reprocess.c\
32        src/mm_qcamera_queue.c \
33        src/mm_qcamera_socket.c \
34        src/mm_qcamera_commands.c
35#        src/mm_qcamera_dual_test.c \
36
37LOCAL_C_INCLUDES:=$(LOCAL_PATH)/inc
38LOCAL_C_INCLUDES+= \
39        frameworks/native/include/media/openmax \
40        $(LOCAL_PATH)/../common \
41        $(LOCAL_PATH)/../mm-camera-interface/inc \
42        $(LOCAL_PATH)/../../../mm-image-codec/qexif \
43        $(LOCAL_PATH)/../../../mm-image-codec/qomx_core
44
45LOCAL_C_INCLUDES+= $(kernel_includes)
46LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps)
47
48LOCAL_CFLAGS += -DCAMERA_ION_HEAP_ID=ION_IOMMU_HEAP_ID
49ifeq ($(TARGET_BOARD_PLATFORM),msm8974)
50        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID
51        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
52        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=9
53else ifeq ($(filter $(TARGET_BOARD_PLATFORM), apq8084 msm8084),$(TARGET_BOARD_PLATFORM))
54        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID
55        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
56        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=9
57else ifeq ($(TARGET_BOARD_PLATFORM),msm8994)
58        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID
59        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
60        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=9
61else ifeq ($(TARGET_BOARD_PLATFORM),msm8916 msm8952 msm8937 msm8953)
62        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID
63        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
64        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=9
65else ifeq ($(TARGET_BOARD_PLATFORM),msm8226)
66        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID
67        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
68        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=9
69else ifeq ($(TARGET_BOARD_PLATFORM),msm8610)
70        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID
71        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
72        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=9
73else ifeq ($(TARGET_BOARD_PLATFORM),msm8960)
74        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID
75        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
76        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=5
77else ifneq (,$(filter msm8660,$(TARGET_BOARD_PLATFORM)))
78        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID # EBI
79        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
80        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=5
81else
82        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=GRALLOC_USAGE_PRIVATE_UNCACHED #uncached
83        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_CAMERA_HEAP_ID
84        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=5
85endif
86LOCAL_CFLAGS += -Wall -Wextra -Werror
87
88LOCAL_SHARED_LIBRARIES:= \
89         libcutils libdl liblog libmmcamera_interface
90
91LOCAL_MODULE_TAGS := optional
92
93LOCAL_32_BIT_ONLY := $(BOARD_QTI_CAMERA_32BIT_ONLY)
94
95LOCAL_MODULE:= mm-qcamera-app
96LOCAL_PROPRIETARY_MODULE := true
97
98include $(BUILD_EXECUTABLE)
99
100# Build tuning library
101include $(CLEAR_VARS)
102
103LOCAL_CFLAGS:= \
104        -DAMSS_VERSION=$(AMSS_VERSION) \
105        $(mmcamera_debug_defines) \
106        $(mmcamera_debug_cflags) \
107        $(USE_SERVER_TREE)
108
109ifeq ($(strip $(TARGET_USES_ION)),true)
110LOCAL_CFLAGS += -DUSE_ION
111endif
112
113LOCAL_CFLAGS += -D_ANDROID_ -DQCAMERA_REDEFINE_LOG
114
115# System header file path prefix
116LOCAL_CFLAGS += -DSYSTEM_HEADER_PREFIX=sys
117
118LOCAL_SRC_FILES:= \
119        src/mm_qcamera_main_menu.c \
120        src/mm_qcamera_app.c \
121        src/mm_qcamera_unit_test.c \
122        src/mm_qcamera_video.c \
123        src/mm_qcamera_preview.c \
124        src/mm_qcamera_snapshot.c \
125        src/mm_qcamera_rdi.c \
126        src/mm_qcamera_reprocess.c\
127        src/mm_qcamera_queue.c \
128        src/mm_qcamera_socket.c \
129        src/mm_qcamera_commands.c
130#        src/mm_qcamera_dual_test.c \
131
132LOCAL_C_INCLUDES:=$(LOCAL_PATH)/inc
133LOCAL_C_INCLUDES+= \
134        frameworks/native/include/media/openmax \
135        $(LOCAL_PATH)/../common \
136        $(LOCAL_PATH)/../mm-camera-interface/inc \
137        $(LOCAL_PATH)/../../../mm-image-codec/qexif \
138        $(LOCAL_PATH)/../../../mm-image-codec/qomx_core
139
140LOCAL_C_INCLUDES+= $(kernel_includes)
141LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps)
142
143LOCAL_CFLAGS += -DCAMERA_ION_HEAP_ID=ION_IOMMU_HEAP_ID
144ifeq ($(TARGET_BOARD_PLATFORM),msm8974)
145        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID
146        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
147        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=9
148else ifeq ($(filter $(TARGET_BOARD_PLATFORM), apq8084 msm8084),$(TARGET_BOARD_PLATFORM))
149        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID
150        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
151        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=9
152else ifeq ($(TARGET_BOARD_PLATFORM),msm8994)
153        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID
154        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
155        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=9
156else ifeq ($(TARGET_BOARD_PLATFORM),msm8916 msm8952 msm8937 msm8953)
157        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID
158        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
159        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=9
160else ifeq ($(TARGET_BOARD_PLATFORM),msm8226)
161        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID
162        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
163        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=9
164else ifeq ($(TARGET_BOARD_PLATFORM),msm8610)
165        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID
166        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
167        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=9
168else ifeq ($(TARGET_BOARD_PLATFORM),msm8960)
169        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID
170        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
171        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=5
172else ifneq (,$(filter msm8660,$(TARGET_BOARD_PLATFORM)))
173        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID # EBI
174        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
175        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=5
176else
177        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=GRALLOC_USAGE_PRIVATE_UNCACHED #uncached
178        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_CAMERA_HEAP_ID
179        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=5
180endif
181LOCAL_CFLAGS += -Wall -Wextra -Werror
182
183LOCAL_SHARED_LIBRARIES:= \
184         libcutils libdl liblog libmmcamera_interface
185
186LOCAL_MODULE_TAGS := optional
187
188LOCAL_32_BIT_ONLY := $(BOARD_QTI_CAMERA_32BIT_ONLY)
189
190LOCAL_MODULE:= libmm-qcamera
191LOCAL_PROPRIETARY_MODULE := true
192
193include $(BUILD_SHARED_LIBRARY)
194
195# Build cam_semaphore_tests
196include $(CLEAR_VARS)
197
198LOCAL_SRC_FILES := src/cam_semaphore_tests.cpp
199
200LOCAL_C_INCLUDES += $(LOCAL_PATH)/../common
201
202LOCAL_CFLAGS := -Wall -Wextra -Werror
203
204LOCAL_MODULE := cam_semaphore_tests
205LOCAL_MODULE_TAGS := tests
206
207include $(BUILD_NATIVE_TEST)
208
209LOCAL_PATH := $(OLD_LOCAL_PATH)
210