Ari Hausman-Cohen | 7344215 | 2016-06-08 15:50:49 -0700 | [diff] [blame] | 1 | # |
| 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 | |
| 17 | LOCAL_PATH := $(call my-dir) |
Ari Hausman-Cohen | c17fd09 | 2016-07-18 10:13:26 -0700 | [diff] [blame] | 18 | |
| 19 | # Prevent the HAL from building on devices not specifically |
| 20 | # requesting to use it. |
| 21 | ifeq ($(USE_CAMERA_V4L2_HAL), true) |
| 22 | |
Ari Hausman-Cohen | cd9fef6 | 2016-07-15 15:54:13 -0700 | [diff] [blame] | 23 | v4l2_shared_libs := \ |
| 24 | libbase \ |
Prashanth Swaminathan | 28e0f76 | 2017-04-27 11:32:11 -0700 | [diff] [blame] | 25 | libchrome \ |
Ari Hausman-Cohen | cd9fef6 | 2016-07-15 15:54:13 -0700 | [diff] [blame] | 26 | libcamera_client \ |
| 27 | libcamera_metadata \ |
| 28 | libcutils \ |
Prashanth Swaminathan | 28e0f76 | 2017-04-27 11:32:11 -0700 | [diff] [blame] | 29 | libexif \ |
Ari Hausman-Cohen | cd9fef6 | 2016-07-15 15:54:13 -0700 | [diff] [blame] | 30 | libhardware \ |
| 31 | liblog \ |
Ari Hausman-Cohen | cd9fef6 | 2016-07-15 15:54:13 -0700 | [diff] [blame] | 32 | libsync \ |
| 33 | libutils \ |
Ari Hausman-Cohen | 7344215 | 2016-06-08 15:50:49 -0700 | [diff] [blame] | 34 | |
Prashanth Swaminathan | 28e0f76 | 2017-04-27 11:32:11 -0700 | [diff] [blame] | 35 | v4l2_static_libs := \ |
| 36 | libyuv_static \ |
| 37 | libjpeg_static_ndk \ |
Ari Hausman-Cohen | 7344215 | 2016-06-08 15:50:49 -0700 | [diff] [blame] | 38 | |
Sergii Piatakov | 628e9d9 | 2018-08-06 11:51:04 +0300 | [diff] [blame] | 39 | v4l2_cflags := -fno-short-enums -Wall -Wextra -Werror -fvisibility=hidden -DHAVE_JPEG |
Ari Hausman-Cohen | 7344215 | 2016-06-08 15:50:49 -0700 | [diff] [blame] | 40 | |
Prashanth Swaminathan | 28e0f76 | 2017-04-27 11:32:11 -0700 | [diff] [blame] | 41 | v4l2_c_includes := $(call include-path-for, camera) \ |
| 42 | external/libyuv/files/include \ |
Ari Hausman-Cohen | 7344215 | 2016-06-08 15:50:49 -0700 | [diff] [blame] | 43 | |
Ari Hausman-Cohen | cd9fef6 | 2016-07-15 15:54:13 -0700 | [diff] [blame] | 44 | v4l2_src_files := \ |
Prashanth Swaminathan | 28e0f76 | 2017-04-27 11:32:11 -0700 | [diff] [blame] | 45 | arc/cached_frame.cpp \ |
| 46 | arc/exif_utils.cpp \ |
| 47 | arc/frame_buffer.cpp \ |
| 48 | arc/image_processor.cpp \ |
| 49 | arc/jpeg_compressor.cpp \ |
Ari Hausman-Cohen | 3841a7f | 2016-07-19 17:27:52 -0700 | [diff] [blame] | 50 | camera.cpp \ |
Ari Hausman-Cohen | cb11a4d | 2016-09-19 17:57:37 -0700 | [diff] [blame] | 51 | capture_request.cpp \ |
Ari Hausman-Cohen | ffdc628 | 2016-08-19 12:54:22 -0700 | [diff] [blame] | 52 | format_metadata_factory.cpp \ |
Ari Hausman-Cohen | ef1c325 | 2016-11-22 13:32:18 -0800 | [diff] [blame] | 53 | metadata/boottime_state_delegate.cpp \ |
Ari Hausman-Cohen | f60dcc2 | 2016-08-12 16:43:28 -0700 | [diff] [blame] | 54 | metadata/enum_converter.cpp \ |
Ari Hausman-Cohen | 10481a3 | 2016-08-02 10:41:27 -0700 | [diff] [blame] | 55 | metadata/metadata.cpp \ |
Ari Hausman-Cohen | f45f8d4 | 2016-09-07 15:35:53 -0700 | [diff] [blame] | 56 | metadata/metadata_reader.cpp \ |
Ari Hausman-Cohen | cb11a4d | 2016-09-19 17:57:37 -0700 | [diff] [blame] | 57 | request_tracker.cpp \ |
Ari Hausman-Cohen | f45f8d4 | 2016-09-07 15:35:53 -0700 | [diff] [blame] | 58 | static_properties.cpp \ |
Ari Hausman-Cohen | 3841a7f | 2016-07-19 17:27:52 -0700 | [diff] [blame] | 59 | stream_format.cpp \ |
| 60 | v4l2_camera.cpp \ |
| 61 | v4l2_camera_hal.cpp \ |
Ari Hausman-Cohen | ffdc628 | 2016-08-19 12:54:22 -0700 | [diff] [blame] | 62 | v4l2_metadata_factory.cpp \ |
Ari Hausman-Cohen | 3841a7f | 2016-07-19 17:27:52 -0700 | [diff] [blame] | 63 | v4l2_wrapper.cpp \ |
Ari Hausman-Cohen | 7344215 | 2016-06-08 15:50:49 -0700 | [diff] [blame] | 64 | |
Ari Hausman-Cohen | cd9fef6 | 2016-07-15 15:54:13 -0700 | [diff] [blame] | 65 | v4l2_test_files := \ |
Ari Hausman-Cohen | ffdc628 | 2016-08-19 12:54:22 -0700 | [diff] [blame] | 66 | format_metadata_factory_test.cpp \ |
Ari Hausman-Cohen | 6c63b50 | 2016-08-02 11:28:29 -0700 | [diff] [blame] | 67 | metadata/control_test.cpp \ |
Ari Hausman-Cohen | 2491b37 | 2016-11-17 17:23:53 -0800 | [diff] [blame] | 68 | metadata/default_option_delegate_test.cpp \ |
Ari Hausman-Cohen | f60dcc2 | 2016-08-12 16:43:28 -0700 | [diff] [blame] | 69 | metadata/enum_converter_test.cpp \ |
Ari Hausman-Cohen | 899426f | 2016-08-15 18:33:31 -0700 | [diff] [blame] | 70 | metadata/ignored_control_delegate_test.cpp \ |
Ari Hausman-Cohen | 1760aa2 | 2016-08-15 15:21:13 -0700 | [diff] [blame] | 71 | metadata/map_converter_test.cpp \ |
Ari Hausman-Cohen | e2a9a01 | 2016-08-15 16:41:27 -0700 | [diff] [blame] | 72 | metadata/menu_control_options_test.cpp \ |
Ari Hausman-Cohen | f45f8d4 | 2016-09-07 15:35:53 -0700 | [diff] [blame] | 73 | metadata/metadata_reader_test.cpp \ |
Ari Hausman-Cohen | 10481a3 | 2016-08-02 10:41:27 -0700 | [diff] [blame] | 74 | metadata/metadata_test.cpp \ |
Ari Hausman-Cohen | 899426f | 2016-08-15 18:33:31 -0700 | [diff] [blame] | 75 | metadata/no_effect_control_delegate_test.cpp \ |
Ari Hausman-Cohen | cf5f57f | 2016-08-23 14:24:12 -0700 | [diff] [blame] | 76 | metadata/partial_metadata_factory_test.cpp \ |
Ari Hausman-Cohen | fd0ecb7 | 2016-08-12 15:45:25 -0700 | [diff] [blame] | 77 | metadata/property_test.cpp \ |
Ari Hausman-Cohen | 1760aa2 | 2016-08-15 15:21:13 -0700 | [diff] [blame] | 78 | metadata/ranged_converter_test.cpp \ |
Ari Hausman-Cohen | e2a9a01 | 2016-08-15 16:41:27 -0700 | [diff] [blame] | 79 | metadata/slider_control_options_test.cpp \ |
Ari Hausman-Cohen | cf5f57f | 2016-08-23 14:24:12 -0700 | [diff] [blame] | 80 | metadata/state_test.cpp \ |
Ari Hausman-Cohen | 9bd94f5 | 2016-08-16 14:16:55 -0700 | [diff] [blame] | 81 | metadata/tagged_control_delegate_test.cpp \ |
| 82 | metadata/tagged_control_options_test.cpp \ |
Ari Hausman-Cohen | 899426f | 2016-08-15 18:33:31 -0700 | [diff] [blame] | 83 | metadata/v4l2_control_delegate_test.cpp \ |
Ari Hausman-Cohen | cb11a4d | 2016-09-19 17:57:37 -0700 | [diff] [blame] | 84 | request_tracker_test.cpp \ |
Ari Hausman-Cohen | f45f8d4 | 2016-09-07 15:35:53 -0700 | [diff] [blame] | 85 | static_properties_test.cpp \ |
Ari Hausman-Cohen | 7344215 | 2016-06-08 15:50:49 -0700 | [diff] [blame] | 86 | |
Ari Hausman-Cohen | cd9fef6 | 2016-07-15 15:54:13 -0700 | [diff] [blame] | 87 | # V4L2 Camera HAL. |
| 88 | # ============================================================================== |
| 89 | include $(CLEAR_VARS) |
| 90 | LOCAL_MODULE := camera.v4l2 |
Bob Badour | d7984cc | 2021-02-12 20:51:13 -0800 | [diff] [blame] | 91 | LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD |
| 92 | LOCAL_LICENSE_CONDITIONS := notice |
| 93 | LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../../NOTICE |
Ari Hausman-Cohen | cd9fef6 | 2016-07-15 15:54:13 -0700 | [diff] [blame] | 94 | LOCAL_MODULE_RELATIVE_PATH := hw |
| 95 | LOCAL_CFLAGS += $(v4l2_cflags) |
| 96 | LOCAL_SHARED_LIBRARIES := $(v4l2_shared_libs) |
Yifan Hong | bb1479b | 2021-04-26 16:36:38 -0700 | [diff] [blame] | 97 | LOCAL_HEADER_LIBRARIES := libgtest_prod_headers |
| 98 | LOCAL_STATIC_LIBRARIES := $(v4l2_static_libs) |
Ari Hausman-Cohen | 5b7968c | 2016-08-02 11:30:53 -0700 | [diff] [blame] | 99 | |
Ari Hausman-Cohen | cd9fef6 | 2016-07-15 15:54:13 -0700 | [diff] [blame] | 100 | LOCAL_C_INCLUDES += $(v4l2_c_includes) |
| 101 | LOCAL_SRC_FILES := $(v4l2_src_files) |
Ari Hausman-Cohen | 7344215 | 2016-06-08 15:50:49 -0700 | [diff] [blame] | 102 | include $(BUILD_SHARED_LIBRARY) |
Ari Hausman-Cohen | c17fd09 | 2016-07-18 10:13:26 -0700 | [diff] [blame] | 103 | |
Ari Hausman-Cohen | cd9fef6 | 2016-07-15 15:54:13 -0700 | [diff] [blame] | 104 | # Unit tests for V4L2 Camera HAL. |
| 105 | # ============================================================================== |
| 106 | include $(CLEAR_VARS) |
| 107 | LOCAL_MODULE := camera.v4l2_test |
Bob Badour | d7984cc | 2021-02-12 20:51:13 -0800 | [diff] [blame] | 108 | LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD |
| 109 | LOCAL_LICENSE_CONDITIONS := notice |
| 110 | LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../../NOTICE |
Ari Hausman-Cohen | cd9fef6 | 2016-07-15 15:54:13 -0700 | [diff] [blame] | 111 | LOCAL_CFLAGS += $(v4l2_cflags) |
| 112 | LOCAL_SHARED_LIBRARIES := $(v4l2_shared_libs) |
| 113 | LOCAL_STATIC_LIBRARIES := \ |
Ari Hausman-Cohen | cd9fef6 | 2016-07-15 15:54:13 -0700 | [diff] [blame] | 114 | libgmock \ |
| 115 | $(v4l2_static_libs) \ |
| 116 | |
| 117 | LOCAL_C_INCLUDES += $(v4l2_c_includes) |
| 118 | LOCAL_SRC_FILES := \ |
| 119 | $(v4l2_src_files) \ |
| 120 | $(v4l2_test_files) \ |
| 121 | |
| 122 | include $(BUILD_NATIVE_TEST) |
| 123 | |
Ari Hausman-Cohen | c17fd09 | 2016-07-18 10:13:26 -0700 | [diff] [blame] | 124 | endif # USE_CAMERA_V4L2_HAL |