Bill Yang | 903494c | 2024-09-06 01:49:16 +0000 | [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 | package { |
| 17 | // See: http://go/android-license-faq |
| 18 | default_applicable_licenses: [ |
| 19 | "hardware_libhardware_license", |
| 20 | ], |
| 21 | default_team: "trendy_team_camera_framework", |
| 22 | } |
| 23 | |
| 24 | v4l2_shared_libs = [ |
| 25 | "libbase", |
| 26 | "libchrome", |
| 27 | "libcamera_client", |
| 28 | "libcamera_metadata", |
| 29 | "libcutils", |
| 30 | "libexif", |
| 31 | "libhardware", |
| 32 | "liblog", |
| 33 | "libsync", |
| 34 | "libutils", |
| 35 | ] |
| 36 | |
| 37 | v4l2_static_libs = [ |
| 38 | "libyuv_static", |
| 39 | "libjpeg_static_ndk", |
| 40 | ] |
| 41 | |
| 42 | v4l2_cflags = [ |
| 43 | "-fno-short-enums", |
| 44 | "-Wall", |
| 45 | "-Wextra", |
| 46 | "-Werror", |
| 47 | "-fvisibility=hidden", |
| 48 | "-DHAVE_JPEG", |
| 49 | ] |
| 50 | |
| 51 | v4l2_c_includes = [ |
| 52 | "system/media/camera/include", |
| 53 | ] |
| 54 | |
| 55 | v4l2_src_files = [ |
| 56 | "arc/cached_frame.cpp", |
| 57 | "arc/exif_utils.cpp", |
| 58 | "arc/frame_buffer.cpp", |
| 59 | "arc/image_processor.cpp", |
| 60 | "arc/jpeg_compressor.cpp", |
| 61 | "camera.cpp", |
| 62 | "capture_request.cpp", |
| 63 | "format_metadata_factory.cpp", |
| 64 | "metadata/boottime_state_delegate.cpp", |
| 65 | "metadata/enum_converter.cpp", |
| 66 | "metadata/metadata.cpp", |
| 67 | "metadata/metadata_reader.cpp", |
| 68 | "request_tracker.cpp", |
| 69 | "static_properties.cpp", |
| 70 | "stream_format.cpp", |
| 71 | "v4l2_camera.cpp", |
| 72 | "v4l2_camera_hal.cpp", |
| 73 | "v4l2_metadata_factory.cpp", |
| 74 | "v4l2_wrapper.cpp", |
| 75 | ] |
| 76 | |
| 77 | v4l2_test_files = [ |
| 78 | "format_metadata_factory_test.cpp", |
| 79 | "metadata/control_test.cpp", |
| 80 | "metadata/default_option_delegate_test.cpp", |
| 81 | "metadata/enum_converter_test.cpp", |
| 82 | "metadata/ignored_control_delegate_test.cpp", |
| 83 | "metadata/map_converter_test.cpp", |
| 84 | "metadata/menu_control_options_test.cpp", |
| 85 | "metadata/metadata_reader_test.cpp", |
| 86 | "metadata/metadata_test.cpp", |
| 87 | "metadata/no_effect_control_delegate_test.cpp", |
| 88 | "metadata/partial_metadata_factory_test.cpp", |
| 89 | "metadata/property_test.cpp", |
| 90 | "metadata/ranged_converter_test.cpp", |
| 91 | "metadata/slider_control_options_test.cpp", |
| 92 | "metadata/state_test.cpp", |
| 93 | "metadata/tagged_control_delegate_test.cpp", |
| 94 | "metadata/tagged_control_options_test.cpp", |
| 95 | "metadata/v4l2_control_delegate_test.cpp", |
| 96 | "request_tracker_test.cpp", |
| 97 | "static_properties_test.cpp", |
| 98 | ] |
| 99 | |
| 100 | // V4L2 Camera HAL. |
| 101 | // ============================================================================== |
| 102 | cc_library_shared { |
| 103 | name: "camera.v4l2", |
| 104 | relative_install_path: "hw", |
| 105 | cflags: v4l2_cflags, |
| 106 | shared_libs: v4l2_shared_libs, |
| 107 | header_libs: ["libgtest_prod_headers"], |
| 108 | static_libs: v4l2_static_libs, |
| 109 | |
| 110 | include_dirs: v4l2_c_includes, |
| 111 | srcs: v4l2_src_files, |
| 112 | enabled: select(soong_config_variable("camera", "use_camera_v4l2_hal"), { |
| 113 | true: true, |
| 114 | default: false, |
| 115 | }), |
| 116 | } |
| 117 | |
| 118 | // Unit tests for V4L2 Camera HAL. |
| 119 | // ============================================================================== |
| 120 | cc_test { |
| 121 | name: "camera.v4l2_test", |
| 122 | cflags: v4l2_cflags, |
| 123 | shared_libs: v4l2_shared_libs, |
| 124 | static_libs: ["libgmock"] + v4l2_static_libs, |
| 125 | |
| 126 | include_dirs: v4l2_c_includes, |
| 127 | srcs: v4l2_src_files + v4l2_test_files, |
| 128 | enabled: select(soong_config_variable("camera", "use_camera_v4l2_hal"), { |
| 129 | true: true, |
| 130 | default: false, |
| 131 | }), |
| 132 | } |