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("../../camera.gni") 15 16if (defined(ohos_lite)) { 17 import("//build/ohos.gni") 18 import("../../../../hdf_core/adapter/uhdf/uhdf.gni") 19 20 config("camhdi_impl_config") { 21 visibility = [ ":*" ] 22 cflags = [ 23 "-DGST_DISABLE_DEPRECATED", 24 "-DHAVE_CONFIG_H", 25 ] 26 27 cflags_cc = [ "-std=c++17" ] 28 ldflags = [ "-Wl" ] 29 30 ldflags += [ "--coverage" ] 31 } 32 33 ohos_shared_library("camera_host_service_1.0") { 34 output_extension = "z.so" 35 sources = [ 36 "./src/camera_device_service.cpp", 37 "./src/camera_host_service.cpp", 38 "./src/offline_stream_operator_service.cpp", 39 "./src/stream_operator_service.cpp", 40 ] 41 42 include_dirs = [ 43 "$camera_path/../../interfaces/include", 44 "$camera_path/../../interfaces/hdi_passthrough", 45 "$camera_path/include", 46 "$camera_path/utils/hicollie", 47 "$camera_path/utils/watchdog", 48 "$camera_path/../interfaces", 49 "./include", 50 ] 51 52 deps = [ "$camera_path/utils:peripheral_camera_utils" ] 53 external_deps = [ 54 "drivers_interface_camera:metadata", 55 "graphic_surface:surface", 56 "hdf_core:libhdf_utils", 57 "hilog_lite:hilog_shared", 58 ] 59 public_configs = [ ":camhdi_impl_config" ] 60 subsystem_name = "hdf" 61 part_name = "drivers_peripheral_camera" 62 } 63} else { 64 import("//build/ohos.gni") 65 66 config("camhdi_impl_config") { 67 visibility = [ ":*" ] 68 cflags = [ 69 "-DGST_DISABLE_DEPRECATED", 70 "-DHAVE_CONFIG_H", 71 ] 72 73 ldflags = [ "-Wl" ] 74 75 if (enable_camera_device_utest) { 76 cflags += [ 77 "-fprofile-arcs", 78 "-ftest-coverage", 79 ] 80 81 ldflags += [ "--coverage" ] 82 } 83 } 84 85 host_sources = [ 86 "$camera_path/../../interfaces/hdi_ipc/camera_host_driver.cpp", 87 "./src/camera_device_service.cpp", 88 "./src/camera_device_service_callback.cpp", 89 "./src/camera_host_service.cpp", 90 "./src/camera_host_service_callback.cpp", 91 "./src/camera_service_type_converter.cpp", 92 "./src/offline_stream_operator_service.cpp", 93 "./src/stream_operator_service.cpp", 94 "./src/stream_operator_service_callback.cpp", 95 ] 96 97 host_includes = [ 98 "$camera_path/../../interfaces/include", 99 "$camera_path/../../interfaces/hdi_ipc", 100 "$camera_path/../../interfaces/hdi_ipc/utils/include", 101 "$camera_path/../../interfaces/hdi_ipc/callback/host/include", 102 "$camera_path/../../interfaces/hdi_ipc/callback/device/include", 103 "$camera_path/../../interfaces/hdi_ipc/callback/operator/include", 104 "$camera_path/include", 105 "$camera_path/utils/hicollie", 106 "$camera_path/utils/watchdog", 107 "$camera_path/../interfaces", 108 "./include", 109 ] 110 111 ohos_shared_library("camera_host_service_1.0") { 112 sources = host_sources 113 include_dirs = host_includes 114 115 deps = [ "$camera_path/utils:peripheral_camera_utils" ] 116 117 defines = [] 118 if (enable_camera_device_utest) { 119 defines += [ "CAMERA_DEVICE_UTEST" ] 120 } 121 if (use_hitrace) { 122 defines += [ "HITRACE_LOG_ENABLED" ] 123 } 124 if (drivers_peripheral_camera_feature_usb && 125 !drivers_peripheral_camera_use_commom_usb_camera_host_config) { 126 defines += [ "CHIP_PROD_CAMERA_HOST_CONFIG" ] 127 } 128 129 if (is_standard_system) { 130 external_deps = [ 131 "c_utils:utils", 132 "graphic_surface:surface", 133 "hdf_core:libhdf_host", 134 "hdf_core:libhdf_ipc_adapter", 135 "hdf_core:libhdf_utils", 136 "hdf_core:libhdi", 137 "hicollie:libhicollie", 138 "hilog:libhilog", 139 "hisysevent:libhisysevent", 140 ] 141 } else { 142 external_deps = [ "hilog:libhilog" ] 143 } 144 145 if (use_hitrace) { 146 external_deps += [ "hitrace:hitrace_meter" ] 147 } 148 149 external_deps += [ 150 "drivers_interface_camera:libcamera_stub_1.0", 151 "drivers_interface_camera:metadata", 152 "ipc:ipc_single", 153 ] 154 shlib_type = "hdi" 155 public_configs = [ ":camhdi_impl_config" ] 156 install_images = [ chipset_base_dir ] 157 subsystem_name = "hdf" 158 part_name = "drivers_peripheral_camera" 159 } 160 161 ohos_static_library("camera_host_service_1.0_static") { 162 sources = host_sources 163 include_dirs = host_includes 164 165 deps = [ "$camera_path/utils:peripheral_camera_utils" ] 166 167 defines = [] 168 if (enable_camera_device_utest) { 169 defines += [ "CAMERA_DEVICE_UTEST" ] 170 } 171 if (use_hitrace) { 172 defines += [ "HITRACE_LOG_ENABLED" ] 173 } 174 175 if (is_standard_system) { 176 external_deps = [ 177 "c_utils:utils", 178 "graphic_surface:surface", 179 "hdf_core:libhdf_host", 180 "hdf_core:libhdf_ipc_adapter", 181 "hdf_core:libhdf_utils", 182 "hdf_core:libhdi", 183 "hicollie:libhicollie", 184 "hilog:libhilog", 185 "hisysevent:libhisysevent", 186 ] 187 } else { 188 external_deps = [ "hilog:libhilog" ] 189 } 190 191 if (use_hitrace) { 192 external_deps += [ "hitrace:hitrace_meter" ] 193 } 194 195 external_deps += [ 196 "drivers_interface_camera:libcamera_stub_1.0", 197 "drivers_interface_camera:metadata", 198 "ipc:ipc_single", 199 ] 200 201 public_configs = [ ":camhdi_impl_config" ] 202 subsystem_name = "hdf" 203 part_name = "drivers_peripheral_camera" 204 } 205} 206