1 # Copyright (C) 2016 The Android Open Source Project 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 15 LOCAL_PATH := $(call my-dir) 16 17 include $(CLEAR_VARS) 18 19 # Emulator camera module######################################################## 20 21 emulator_camera_module_relative_path := hw 22 emulator_camera_cflags := -fno-short-enums $(VSOC_VERSION_CFLAGS) 23 emulator_camera_cflags += \ 24 -std=gnu++11 \ 25 -Wall \ 26 -Werror 27 28 emulator_camera_shared_libraries := \ 29 libbase \ 30 libbinder \ 31 libexif \ 32 liblog \ 33 libutils \ 34 libcutils \ 35 libui \ 36 libdl \ 37 libjpeg \ 38 libcamera_metadata \ 39 libhardware 40 41 ifeq (0, $(shell test $(PLATFORM_SDK_VERSION) -lt 27; echo $$?)) 42 emulator_camera_shared_libraries += libcamera_client 43 else 44 emulator_camera_static_libraries += android.hardware.camera.common (a] 1.0-helper 45 endif 46 47 ifeq (0, $(shell test $(PLATFORM_SDK_VERSION) -le 22; echo $$?)) 48 emulator_camera_shared_libraries += libjsoncpp 49 else 50 emulator_camera_static_libraries += libjsoncpp 51 endif 52 53 54 emulator_camera_static_libraries += android.hardware.camera.common (a] 1.0-helper 55 56 ifeq (0, $(shell test $(PLATFORM_SDK_VERSION) -le 26; echo $$?)) 57 emulator_camera_static_libraries += libyuv_static 58 else 59 emulator_camera_static_libraries += libyuv 60 endif 61 62 emulator_camera_c_includes := \ 63 device/google/cuttlefish_common \ 64 frameworks/native/include/media/hardware \ 65 $(call include-path-for, camera) \ 66 67 emulator_camera_src := \ 68 CameraConfiguration.cpp \ 69 EmulatedCameraHal.cpp \ 70 EmulatedCameraFactory.cpp \ 71 EmulatedBaseCamera.cpp \ 72 EmulatedCamera.cpp \ 73 EmulatedCameraDevice.cpp \ 74 EmulatedFakeCamera.cpp \ 75 EmulatedFakeCameraDevice.cpp \ 76 Exif.cpp \ 77 Thumbnail.cpp \ 78 Converters.cpp \ 79 PreviewWindow.cpp \ 80 CallbackNotifier.cpp \ 81 JpegCompressor.cpp 82 emulated_camera2_src := \ 83 VSoCEmulatedCameraHotplugThread.cpp \ 84 EmulatedCamera2.cpp \ 85 EmulatedFakeCamera2.cpp \ 86 fake-pipeline2/Scene.cpp \ 87 fake-pipeline2/Sensor.cpp \ 88 fake-pipeline2/JpegCompressor.cpp 89 emulated_camera3_src := \ 90 EmulatedCamera3.cpp \ 91 EmulatedFakeCamera3.cpp 92 93 94 emulated_camera2_stub_src := \ 95 StubEmulatedCamera2.cpp \ 96 StubEmulatedFakeCamera2.cpp 97 98 enable_emulated_camera3 = $(shell test $(PLATFORM_SDK_VERSION) -ge 23 && echo yes) 99 enable_emulated_camera2 = $(shell test $(PLATFORM_SDK_VERSION) -ge 19 && echo yes) 100 101 # Emulated camera - cuttlefish / vbox_x86 build################################### 102 # 103 ifeq (0, $(shell test $(PLATFORM_SDK_VERSION) -ge 24; echo $$?)) 104 emulator_camera_c_includes += external/libjpeg-turbo 105 else 106 emulator_camera_c_includes += external/jpeg 107 endif 108 109 ifeq (0, $(shell test $(PLATFORM_SDK_VERSION) -ge 21; echo $$?)) 110 LOCAL_MODULE_RELATIVE_PATH := ${emulator_camera_module_relative_path} 111 else 112 LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/${emulator_camera_module_relative_path} 113 endif 114 ifeq (true, $(TARGET_TRANSLATE_2ND_ARCH)) 115 LOCAL_MULTILIB := first 116 endif 117 LOCAL_CFLAGS := ${emulator_camera_cflags} 118 LOCAL_CLANG_CFLAGS += ${emulator_camera_clang_flags} 119 120 LOCAL_SHARED_LIBRARIES := ${emulator_camera_shared_libraries} 121 LOCAL_STATIC_LIBRARIES := ${emulator_camera_static_libraries} 122 LOCAL_C_INCLUDES += ${emulator_camera_c_includes} 123 LOCAL_SRC_FILES := ${emulator_camera_src} ${emulator_camera_ext_src} \ 124 $(if $(enable_emulated_camera2),$(emulated_camera2_src),) \ 125 $(if $(enable_emulated_camera3),$(emulated_camera3_src),) 126 127 LOCAL_MODULE := camera.vsoc 128 LOCAL_MODULE_TAGS := optional 129 LOCAL_VENDOR_MODULE := true 130 131 include $(BUILD_SHARED_LIBRARY) 132 133 # JPEG stub##################################################################### 134 135 include $(CLEAR_VARS) 136 137 jpeg_module_relative_path := hw 138 jpeg_cflags := \ 139 -fno-short-enums \ 140 -Wall \ 141 -Werror 142 143 jpeg_shared_libraries := \ 144 libcutils \ 145 libexif \ 146 liblog \ 147 libjpeg \ 148 149 jpeg_c_includes := external/libexif \ 150 frameworks/native/include 151 ifeq (0, $(shell test $(PLATFORM_SDK_VERSION) -ge 24; echo $$?)) 152 jpeg_c_includes += external/libjpeg-turbo 153 else 154 jpeg_c_includes += external/jpeg 155 endif 156 157 jpeg_src := \ 158 Compressor.cpp \ 159 JpegStub.cpp \ 160 161 # JPEG stub - cuttlefish build#################################################### 162 163 ifeq (true, $(TARGET_TRANSLATE_2ND_ARCH)) 164 LOCAL_MULTILIB := first 165 endif 166 167 LOCAL_C_INCLUDES += ${jpeg_c_includes} 168 LOCAL_SRC_FILES := ${jpeg_src} 169 170 LOCAL_MODULE_RELATIVE_PATH := ${jpeg_module_relative_path} 171 LOCAL_CFLAGS += ${jpeg_cflags} 172 173 LOCAL_SHARED_LIBRARIES := ${jpeg_shared_libraries} 174 175 LOCAL_C_INCLUDES += ${jpeg_c_includes} 176 LOCAL_SRC_FILES := ${jpeg_src} 177 178 LOCAL_MODULE := camera.vsoc.jpeg 179 LOCAL_MODULE_TAGS := optional 180 LOCAL_VENDOR_MODULE := true 181 182 include $(BUILD_SHARED_LIBRARY) 183