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