1# Copyright (c) 2023 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//build/ohos.gni") 15import("//device/board/${product_company}/${product_name}/device.gni") 16import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") 17import("//drivers/peripheral/camera/camera.gni") 18 19config("v4l2_config") { 20 visibility = [ ":*" ] 21 22 cflags = [ 23 "-DGST_DISABLE_DEPRECATED", 24 "-DHAVE_CONFIG_H", 25 "-DCOLORSPACE=\"videoconvert\"", 26 ] 27 28 if (enable_camera_device_utest) { 29 cflags += [ 30 "-fprofile-arcs", 31 "-ftest-coverage", 32 ] 33 34 ldflags = [ "--coverage" ] 35 } 36} 37 38ohos_shared_library("camera_v4l2_adapter") { 39 sources = [ 40 "$camera_path/adapter/platform/v4l2/src/driver_adapter/src/v4l2_buffer.cpp", 41 "$camera_path/adapter/platform/v4l2/src/driver_adapter/src/v4l2_control.cpp", 42 "$camera_path/adapter/platform/v4l2/src/driver_adapter/src/v4l2_dev.cpp", 43 "$camera_path/adapter/platform/v4l2/src/driver_adapter/src/v4l2_fileformat.cpp", 44 "$camera_path/adapter/platform/v4l2/src/driver_adapter/src/v4l2_stream.cpp", 45 "$camera_path/adapter/platform/v4l2/src/driver_adapter/src/v4l2_uvc.cpp", 46 ] 47 48 include_dirs = [ 49 "$camera_path/include", 50 "$camera_path/adapter/platform/v4l2/src/driver_adapter/include", 51 ] 52 53 if (is_standard_system) { 54 external_deps = [ 55 "c_utils:utils", 56 "hdf_core:libhdf_utils", 57 "hilog:libhilog", 58 ] 59 } else { 60 external_deps = [ "hilog:libhilog" ] 61 } 62 external_deps += [ "drivers_interface_camera:metadata" ] 63 public_configs = [ ":v4l2_config" ] 64 install_images = [ chipset_base_dir ] 65 subsystem_name = "rockchip_products" 66 part_name = "rockchip_products" 67} 68