1# Copyright (c) 2022-2025 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("../../../../config.gni") 16 17ohos_shared_library("audio_capturer_source") { 18 sanitize = { 19 cfi = true 20 cfi_cross_dso = true 21 cfi_vcall_icall_only = true 22 debug = false 23 integer_overflow = true 24 ubsan = true 25 boundary_sanitize = true 26 } 27 install_enable = true 28 sources = [ "primary/audio_capturer_source.cpp" ] 29 cflags = [ "-fPIC" ] 30 cflags += [ "-Wall" ] 31 cflags += [ "-Os" ] 32 cflags_cc = cflags 33 34 include_dirs = [ 35 "common", 36 "../common/include", 37 "../manager/include", 38 "../../audioutils/include", 39 "../../audioeffect/include", 40 "../../audioschedule/include", 41 "../../../../interfaces/inner_api/native/audiocommon/include", 42 "../../../../services/audio_service/common/include/", 43 ] 44 45 deps = [ 46 "../../../../services/audio_service:audio_common", 47 "../../audioeffect:audio_effect", 48 "../../audioschedule:audio_schedule", 49 "../../audioutils:audio_utils", 50 "../manager:hdiadapter_utils", 51 ] 52 53 external_deps = [ 54 "c_utils:utils", 55 "drivers_interface_audio:libaudio_proxy_4.0", 56 "hdf_core:libhdf_utils", 57 "hilog:libhilog", 58 "init:libbegetutil", 59 "ipc:ipc_single", 60 "media_foundation:media_monitor_client", 61 "samgr:samgr_proxy", 62 ] 63 defines = [] 64 if (audio_framework_feature_power_manager) { 65 external_deps += [ "power_manager:powermgr_client" ] 66 defines += [ "FEATURE_POWER_MANAGER" ] 67 } 68 69 part_name = "audio_framework" 70 subsystem_name = "multimedia" 71 version_script = "libaudio_capturer_source.versionscript" 72} 73 74ohos_shared_library("fast_audio_capturer_source") { 75 sanitize = { 76 cfi = true 77 cfi_cross_dso = true 78 cfi_vcall_icall_only = true 79 debug = false 80 integer_overflow = true 81 ubsan = true 82 boundary_sanitize = true 83 } 84 install_enable = true 85 sources = [ "fast/fast_audio_capturer_source.cpp" ] 86 cflags = [ "-fPIC" ] 87 cflags += [ "-Wall" ] 88 cflags += [ "-Os" ] 89 cflags_cc = cflags 90 91 include_dirs = [ 92 "../common/include", 93 "../../../../interfaces/inner_api/native/audiocommon/include", 94 "../../audioutils/include", 95 "common", 96 ] 97 98 deps = [ "../../audioutils:audio_utils" ] 99 100 external_deps = [ 101 "c_utils:utils", 102 "drivers_interface_audio:libaudio_proxy_4.0", 103 "hdf_core:libhdf_utils", 104 "hilog:libhilog", 105 "ipc:ipc_single", 106 ] 107 defines = [] 108 if (audio_framework_feature_power_manager) { 109 external_deps += [ "power_manager:powermgr_client" ] 110 defines += [ "FEATURE_POWER_MANAGER" ] 111 } 112 113 part_name = "audio_framework" 114 subsystem_name = "multimedia" 115} 116 117ohos_shared_library("bluetooth_capturer_source") { 118 branch_protector_ret = "pac_ret" 119 sanitize = { 120 cfi = true 121 cfi_cross_dso = true 122 cfi_vcall_icall_only = true 123 debug = false 124 integer_overflow = true 125 ubsan = true 126 boundary_sanitize = true 127 } 128 install_enable = true 129 130 sources = [ "bluetooth/bluetooth_capturer_source.cpp" ] 131 132 cflags = [ "-fPIC" ] 133 cflags += [ "-Wall" ] 134 135 cflags_cc = cflags 136 137 include_dirs = [ 138 "common", 139 "../common/include", 140 "../manager/include", 141 "../../audioutils/include", 142 "../../audioeffect/include", 143 "../../../../interfaces/inner_api/native/audiocommon/include", 144 "../../../../services/audio_service/common/include/", 145 ] 146 147 deps = [ 148 "../../../../services/audio_service:audio_common", 149 "../../audioeffect:audio_effect", 150 "../../audioutils:audio_utils", 151 "../manager:hdiadapter_utils", 152 ] 153 154 external_deps = [ 155 "bounds_checking_function:libsec_shared", 156 "c_utils:utils", 157 "drivers_peripheral_bluetooth:hdi_audio_bluetooth_header", 158 "hdf_core:libhdf_ipc_adapter", 159 "hdf_core:libhdi", 160 "hdf_core:libpub_utils", 161 "hilog:libhilog", 162 "init:libbegetutil", 163 "media_foundation:media_monitor_client", 164 "samgr:samgr_proxy", 165 ] 166 defines = [] 167 if (audio_framework_feature_power_manager) { 168 external_deps += [ "power_manager:powermgr_client" ] 169 defines += [ "FEATURE_POWER_MANAGER" ] 170 } 171 172 if (use_libfuzzer || use_clang_coverage) { 173 defines += [ "TEST_COVERAGE" ] 174 } 175 176 part_name = "audio_framework" 177 subsystem_name = "multimedia" 178} 179 180ohos_shared_library("remote_audio_capturer_source") { 181 sanitize = { 182 cfi = true 183 cfi_cross_dso = true 184 cfi_vcall_icall_only = true 185 debug = false 186 integer_overflow = true 187 ubsan = true 188 boundary_sanitize = true 189 } 190 install_enable = true 191 sources = [ "remote/remote_audio_capturer_source.cpp" ] 192 cflags = [ "-fPIC" ] 193 cflags += [ "-Wall" ] 194 cflags += [ "-Os" ] 195 cflags_cc = cflags 196 197 include_dirs = [ 198 "common", 199 "../common/include", 200 "../devicemanager/interface", 201 "../../audioutils/include", 202 "../../../../interfaces/inner_api/native/audiocommon/include", 203 ] 204 205 deps = [ 206 "../../audioutils:audio_utils", 207 "../devicemanager:audio_device_manager", 208 ] 209 210 external_deps = [ 211 "c_utils:utils", 212 "drivers_interface_distributed_audio:libdaudio_proxy_1.0", 213 "hdf_core:libhdf_utils", 214 "hilog:libhilog", 215 ] 216 defines = [] 217 if (audio_framework_feature_distributed_audio) { 218 defines += [ "FEATURE_DISTRIBUTE_AUDIO" ] 219 } 220 221 part_name = "audio_framework" 222 subsystem_name = "multimedia" 223} 224 225ohos_shared_library("remote_fast_audio_capturer_source") { 226 branch_protector_ret = "pac_ret" 227 sanitize = { 228 cfi = true 229 cfi_cross_dso = true 230 cfi_vcall_icall_only = true 231 debug = false 232 integer_overflow = true 233 ubsan = true 234 boundary_sanitize = true 235 } 236 install_enable = true 237 sources = [ "remote_fast/remote_fast_audio_capturer_source.cpp" ] 238 cflags = [ "-fPIC" ] 239 cflags += [ "-Wall" ] 240 cflags += [ "-Os" ] 241 cflags_cc = cflags 242 243 include_dirs = [ 244 "common", 245 "../devicemanager/interface", 246 "../common/include", 247 "../../audioutils/include", 248 "../../../../interfaces/inner_api/native/audiocommon/include", 249 ] 250 251 deps = [ 252 "../../audioutils:audio_utils", 253 "../devicemanager:audio_device_manager", 254 ] 255 256 external_deps = [ 257 "c_utils:utils", 258 "drivers_interface_distributed_audio:libdaudio_proxy_1.0", 259 "hdf_core:libhdf_utils", 260 "hilog:libhilog", 261 ] 262 defines = [] 263 if (audio_framework_feature_distributed_audio) { 264 defines += [ "FEATURE_DISTRIBUTE_AUDIO" ] 265 } 266 267 part_name = "audio_framework" 268 subsystem_name = "multimedia" 269} 270 271ohos_shared_library("audio_capturer_file_source") { 272 sanitize = { 273 cfi = true 274 cfi_cross_dso = true 275 cfi_vcall_icall_only = true 276 debug = false 277 integer_overflow = true 278 ubsan = true 279 boundary_sanitize = true 280 } 281 install_enable = true 282 283 sources = [ "file/audio_capturer_file_source.cpp" ] 284 285 cflags = [ "-fPIC" ] 286 cflags += [ "-Wall" ] 287 288 cflags_cc = cflags 289 290 include_dirs = [ 291 "common", 292 "../common/include", 293 "../../../../interfaces/inner_api/native/audiocommon/include", 294 ] 295 external_deps = [ 296 "c_utils:utils", 297 "hilog:libhilog", 298 "pulseaudio:pulse", 299 ] 300 301 part_name = "audio_framework" 302 subsystem_name = "multimedia" 303} 304 305ohos_shared_library("capturer_source_adapter") { 306 sanitize = { 307 cfi = true 308 cfi_cross_dso = true 309 cfi_vcall_icall_only = true 310 debug = false 311 integer_overflow = true 312 ubsan = true 313 boundary_sanitize = true 314 } 315 install_enable = true 316 317 sources = [ 318 "common/capturer_source_adapter.c", 319 "common/i_audio_capturer_source.cpp", 320 ] 321 322 cflags = [ "-fPIC" ] 323 cflags += [ "-Wall" ] 324 cflags += [ "-Os" ] 325 326 include_dirs = [ 327 "common", 328 "file", 329 "primary", 330 "remote", 331 "bluetooth", 332 "../common/include", 333 "../devicemanager/interface", 334 "../../../../interfaces/inner_api/native/audiocommon/include", 335 ] 336 337 deps = [ 338 ":audio_capturer_source", 339 ":bluetooth_capturer_source", 340 ] 341 342 if (audio_framework_feature_file_io == true) { 343 deps += [ ":audio_capturer_file_source" ] 344 defines = [ "FEATURE_FILE_IO" ] 345 } 346 347 if (audio_framework_feature_distributed_audio == true) { 348 deps += [ 349 ":remote_audio_capturer_source", 350 ":remote_fast_audio_capturer_source", 351 ] 352 cflags += [ "-DDAUDIO_ENABLE" ] 353 } 354 355 cflags_cc = cflags 356 external_deps = [ 357 "c_utils:utils", 358 "hilog:libhilog", 359 "pulseaudio:pulse", 360 ] 361 362 part_name = "audio_framework" 363 subsystem_name = "multimedia" 364} 365