Added prefix for module name to omit mess with existing Camera HAL binaries
[unified-camera-hal:unified-camera-hal.git] / Android.mk
1
2 ifeq ($(TARGET_BOARD_PLATFORM),omap4)
3 ifeq ($(TI_OMAP4_CAMERAHAL_VARIANT),unified)
4
5
6 LOCAL_PATH := $(call my-dir)
7
8
9 # cleanup
10 include $(CLEAR_VARS)
11
12
13 # which adapter to use
14 # TODO: Move this option into runtime.
15 OMAP4_CAMERA_HAL_USES := OMX
16 #OMAP4_CAMERA_HAL_USES := USB
17
18 ifdef TI_OMAP4_CAMERAHAL_PPM
19     # Enable CameraHAL Power & Performance Measurement
20     CAMERAHAL_CFLAGS += -DCAMERAHAL_USE_PPM
21
22     ifdef TI_OMAP4_CAMERAHAL_PPM_ABSOLUTE
23         # Enable printing additional absolute system wide timestamps
24         CAMERAHAL_CFLAGS += -DCAMERAHAL_PPM_ABSOLUTE
25     endif
26 endif
27
28 ifdef TI_OMAP4_CAMERAHAL_DEBUG
29     # Enable CameraHAL debug logs
30     CAMERAHAL_CFLAGS += -DCAMERAHAL_DEBUG
31 endif
32
33 ifdef TI_OMAP4_CAMERAHAL_DEBUG_VERBOSE
34     # Enable CameraHAL verbose debug logs
35     CAMERAHAL_CFLAGS += -DCAMERAHAL_DEBUG_VERBOSE
36 endif
37
38 ifdef TI_OMAP4_CAMERAHAL_UTILS_DEBUG_FUNCTION_NAMES
39     # Enable CameraHAL function enter/exit logging
40     CAMERAHAL_CFLAGS += -DTI_UTILS_DEBUG_USE_FUNCTION_LOGGING
41 endif
42
43 ifdef TI_OMAP4_CAMERAHAL_UTILS_DEBUG_TIMESTAMPS
44     # Enable timestamp logging
45     CAMERAHAL_CFLAGS += -DTI_UTILS_DEBUG_USE_TIMESTAMPS
46 endif
47
48 ifdef TI_OMAP4_CAMERAHAL_UTILS_MESSAGE_QUEUE_DEBUG
49     # Enable MessageQueue debugging
50     CAMERAHAL_CFLAGS += -DTI_UTILS_MESSAGE_QUEUE_DEBUG
51 endif
52
53 ifndef TI_OMAP4_CAMERAHAL_DONT_USE_ASSERTS
54     # Enable asserts
55     CAMERAHAL_CFLAGS += -DCAMERAHAL_USE_ASSERTS
56 endif
57
58 ifdef ENHANCED_DOMX
59     # Enable DCC file data save
60     CAMERAHAL_CFLAGS += -DCAMERAHAL_USE_DCC_FILE_DATA_SAVE
61
62     # Enable mechanical misalignment
63     CAMERAHAL_CFLAGS += -DCAMERAHAL_USE_MECHANICAL_MISALIGNMENT
64
65     # Enabled manual exposure ranges
66     CAMERAHAL_CFLAGS += -DCAMERAHAL_USE_MANUAL_EXPOSURE_RANGES
67
68     # Enable image coding
69     CAMERAHAL_CFLAGS += -DCAMERAHAL_USE_IMAGE_CODING
70
71     # Enable S3D
72     CAMERAHAL_CFLAGS += -DCAMERAHAL_USE_S3D
73 endif
74
75 CAMERAHAL_CFLAGS += -DLOG_TAG=\"CameraHal\"
76
77
78 # Camera HAL includes
79 CAMERAHAL_INCLUDES := \
80     frameworks/base/include \
81     external \
82     hardware/ti/omap4xxx/tiler \
83     hardware/ti/omap4xxx/ion \
84     hardware/ti/omap4xxx/hwc
85
86 # 3rdparty sources
87 CAMERAHAL_3RDPARTY_SOURCES := \
88     src/3rdparty/NV12_resize.c
89
90 # utils sources
91 CAMERAHAL_UTILS_SOURCES := \
92     src/utils/Assert.cpp \
93     src/utils/ErrorUtils.cpp \
94     src/utils/DebugUtils.cpp \
95     src/utils/Log.cpp \
96     src/utils/MessageQueue.cpp \
97     src/utils/Semaphore.cpp
98
99 # Camera HAL sources
100 CAMERAHAL_COMMON_SOURCES := \
101     src/ANativeWindowDisplayAdapter.cpp \
102     src/AppCallbackNotifier.cpp \
103     src/CallbackMemory.cpp \
104     src/CameraParameters.cpp \
105     src/CameraProperties.cpp \
106     src/Device.cpp \
107     src/DevicePastry.cpp \
108     src/DisplayAdapterInterface.cpp \
109     src/Encoder_libjpeg.cpp \
110     src/EventProvider.cpp \
111     src/Frame.cpp \
112     src/FrameProvider.cpp \
113     src/Measurement.cpp \
114     src/MemoryManager.cpp \
115     src/Module.cpp \
116     src/PixelFormat.cpp \
117     src/SensorListener.cpp \
118     src/Surface.cpp \
119     src/TICameraParameters.cpp \
120     src/Tools.cpp \
121     src/Types.cpp \
122     src/adapters/BaseCameraAdapter.cpp
123
124 # Camera HAL libraries
125 CAMERAHAL_LIBRARIES := \
126     libui \
127     libbinder \
128     libutils \
129     libcutils \
130     libcamera_client \
131     libion
132
133
134 ifeq ($(OMAP4_CAMERA_HAL_USES),OMX)
135
136     # includes
137     CAMERAHAL_ADAPTER_INCLUDES := \
138         $(TI_OMAP4_DOMX_PATH)/omx_core/inc \
139         $(TI_OMAP4_DOMX_PATH)/mm_osal/inc \
140         $(LOCAL_PATH)/src/adapters/omx
141
142     # sources
143     CAMERAHAL_ADAPTER_SOURCES := \
144         src/adapters/omx/OMX3A.cpp \
145         src/adapters/omx/OMXAlgo.cpp \
146         src/adapters/omx/OMXCameraAdapter.cpp \
147         src/adapters/omx/OMXCapabilities.cpp \
148         src/adapters/omx/OMXCapture.cpp \
149         src/adapters/omx/OMXDccDataSave.cpp \
150         src/adapters/omx/OMXDefaults.cpp \
151         src/adapters/omx/OMXExif.cpp \
152         src/adapters/omx/OMXFD.cpp \
153         src/adapters/omx/OMXFocus.cpp \
154         src/adapters/omx/OmxTools.cpp \
155         src/adapters/omx/OMXZoom.cpp
156
157     # libraries
158     CAMERAHAL_ADAPTER_LIBRARIES := \
159         libmm_osal \
160         libOMX_Core \
161         libgui \
162         libdomx \
163         libjpeg \
164         libexif
165
166 else
167 ifeq ($(OMAP4_CAMERA_HAL_USES),USB)
168
169     # includes
170     CAMERAHAL_ADAPTER_INCLUDES := \
171         $(LOCAL_PATH)/src/adapters/v4l
172
173     # sources
174     CAMERAHAL_ADAPTER_SOURCES := \
175         src/adapters/v4l/V4LCameraAdapter.cpp
176
177 endif
178 endif
179
180
181 # includes
182 LOCAL_C_INCLUDES := \
183     $(CAMERAHAL_INCLUDES) \
184     $(CAMERAHAL_ADAPTER_INCLUDES)
185
186 # sources
187 LOCAL_SRC_FILES := \
188     $(CAMERAHAL_3RDPARTY_SOURCES) \
189     $(CAMERAHAL_UTILS_SOURCES) \
190     $(CAMERAHAL_COMMON_SOURCES) \
191     $(CAMERAHAL_ADAPTER_SOURCES)
192
193 # libraries
194 LOCAL_SHARED_LIBRARIES := \
195     $(CAMERAHAL_LIBRARIES) \
196     $(CAMERAHAL_ADAPTER_LIBRARIES)
197
198 # build
199 LOCAL_CFLAGS := -fno-short-enums -Werror=enum-compare -DCOPY_IMAGE_BUFFER $(CAMERAHAL_CFLAGS)
200 LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
201 LOCAL_MODULE := $(TI_OMAP4_UNIFIED_CAMERAHAL_MODULE_PREFIX)camera.$(TARGET_BOARD_PLATFORM)
202 LOCAL_MODULE_TAGS := optional
203
204 include $(BUILD_SHARED_LIBRARY)
205
206
207 endif # ifeq ($(TI_OMAP4_CAMERAHAL_VARIANT),unified)
208 endif # ifeq ($(TARGET_BOARD_PLATFORM),omap4)