1LOCAL_PATH:= $(call my-dir)
2
3ifeq ($(TARGET_BOARD_PLATFORM),msm8960)
4ifneq ($(USE_CAMERA_STUB),true)
5ifeq ($(USE_DEVICE_SPECIFIC_CAMERA),true)
6
7    # When zero we link against libmmcamera; when 1, we dlopen libmmcamera.
8    DLOPEN_LIBMMCAMERA:=1
9    ifneq ($(BUILD_TINY_ANDROID),true)
10      V4L2_BASED_LIBCAM := true
11
12      LOCAL_PATH1:= $(call my-dir)
13
14      include $(CLEAR_VARS)
15
16      LOCAL_CFLAGS:= -DDLOPEN_LIBMMCAMERA=$(DLOPEN_LIBMMCAMERA)
17
18      #define BUILD_UNIFIED_CODE
19      ifeq ($(TARGET_BOARD_PLATFORM),msm7627a)
20        BUILD_UNIFIED_CODE := true
21      else
22        BUILD_UNIFIED_CODE := false
23      endif
24
25      ifeq ($(TARGET_BOARD_PLATFORM),msm7627a)
26        LOCAL_CFLAGS+= -DVFE_7X27A
27      endif
28
29      ifeq ($(strip $(TARGET_USES_ION)),true)
30        LOCAL_CFLAGS += -DUSE_ION
31      endif
32
33      LOCAL_CFLAGS += -DCAMERA_ION_HEAP_ID=ION_IOMMU_HEAP_ID
34      LOCAL_CFLAGS += -DCAMERA_ZSL_ION_HEAP_ID=ION_IOMMU_HEAP_ID
35      ifeq ($(TARGET_BOARD_PLATFORM),msm8960)
36        LOCAL_CFLAGS += -DCAMERA_GRALLOC_HEAP_ID=GRALLOC_USAGE_PRIVATE_IOMMU_HEAP
37        LOCAL_CFLAGS += -DCAMERA_GRALLOC_FALLBACK_HEAP_ID=GRALLOC_USAGE_PRIVATE_SYSTEM_HEAP
38        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID
39        LOCAL_CFLAGS += -DCAMERA_ZSL_ION_FALLBACK_HEAP_ID=ION_IOMMU_HEAP_ID
40        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
41      else ifeq ($(TARGET_BOARD_PLATFORM),msm8660)
42        LOCAL_CFLAGS += -DCAMERA_GRALLOC_HEAP_ID=GRALLOC_USAGE_PRIVATE_CAMERA_HEAP
43        LOCAL_CFLAGS += -DCAMERA_GRALLOC_FALLBACK_HEAP_ID=GRALLOC_USAGE_PRIVATE_CAMERA_HEAP # Don't Care
44        LOCAL_CFLAGS += -DCAMERA_ION_FALLBACK_HEAP_ID=ION_CAMERA_HEAP_ID # EBI
45        LOCAL_CFLAGS += -DCAMERA_ZSL_ION_FALLBACK_HEAP_ID=ION_CAMERA_HEAP_ID
46        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=0
47      else
48        LOCAL_CFLAGS += -DCAMERA_GRALLOC_HEAP_ID=GRALLOC_USAGE_PRIVATE_ADSP_HEAP
49        LOCAL_CFLAGS += -DCAMERA_GRALLOC_FALLBACK_HEAP_ID=GRALLOC_USAGE_PRIVATE_ADSP_HEAP # Don't Care
50        LOCAL_CFLAGS += -DCAMERA_GRALLOC_CACHING_ID=GRALLOC_USAGE_PRIVATE_UNCACHED #uncached
51      endif
52
53      ifeq ($(V4L2_BASED_LIBCAM),true)
54        ifeq ($(TARGET_BOARD_PLATFORM),msm7627a)
55          LOCAL_HAL_FILES := QCameraHAL.cpp QCameraHWI_Parm.cpp\
56            QCameraHWI.cpp QCameraHWI_Preview.cpp \
57            QCameraHWI_Record_7x27A.cpp QCameraHWI_Still.cpp \
58            QCameraHWI_Mem.cpp QCameraHWI_Display.cpp \
59            QCameraStream.cpp QualcommCamera2.cpp
60        else
61          LOCAL_HAL_FILES := QCameraHAL.cpp QCameraHWI_Parm.cpp\
62            QCameraHWI.cpp QCameraHWI_Preview.cpp \
63            QCameraHWI_Record.cpp QCameraHWI_Still.cpp \
64            QCameraHWI_Mem.cpp QCameraHWI_Display.cpp \
65            QCameraStream.cpp QualcommCamera2.cpp QCameraParameters.cpp
66        endif
67
68      else
69        LOCAL_HAL_FILES := QualcommCamera.cpp QualcommCameraHardware.cpp
70      endif
71
72      LOCAL_CFLAGS+= -DHW_ENCODE
73
74      # if debug service layer and up , use stub camera!
75      LOCAL_C_INCLUDES += \
76        frameworks/base/services/camera/libcameraservice #
77
78      LOCAL_SRC_FILES := $(MM_CAM_FILES) $(LOCAL_HAL_FILES)
79
80      ifeq ($(TARGET_BOARD_PLATFORM),msm7627a)
81        LOCAL_CFLAGS+= -DNUM_PREVIEW_BUFFERS=6 -D_ANDROID_
82      else
83        LOCAL_CFLAGS+= -DNUM_PREVIEW_BUFFERS=4 -D_ANDROID_
84      endif
85
86      # To Choose neon/C routines for YV12 conversion
87      LOCAL_CFLAGS+= -DUSE_NEON_CONVERSION
88      # Uncomment below line to enable smooth zoom
89      #LOCAL_CFLAGS+= -DCAMERA_SMOOTH_ZOOM
90
91      ifeq ($(V4L2_BASED_LIBCAM),true)
92        LOCAL_C_INCLUDES+= hardware/qcom/media/mm-core/inc
93        LOCAL_C_INCLUDES+= $(LOCAL_PATH)/mm-camera-interface
94      endif
95
96      LOCAL_C_INCLUDES+= hardware/qcom/display/msm8960/libgralloc
97      LOCAL_C_INCLUDES+= hardware/qcom/display/msm8960/libgenlock
98      LOCAL_C_INCLUDES+= frameworks/native/include/media/hardware
99      LOCAL_C_INCLUDES+= hardware/qcom/media/libstagefrighthw
100
101
102      ifeq ($(V4L2_BASED_LIBCAM),true)
103        LOCAL_SHARED_LIBRARIES:= libutils libui libcamera_client libcamera_metadata liblog libcutils
104        LOCAL_SHARED_LIBRARIES += libmmcamera_interface2
105      else
106         LOCAL_SHARED_LIBRARIES:= libutils libui libcamera_client liblog libcamera_metadata libcutils libmmjpeg
107      endif
108
109      LOCAL_SHARED_LIBRARIES+= libgenlock libbinder
110      ifneq ($(DLOPEN_LIBMMCAMERA),1)
111        LOCAL_SHARED_LIBRARIES+= liboemcamera
112      else
113        LOCAL_SHARED_LIBRARIES+= libdl
114      endif
115
116      LOCAL_CFLAGS += -include bionic/libc/include/sys/socket.h
117
118      LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
119      LOCAL_MODULE:= camera.$(TARGET_DEVICE)
120      LOCAL_MODULE_TAGS := optional
121      include $(BUILD_SHARED_LIBRARY)
122
123    endif # BUILD_TINY_ANDROID
124
125ifeq ($(V4L2_BASED_LIBCAM),true)
126include $(LOCAL_PATH)/mm-camera-interface/Android.mk
127endif
128
129#Enable only to compile new interafece and HAL files.
130ifeq ($(V4L2_BASED_LIBCAM),true)
131#include $(LOCAL_PATH1)/QCamera/Android.mk
132endif
133
134endif # USE_CAMERA_STUB
135endif
136endif
137