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 17LOCAL_PATH := $(call my-dir) 18 19# Prevent the HAL from building on devices not specifically 20# requesting to use it. 21ifeq ($(USE_CAMERA_V4L2_HAL), true) 22 23v4l2_shared_libs := \ 24 libbase \ 25 libcamera_client \ 26 libcamera_metadata \ 27 libcutils \ 28 libhardware \ 29 liblog \ 30 libsync \ 31 libutils \ 32 33v4l2_static_libs := 34 35v4l2_cflags := -fno-short-enums -Wall -Wextra -fvisibility=hidden 36 37v4l2_c_includes := $(call include-path-for, camera) 38 39v4l2_src_files := \ 40 camera.cpp \ 41 capture_request.cpp \ 42 format_metadata_factory.cpp \ 43 metadata/boottime_state_delegate.cpp \ 44 metadata/enum_converter.cpp \ 45 metadata/metadata.cpp \ 46 metadata/metadata_reader.cpp \ 47 request_tracker.cpp \ 48 static_properties.cpp \ 49 stream_format.cpp \ 50 v4l2_camera.cpp \ 51 v4l2_camera_hal.cpp \ 52 v4l2_gralloc.cpp \ 53 v4l2_metadata_factory.cpp \ 54 v4l2_wrapper.cpp \ 55 56v4l2_test_files := \ 57 format_metadata_factory_test.cpp \ 58 metadata/control_test.cpp \ 59 metadata/default_option_delegate_test.cpp \ 60 metadata/enum_converter_test.cpp \ 61 metadata/ignored_control_delegate_test.cpp \ 62 metadata/map_converter_test.cpp \ 63 metadata/menu_control_options_test.cpp \ 64 metadata/metadata_reader_test.cpp \ 65 metadata/metadata_test.cpp \ 66 metadata/no_effect_control_delegate_test.cpp \ 67 metadata/partial_metadata_factory_test.cpp \ 68 metadata/property_test.cpp \ 69 metadata/ranged_converter_test.cpp \ 70 metadata/slider_control_options_test.cpp \ 71 metadata/state_test.cpp \ 72 metadata/tagged_control_delegate_test.cpp \ 73 metadata/tagged_control_options_test.cpp \ 74 metadata/v4l2_control_delegate_test.cpp \ 75 request_tracker_test.cpp \ 76 static_properties_test.cpp \ 77 78# 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) 85LOCAL_STATIC_LIBRARIES := \ 86 libgtest_prod \ 87 $(v4l2_static_libs) \ 88 89LOCAL_C_INCLUDES += $(v4l2_c_includes) 90LOCAL_SRC_FILES := $(v4l2_src_files) 91include $(BUILD_SHARED_LIBRARY) 92 93# 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 111endif # USE_CAMERA_V4L2_HAL 112