1# Copyright (C) 2011 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
15ifneq ($(filter generic_x86 generic_x86_64 generic generic_arm64 generic_mips generic_mips64, $(TARGET_DEVICE)),)
16
17LOCAL_PATH := $(call my-dir)
18
19include $(CLEAR_VARS)
20
21# Emulator camera module########################################################
22
23emulator_camera_module_relative_path := hw
24emulator_camera_cflags := -fno-short-enums -DQEMU_HARDWARE
25emulator_camera_cflags += -Wno-unused-parameter -Wno-missing-field-initializers
26emulator_camera_clang_flags := -Wno-c++11-narrowing
27emulator_camera_shared_libraries := \
28    libbinder \
29    libexif \
30    liblog \
31    libutils \
32    libcutils \
33    libEGL \
34    libGLESv1_CM \
35    libGLESv2 \
36    libui \
37    libdl \
38    libjpeg \
39    libcamera_metadata \
40    libhardware
41
42emulator_camera_static_libraries := \
43	android.hardware.camera.common@1.0-helper \
44	libyuv_static
45
46emulator_camera_c_includes := external/libjpeg-turbo \
47	external/libexif \
48	external/libyuv/files/include \
49	frameworks/native/include/media/hardware \
50	$(LOCAL_PATH)/../include \
51	$(LOCAL_PATH)/../../goldfish-opengl/system/OpenglSystemCommon \
52	$(call include-path-for, camera)
53
54emulator_camera_src := \
55	EmulatedCameraHal.cpp \
56	EmulatedCameraFactory.cpp \
57	EmulatedCameraHotplugThread.cpp \
58	EmulatedBaseCamera.cpp \
59	EmulatedCamera.cpp \
60		EmulatedCameraDevice.cpp \
61		EmulatedQemuCamera.cpp \
62		EmulatedQemuCameraDevice.cpp \
63		EmulatedFakeCamera.cpp \
64		EmulatedFakeCameraDevice.cpp \
65		EmulatedFakeRotatingCameraDevice.cpp \
66		Converters.cpp \
67		PreviewWindow.cpp \
68		CallbackNotifier.cpp \
69		QemuClient.cpp \
70		JpegCompressor.cpp \
71	EmulatedCamera2.cpp \
72		EmulatedFakeCamera2.cpp \
73		EmulatedQemuCamera2.cpp \
74		fake-pipeline2/Scene.cpp \
75		fake-pipeline2/Sensor.cpp \
76		fake-pipeline2/JpegCompressor.cpp \
77	EmulatedCamera3.cpp \
78		EmulatedFakeCamera3.cpp \
79		EmulatedQemuCamera3.cpp \
80		qemu-pipeline3/QemuSensor.cpp \
81	Exif.cpp \
82	Thumbnail.cpp \
83	WorkerThread.cpp \
84
85
86# Emulated camera - goldfish / vbox_x86 build###################################
87
88LOCAL_VENDOR_MODULE := true
89LOCAL_MODULE_RELATIVE_PATH := ${emulator_camera_module_relative_path}
90LOCAL_CFLAGS := ${emulator_camera_cflags}
91LOCAL_CLANG_CFLAGS += ${emulator_camera_clang_flags}
92
93LOCAL_SHARED_LIBRARIES := ${emulator_camera_shared_libraries}
94LOCAL_STATIC_LIBRARIES := ${emulator_camera_static_libraries}
95LOCAL_C_INCLUDES += ${emulator_camera_c_includes}
96LOCAL_SRC_FILES := ${emulator_camera_src}
97
98ifeq ($(TARGET_BOARD_PLATFORM),brilloemulator)
99LOCAL_MODULE := camera.$(TARGET_BOARD_PLATFORM)
100else ifeq ($(TARGET_PRODUCT),vbox_x86)
101LOCAL_MODULE := camera.vbox_x86
102else
103LOCAL_MODULE := camera.goldfish
104endif
105
106include $(BUILD_SHARED_LIBRARY)
107
108# Emulator camera - ranchu build################################################
109
110include ${CLEAR_VARS}
111
112LOCAL_VENDOR_MODULE := true
113LOCAL_MODULE_RELATIVE_PATH := ${emulator_camera_module_relative_path}
114LOCAL_CFLAGS := ${emulator_camera_cflags}
115LOCAL_CLANG_CFLAGS += ${emulator_camera_clang_flags}
116
117LOCAL_SHARED_LIBRARIES := ${emulator_camera_shared_libraries}
118LOCAL_STATIC_LIBRARIES := ${emulator_camera_static_libraries}
119LOCAL_C_INCLUDES += ${emulator_camera_c_includes}
120LOCAL_SRC_FILES := ${emulator_camera_src}
121
122LOCAL_MODULE := camera.ranchu
123
124include $(BUILD_SHARED_LIBRARY)
125
126# Build all subdirectories #####################################################
127include $(call all-makefiles-under,$(LOCAL_PATH))
128
129endif
130