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") 15 16# NOSORT 17import("../../../camera.gni") 18 19# NOSORT 20import("$hdf_core_path/adapter/uhdf2/uhdf.gni") 21import("../camera_usb.gni") 22config("camhdi_impl_config") { 23 visibility = [ ":*" ] 24 cflags = [ 25 "-DGST_DISABLE_DEPRECATED", 26 "-DHAVE_CONFIG_H", 27 ] 28 29 ldflags = [ "-Wl" ] 30 31 if (enable_camera_device_utest) { 32 cflags += [ 33 "-fprofile-arcs", 34 "-ftest-coverage", 35 ] 36 37 ldflags += [ "--coverage" ] 38 } 39} 40 41host_sources = [ 42 "$camera_path_usb/vdi_impl/src/camera_host/camera_host_usb_config.cpp", 43 "$camera_path_usb/vdi_impl/src/camera_host/camera_host_usb_vdi_impl.cpp", 44 "$camera_path_vdi/../v4l2/src/camera_device/camera_device_vdi_impl.cpp", 45 "$camera_path_vdi/../v4l2/src/offline_stream_operator/offline_stream.cpp", 46 "$camera_path_vdi/../v4l2/src/offline_stream_operator/offline_stream_operator_vdi_impl.cpp", 47 "$camera_path_vdi/../v4l2/src/stream_operator/capture_message.cpp", 48 "$camera_path_vdi/../v4l2/src/stream_operator/capture_request.cpp", 49 "$camera_path_vdi/../v4l2/src/stream_operator/stream_base.cpp", 50 "$camera_path_vdi/../v4l2/src/stream_operator/stream_operator_vdi_impl.cpp", 51 "$camera_path_vdi/../v4l2/src/stream_operator/stream_post_view.cpp", 52 "$camera_path_vdi/../v4l2/src/stream_operator/stream_preview.cpp", 53 "$camera_path_vdi/../v4l2/src/stream_operator/stream_statistics.cpp", 54 "$camera_path_vdi/../v4l2/src/stream_operator/stream_still_capture.cpp", 55 "$camera_path_vdi/../v4l2/src/stream_operator/stream_tunnel/standard/stream_tunnel.cpp", 56 "$camera_path_vdi/../v4l2/src/stream_operator/stream_video.cpp", 57 "$camera_path_vdi/dump/src/camera_dump.cpp", 58] 59 60host_includes = [ 61 "$camera_path_vdi/../../interfaces/include", 62 "$camera_path_vdi/include", 63 "$camera_path_vdi/metadata_manager/include", 64 "$camera_path_vdi/utils/watchdog", 65 "$camera_path_vdi/../interfaces", 66 "$camera_path_vdi/../v4l2/include", 67 "$camera_path_vdi/../v4l2/include/camera_host", 68 "$camera_path_vdi/../v4l2/include/camera_device", 69 "$camera_path_vdi/../v4l2/include/stream_operator", 70 "$camera_path_vdi/../v4l2/src/stream_operator/stream_tunnel/standard", 71 "$camera_path_vdi/../v4l2/include/offline_stream_operator", 72 "$camera_path_vdi/device_manager/include", 73 "$camera_path_vdi/buffer_manager/src/buffer_adapter/standard", 74 "$camera_path_vdi/utils/event", 75 "$camera_path_vdi/../../../display/interfaces/include", 76 "$camera_path_vdi/dump/include", 77 78 #producer 79 "$camera_path_vdi/pipeline_core/utils", 80 "$camera_path_vdi/pipeline_core/include", 81 "$camera_path_vdi/pipeline_core/host_stream/include", 82 "$camera_path_vdi/pipeline_core/nodes/include", 83 "$camera_path_vdi/pipeline_core/nodes/src/node_base", 84 "$camera_path_vdi/pipeline_core/nodes/src/dummy_node", 85 "$camera_path_vdi/pipeline_core/pipeline_impl/include", 86 "$camera_path_vdi/pipeline_core/pipeline_impl/src", 87 "$camera_path_vdi/pipeline_core/pipeline_impl/src/builder", 88 "$camera_path_vdi/pipeline_core/pipeline_impl/src/dispatcher", 89 "$camera_path_vdi/pipeline_core/pipeline_impl/src/parser", 90 "$camera_path_vdi/pipeline_core/pipeline_impl/src/strategy", 91 "$camera_path_vdi/pipeline_core/ipp/include", 92 93 "$camera_path_hdf_core/adapter/uhdf2/ipc/include", 94] 95 96ohos_shared_library("camera_daemon") { 97 output_extension = "so" 98 sources = host_sources 99 include_dirs = host_includes 100 include_dirs += [ "//third_party/libdrm" ] 101 102 deps = [ 103 "$camera_path_usb/buffer_manager:usb_camera_buffer_manager", 104 "$camera_path_usb/device_manager:usb_camera_device_manager", 105 "$camera_path_usb/metadata_manager:usb_camera_metadata_manager", 106 "$camera_path_usb/pipeline_core:usb_camera_pipeline_core", 107 "$camera_path_vdi/utils:peripheral_camera_utils", 108 ] 109 110 defines = [] 111 if (enable_camera_device_utest) { 112 defines += [ "CAMERA_DEVICE_UTEST" ] 113 } 114 if (use_hitrace) { 115 defines += [ "HITRACE_LOG_ENABLED" ] 116 } 117 if (drivers_peripheral_camera_feature_usb) { 118 defines += [ "CAMERA_BUILT_ON_USB" ] 119 } 120 121 external_deps = [ 122 "c_utils:utils", 123 "drivers_interface_camera:libbuffer_producer_sequenceable_1.0", 124 "drivers_interface_camera:metadata", 125 "graphic_surface:surface", 126 "hdf_core:libhdf_host", 127 "hdf_core:libhdf_ipc_adapter", 128 "hdf_core:libhdf_utils", 129 "hdf_core:libhdi", 130 "hilog:libhilog", 131 "hitrace:hitrace_meter", 132 "ipc:ipc_single", 133 ] 134 135 # if (use_hitrace) { 136 # external_deps += [ "hitrace:libhitracechain" ] 137 # } 138 139 public_configs = [ ":camhdi_impl_config" ] 140 install_images = [ chipset_base_dir ] 141 subsystem_name = "hdf" 142 part_name = "drivers_peripheral_camera" 143} 144 145ohos_static_library("camera_daemon_static") { 146 sources = host_sources 147 include_dirs = host_includes 148 include_dirs += [ "//third_party/libdrm" ] 149 150 deps = [ 151 "$camera_path_usb/buffer_manager:usb_camera_buffer_manager", 152 "$camera_path_usb/device_manager:usb_camera_device_manager", 153 "$camera_path_usb/metadata_manager:usb_camera_metadata_manager", 154 "$camera_path_usb/pipeline_core:usb_camera_pipeline_core", 155 "$camera_path_vdi/utils:peripheral_camera_utils", 156 ] 157 158 defines = [] 159 if (enable_camera_device_utest) { 160 defines += [ "CAMERA_DEVICE_UTEST" ] 161 } 162 if (use_hitrace) { 163 defines += [ "HITRACE_LOG_ENABLED" ] 164 } 165 if (drivers_peripheral_camera_feature_usb) { 166 defines += [ "CAMERA_BUILT_ON_USB" ] 167 } 168 169 external_deps = [ 170 "c_utils:utils", 171 "drivers_interface_camera:libbuffer_producer_sequenceable_1.0", 172 "drivers_interface_camera:metadata", 173 "graphic_surface:surface", 174 "hdf_core:libhdf_host", 175 "hdf_core:libhdf_ipc_adapter", 176 "hdf_core:libhdf_utils", 177 "hdf_core:libhdi", 178 "hilog:libhilog", 179 "hitrace:hitrace_meter", 180 "ipc:ipc_single", 181 ] 182 if (use_hitrace) { 183 external_deps += [ "hitrace:libhitracechain" ] 184 } 185 186 public_configs = [ ":camhdi_impl_config" ] 187 subsystem_name = "hdf" 188 part_name = "drivers_peripheral_camera" 189} 190