blob: 1211a082a0fb7d4253713ed239e648ba5b367ae1 [file] [log] [blame]
Ari Hausman-Cohen73442152016-06-08 15:50:49 -07001#
2# Copyright 2016 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17LOCAL_PATH := $(call my-dir)
Ari Hausman-Cohenc17fd092016-07-18 10:13:26 -070018
19# Prevent the HAL from building on devices not specifically
20# requesting to use it.
21ifeq ($(USE_CAMERA_V4L2_HAL), true)
22
Ari Hausman-Cohencd9fef62016-07-15 15:54:13 -070023v4l2_shared_libs := \
24 libbase \
25 libcamera_client \
26 libcamera_metadata \
27 libcutils \
28 libhardware \
29 liblog \
30 libnativehelper \
31 libsync \
32 libutils \
Ari Hausman-Cohen73442152016-06-08 15:50:49 -070033
Ari Hausman-Cohencd9fef62016-07-15 15:54:13 -070034v4l2_static_libs :=
Ari Hausman-Cohen73442152016-06-08 15:50:49 -070035
Ari Hausman-Cohencd9fef62016-07-15 15:54:13 -070036v4l2_cflags := -fno-short-enums -Wall -Wextra -fvisibility=hidden
Ari Hausman-Cohen73442152016-06-08 15:50:49 -070037
Ari Hausman-Cohencd9fef62016-07-15 15:54:13 -070038v4l2_c_includes := $(call include-path-for, camera)
Ari Hausman-Cohen73442152016-06-08 15:50:49 -070039
Ari Hausman-Cohencd9fef62016-07-15 15:54:13 -070040v4l2_src_files := \
Ari Hausman-Cohen3841a7f2016-07-19 17:27:52 -070041 camera.cpp \
Ari Hausman-Cohencb11a4d2016-09-19 17:57:37 -070042 capture_request.cpp \
Ari Hausman-Cohenffdc6282016-08-19 12:54:22 -070043 format_metadata_factory.cpp \
Ari Hausman-Cohenf60dcc22016-08-12 16:43:28 -070044 metadata/enum_converter.cpp \
Ari Hausman-Cohen10481a32016-08-02 10:41:27 -070045 metadata/metadata.cpp \
Ari Hausman-Cohenf45f8d42016-09-07 15:35:53 -070046 metadata/metadata_reader.cpp \
Ari Hausman-Cohencb11a4d2016-09-19 17:57:37 -070047 request_tracker.cpp \
Ari Hausman-Cohenf45f8d42016-09-07 15:35:53 -070048 static_properties.cpp \
Ari Hausman-Cohen3841a7f2016-07-19 17:27:52 -070049 stream.cpp \
50 stream_format.cpp \
51 v4l2_camera.cpp \
52 v4l2_camera_hal.cpp \
53 v4l2_gralloc.cpp \
Ari Hausman-Cohenffdc6282016-08-19 12:54:22 -070054 v4l2_metadata_factory.cpp \
Ari Hausman-Cohen3841a7f2016-07-19 17:27:52 -070055 v4l2_wrapper.cpp \
Ari Hausman-Cohen73442152016-06-08 15:50:49 -070056
Ari Hausman-Cohencd9fef62016-07-15 15:54:13 -070057v4l2_test_files := \
Ari Hausman-Cohenffdc6282016-08-19 12:54:22 -070058 format_metadata_factory_test.cpp \
Ari Hausman-Cohen6c63b502016-08-02 11:28:29 -070059 metadata/control_test.cpp \
Ari Hausman-Cohenf60dcc22016-08-12 16:43:28 -070060 metadata/enum_converter_test.cpp \
Ari Hausman-Cohen899426f2016-08-15 18:33:31 -070061 metadata/ignored_control_delegate_test.cpp \
Ari Hausman-Cohen1760aa22016-08-15 15:21:13 -070062 metadata/map_converter_test.cpp \
Ari Hausman-Cohene2a9a012016-08-15 16:41:27 -070063 metadata/menu_control_options_test.cpp \
Ari Hausman-Cohenf45f8d42016-09-07 15:35:53 -070064 metadata/metadata_reader_test.cpp \
Ari Hausman-Cohen10481a32016-08-02 10:41:27 -070065 metadata/metadata_test.cpp \
Ari Hausman-Cohen899426f2016-08-15 18:33:31 -070066 metadata/no_effect_control_delegate_test.cpp \
Ari Hausman-Cohencf5f57f2016-08-23 14:24:12 -070067 metadata/partial_metadata_factory_test.cpp \
Ari Hausman-Cohenfd0ecb72016-08-12 15:45:25 -070068 metadata/property_test.cpp \
Ari Hausman-Cohen1760aa22016-08-15 15:21:13 -070069 metadata/ranged_converter_test.cpp \
Ari Hausman-Cohene2a9a012016-08-15 16:41:27 -070070 metadata/slider_control_options_test.cpp \
Ari Hausman-Cohencf5f57f2016-08-23 14:24:12 -070071 metadata/state_test.cpp \
Ari Hausman-Cohen9bd94f52016-08-16 14:16:55 -070072 metadata/tagged_control_delegate_test.cpp \
73 metadata/tagged_control_options_test.cpp \
Ari Hausman-Cohen899426f2016-08-15 18:33:31 -070074 metadata/v4l2_control_delegate_test.cpp \
Ari Hausman-Cohencb11a4d2016-09-19 17:57:37 -070075 request_tracker_test.cpp \
Ari Hausman-Cohenf45f8d42016-09-07 15:35:53 -070076 static_properties_test.cpp \
Ari Hausman-Cohen73442152016-06-08 15:50:49 -070077
Ari Hausman-Cohencd9fef62016-07-15 15:54:13 -070078# V4L2 Camera HAL.
79# ==============================================================================
80include $(CLEAR_VARS)
81LOCAL_MODULE := camera.v4l2
82LOCAL_MODULE_RELATIVE_PATH := hw
83LOCAL_CFLAGS += $(v4l2_cflags)
84LOCAL_SHARED_LIBRARIES := $(v4l2_shared_libs)
Ari Hausman-Cohen5b7968c2016-08-02 11:30:53 -070085LOCAL_STATIC_LIBRARIES := \
86 libgtest_prod \
87 $(v4l2_static_libs) \
88
Ari Hausman-Cohencd9fef62016-07-15 15:54:13 -070089LOCAL_C_INCLUDES += $(v4l2_c_includes)
90LOCAL_SRC_FILES := $(v4l2_src_files)
Ari Hausman-Cohen73442152016-06-08 15:50:49 -070091include $(BUILD_SHARED_LIBRARY)
Ari Hausman-Cohenc17fd092016-07-18 10:13:26 -070092
Ari Hausman-Cohencd9fef62016-07-15 15:54:13 -070093# Unit tests for V4L2 Camera HAL.
94# ==============================================================================
95include $(CLEAR_VARS)
96LOCAL_MODULE := camera.v4l2_test
97LOCAL_CFLAGS += $(v4l2_cflags)
98LOCAL_SHARED_LIBRARIES := $(v4l2_shared_libs)
99LOCAL_STATIC_LIBRARIES := \
100 libBionicGtestMain \
101 libgmock \
102 $(v4l2_static_libs) \
103
104LOCAL_C_INCLUDES += $(v4l2_c_includes)
105LOCAL_SRC_FILES := \
106 $(v4l2_src_files) \
107 $(v4l2_test_files) \
108
109include $(BUILD_NATIVE_TEST)
110
Ari Hausman-Cohenc17fd092016-07-18 10:13:26 -0700111endif # USE_CAMERA_V4L2_HAL