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 libmmcamera_interface
90
91LOCAL_MODULE_TAGS := optional
92
93LOCAL_32_BIT_ONLY := $(BOARD_QTI_CAMERA_32BIT_ONLY)
94
95LOCAL_MODULE:= mm-qcamera-app
96
97include $(BUILD_EXECUTABLE)
98
99# Build tuning library
100include $(CLEAR_VARS)
101
102LOCAL_CFLAGS:= \
103        -DAMSS_VERSION=$(AMSS_VERSION) \
104        $(mmcamera_debug_defines) \
105        $(mmcamera_debug_cflags) \
106        $(USE_SERVER_TREE)
107
108ifeq ($(strip $(TARGET_USES_ION)),true)
109LOCAL_CFLAGS += -DUSE_ION
110endif
111
112LOCAL_CFLAGS += -D_ANDROID_ -DQCAMERA_REDEFINE_LOG
113
114# System header file path prefix
115LOCAL_CFLAGS += -DSYSTEM_HEADER_PREFIX=sys
116
117LOCAL_SRC_FILES:= \
118        src/mm_qcamera_main_menu.c \
119        src/mm_qcamera_app.c \
120        src/mm_qcamera_unit_test.c \
121        src/mm_qcamera_video.c \
122        src/mm_qcamera_preview.c \
123        src/mm_qcamera_snapshot.c \
124        src/mm_qcamera_rdi.c \
125        src/mm_qcamera_reprocess.c\
126        src/mm_qcamera_queue.c \
127        src/mm_qcamera_socket.c \
128        src/mm_qcamera_commands.c
129#        src/mm_qcamera_dual_test.c \
130
131LOCAL_C_INCLUDES:=$(LOCAL_PATH)/inc
132LOCAL_C_INCLUDES+= \
133        frameworks/native/include/media/openmax \
134        $(LOCAL_PATH)/../common \
135        $(LOCAL_PATH)/../mm-camera-interface/inc \
136        $(LOCAL_PATH)/../../../mm-image-codec/qexif \
137        $(LOCAL_PATH)/../../../mm-image-codec/qomx_core
138
139LOCAL_C_INCLUDES+= $(kernel_includes)
140LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps)
141
142LOCAL_CFLAGS += -DCAMERA_ION_HEAP_ID=ION_IOMMU_HEAP_ID
143ifeq ($(TARGET_BOARD_PLATFORM),msm8974)
144        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID
145        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
146        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=9
147else ifeq ($(filter $(TARGET_BOARD_PLATFORM), apq8084 msm8084),$(TARGET_BOARD_PLATFORM))
148        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID
149        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
150        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=9
151else ifeq ($(TARGET_BOARD_PLATFORM),msm8994)
152        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID
153        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
154        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=9
155else ifeq ($(TARGET_BOARD_PLATFORM),msm8916 msm8952 msm8937 msm8953)
156        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID
157        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
158        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=9
159else ifeq ($(TARGET_BOARD_PLATFORM),msm8226)
160        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID
161        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
162        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=9
163else ifeq ($(TARGET_BOARD_PLATFORM),msm8610)
164        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID
165        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
166        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=9
167else ifeq ($(TARGET_BOARD_PLATFORM),msm8960)
168        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID
169        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
170        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=5
171else ifneq (,$(filter msm8660,$(TARGET_BOARD_PLATFORM)))
172        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID # EBI
173        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
174        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=5
175else
176        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=GRALLOC_USAGE_PRIVATE_UNCACHED #uncached
177        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_CAMERA_HEAP_ID
178        LOCAL_CFLAGS += -DNUM_RECORDING_BUFFERS=5
179endif
180LOCAL_CFLAGS += -Wall -Wextra -Werror
181
182LOCAL_SHARED_LIBRARIES:= \
183         libcutils libdl libmmcamera_interface
184
185LOCAL_MODULE_TAGS := optional
186
187LOCAL_32_BIT_ONLY := $(BOARD_QTI_CAMERA_32BIT_ONLY)
188
189LOCAL_MODULE:= libmm-qcamera
190
191include $(BUILD_SHARED_LIBRARY)
192
193LOCAL_PATH := $(OLD_LOCAL_PATH)
194