1*e01b6f76SAndroid Build Coastguard Worker// 2*e01b6f76SAndroid Build Coastguard Worker// Copyright 2016 The Android Open Source Project 3*e01b6f76SAndroid Build Coastguard Worker// 4*e01b6f76SAndroid Build Coastguard Worker// Licensed under the Apache License, Version 2.0 (the "License"); 5*e01b6f76SAndroid Build Coastguard Worker// you may not use this file except in compliance with the License. 6*e01b6f76SAndroid Build Coastguard Worker// You may obtain a copy of the License at 7*e01b6f76SAndroid Build Coastguard Worker// 8*e01b6f76SAndroid Build Coastguard Worker// http://www.apache.org/licenses/LICENSE-2.0 9*e01b6f76SAndroid Build Coastguard Worker// 10*e01b6f76SAndroid Build Coastguard Worker// Unless required by applicable law or agreed to in writing, software 11*e01b6f76SAndroid Build Coastguard Worker// distributed under the License is distributed on an "AS IS" BASIS, 12*e01b6f76SAndroid Build Coastguard Worker// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*e01b6f76SAndroid Build Coastguard Worker// See the License for the specific language governing permissions and 14*e01b6f76SAndroid Build Coastguard Worker// limitations under the License. 15*e01b6f76SAndroid Build Coastguard Worker// 16*e01b6f76SAndroid Build Coastguard Workerpackage { 17*e01b6f76SAndroid Build Coastguard Worker // See: http://go/android-license-faq 18*e01b6f76SAndroid Build Coastguard Worker default_applicable_licenses: [ 19*e01b6f76SAndroid Build Coastguard Worker "hardware_libhardware_license", 20*e01b6f76SAndroid Build Coastguard Worker ], 21*e01b6f76SAndroid Build Coastguard Worker default_team: "trendy_team_camera_framework", 22*e01b6f76SAndroid Build Coastguard Worker} 23*e01b6f76SAndroid Build Coastguard Worker 24*e01b6f76SAndroid Build Coastguard Workerv4l2_shared_libs = [ 25*e01b6f76SAndroid Build Coastguard Worker "libbase", 26*e01b6f76SAndroid Build Coastguard Worker "libchrome", 27*e01b6f76SAndroid Build Coastguard Worker "libcamera_client", 28*e01b6f76SAndroid Build Coastguard Worker "libcamera_metadata", 29*e01b6f76SAndroid Build Coastguard Worker "libcutils", 30*e01b6f76SAndroid Build Coastguard Worker "libexif", 31*e01b6f76SAndroid Build Coastguard Worker "libhardware", 32*e01b6f76SAndroid Build Coastguard Worker "liblog", 33*e01b6f76SAndroid Build Coastguard Worker "libsync", 34*e01b6f76SAndroid Build Coastguard Worker "libutils", 35*e01b6f76SAndroid Build Coastguard Worker] 36*e01b6f76SAndroid Build Coastguard Worker 37*e01b6f76SAndroid Build Coastguard Workerv4l2_static_libs = [ 38*e01b6f76SAndroid Build Coastguard Worker "libyuv_static", 39*e01b6f76SAndroid Build Coastguard Worker "libjpeg_static_ndk", 40*e01b6f76SAndroid Build Coastguard Worker] 41*e01b6f76SAndroid Build Coastguard Worker 42*e01b6f76SAndroid Build Coastguard Workerv4l2_cflags = [ 43*e01b6f76SAndroid Build Coastguard Worker "-fno-short-enums", 44*e01b6f76SAndroid Build Coastguard Worker "-Wall", 45*e01b6f76SAndroid Build Coastguard Worker "-Wextra", 46*e01b6f76SAndroid Build Coastguard Worker "-Werror", 47*e01b6f76SAndroid Build Coastguard Worker "-fvisibility=hidden", 48*e01b6f76SAndroid Build Coastguard Worker "-DHAVE_JPEG", 49*e01b6f76SAndroid Build Coastguard Worker] 50*e01b6f76SAndroid Build Coastguard Worker 51*e01b6f76SAndroid Build Coastguard Workerv4l2_c_includes = [ 52*e01b6f76SAndroid Build Coastguard Worker "system/media/camera/include", 53*e01b6f76SAndroid Build Coastguard Worker] 54*e01b6f76SAndroid Build Coastguard Worker 55*e01b6f76SAndroid Build Coastguard Workerv4l2_src_files = [ 56*e01b6f76SAndroid Build Coastguard Worker "arc/cached_frame.cpp", 57*e01b6f76SAndroid Build Coastguard Worker "arc/exif_utils.cpp", 58*e01b6f76SAndroid Build Coastguard Worker "arc/frame_buffer.cpp", 59*e01b6f76SAndroid Build Coastguard Worker "arc/image_processor.cpp", 60*e01b6f76SAndroid Build Coastguard Worker "arc/jpeg_compressor.cpp", 61*e01b6f76SAndroid Build Coastguard Worker "camera.cpp", 62*e01b6f76SAndroid Build Coastguard Worker "capture_request.cpp", 63*e01b6f76SAndroid Build Coastguard Worker "format_metadata_factory.cpp", 64*e01b6f76SAndroid Build Coastguard Worker "metadata/boottime_state_delegate.cpp", 65*e01b6f76SAndroid Build Coastguard Worker "metadata/enum_converter.cpp", 66*e01b6f76SAndroid Build Coastguard Worker "metadata/metadata.cpp", 67*e01b6f76SAndroid Build Coastguard Worker "metadata/metadata_reader.cpp", 68*e01b6f76SAndroid Build Coastguard Worker "request_tracker.cpp", 69*e01b6f76SAndroid Build Coastguard Worker "static_properties.cpp", 70*e01b6f76SAndroid Build Coastguard Worker "stream_format.cpp", 71*e01b6f76SAndroid Build Coastguard Worker "v4l2_camera.cpp", 72*e01b6f76SAndroid Build Coastguard Worker "v4l2_camera_hal.cpp", 73*e01b6f76SAndroid Build Coastguard Worker "v4l2_metadata_factory.cpp", 74*e01b6f76SAndroid Build Coastguard Worker "v4l2_wrapper.cpp", 75*e01b6f76SAndroid Build Coastguard Worker] 76*e01b6f76SAndroid Build Coastguard Worker 77*e01b6f76SAndroid Build Coastguard Workerv4l2_test_files = [ 78*e01b6f76SAndroid Build Coastguard Worker "format_metadata_factory_test.cpp", 79*e01b6f76SAndroid Build Coastguard Worker "metadata/control_test.cpp", 80*e01b6f76SAndroid Build Coastguard Worker "metadata/default_option_delegate_test.cpp", 81*e01b6f76SAndroid Build Coastguard Worker "metadata/enum_converter_test.cpp", 82*e01b6f76SAndroid Build Coastguard Worker "metadata/ignored_control_delegate_test.cpp", 83*e01b6f76SAndroid Build Coastguard Worker "metadata/map_converter_test.cpp", 84*e01b6f76SAndroid Build Coastguard Worker "metadata/menu_control_options_test.cpp", 85*e01b6f76SAndroid Build Coastguard Worker "metadata/metadata_reader_test.cpp", 86*e01b6f76SAndroid Build Coastguard Worker "metadata/metadata_test.cpp", 87*e01b6f76SAndroid Build Coastguard Worker "metadata/no_effect_control_delegate_test.cpp", 88*e01b6f76SAndroid Build Coastguard Worker "metadata/partial_metadata_factory_test.cpp", 89*e01b6f76SAndroid Build Coastguard Worker "metadata/property_test.cpp", 90*e01b6f76SAndroid Build Coastguard Worker "metadata/ranged_converter_test.cpp", 91*e01b6f76SAndroid Build Coastguard Worker "metadata/slider_control_options_test.cpp", 92*e01b6f76SAndroid Build Coastguard Worker "metadata/state_test.cpp", 93*e01b6f76SAndroid Build Coastguard Worker "metadata/tagged_control_delegate_test.cpp", 94*e01b6f76SAndroid Build Coastguard Worker "metadata/tagged_control_options_test.cpp", 95*e01b6f76SAndroid Build Coastguard Worker "metadata/v4l2_control_delegate_test.cpp", 96*e01b6f76SAndroid Build Coastguard Worker "request_tracker_test.cpp", 97*e01b6f76SAndroid Build Coastguard Worker "static_properties_test.cpp", 98*e01b6f76SAndroid Build Coastguard Worker] 99*e01b6f76SAndroid Build Coastguard Worker 100*e01b6f76SAndroid Build Coastguard Worker// V4L2 Camera HAL. 101*e01b6f76SAndroid Build Coastguard Worker// ============================================================================== 102*e01b6f76SAndroid Build Coastguard Workercc_library_shared { 103*e01b6f76SAndroid Build Coastguard Worker name: "camera.v4l2", 104*e01b6f76SAndroid Build Coastguard Worker relative_install_path: "hw", 105*e01b6f76SAndroid Build Coastguard Worker cflags: v4l2_cflags, 106*e01b6f76SAndroid Build Coastguard Worker shared_libs: v4l2_shared_libs, 107*e01b6f76SAndroid Build Coastguard Worker header_libs: ["libgtest_prod_headers"], 108*e01b6f76SAndroid Build Coastguard Worker static_libs: v4l2_static_libs, 109*e01b6f76SAndroid Build Coastguard Worker 110*e01b6f76SAndroid Build Coastguard Worker include_dirs: v4l2_c_includes, 111*e01b6f76SAndroid Build Coastguard Worker srcs: v4l2_src_files, 112*e01b6f76SAndroid Build Coastguard Worker enabled: select(soong_config_variable("camera", "use_camera_v4l2_hal"), { 113*e01b6f76SAndroid Build Coastguard Worker true: true, 114*e01b6f76SAndroid Build Coastguard Worker default: false, 115*e01b6f76SAndroid Build Coastguard Worker }), 116*e01b6f76SAndroid Build Coastguard Worker} 117*e01b6f76SAndroid Build Coastguard Worker 118*e01b6f76SAndroid Build Coastguard Worker// Unit tests for V4L2 Camera HAL. 119*e01b6f76SAndroid Build Coastguard Worker// ============================================================================== 120*e01b6f76SAndroid Build Coastguard Workercc_test { 121*e01b6f76SAndroid Build Coastguard Worker name: "camera.v4l2_test", 122*e01b6f76SAndroid Build Coastguard Worker cflags: v4l2_cflags, 123*e01b6f76SAndroid Build Coastguard Worker shared_libs: v4l2_shared_libs, 124*e01b6f76SAndroid Build Coastguard Worker static_libs: ["libgmock"] + v4l2_static_libs, 125*e01b6f76SAndroid Build Coastguard Worker 126*e01b6f76SAndroid Build Coastguard Worker include_dirs: v4l2_c_includes, 127*e01b6f76SAndroid Build Coastguard Worker srcs: v4l2_src_files + v4l2_test_files, 128*e01b6f76SAndroid Build Coastguard Worker enabled: select(soong_config_variable("camera", "use_camera_v4l2_hal"), { 129*e01b6f76SAndroid Build Coastguard Worker true: true, 130*e01b6f76SAndroid Build Coastguard Worker default: false, 131*e01b6f76SAndroid Build Coastguard Worker }), 132*e01b6f76SAndroid Build Coastguard Worker} 133