1# Copyright (c) 2024-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("//build/ohos_var.gni") 16import("../../../distributedaudio.gni") 17 18ohos_shared_library("distributed_audio_source") { 19 branch_protector_ret = "pac_ret" 20 sanitize = { 21 boundary_sanitize = true 22 cfi = true 23 cfi_cross_dso = true 24 debug = false 25 integer_overflow = true 26 ubsan = true 27 } 28 stack_protector_ret = true 29 30 include_dirs = [ 31 "include", 32 "${audio_client_path}/micclient/include", 33 "${audio_client_path}/spkclient/include", 34 "${audio_control_path}/controlsource/include", 35 "${audio_hdi_proxy_path}/include", 36 "${audio_processor_path}/interface", 37 "${audio_transport_path}/audioctrltransport/include", 38 "${audio_transport_path}/interface", 39 "${audio_transport_path}/receiverengine/include", 40 "${audio_transport_path}/senderengine/include", 41 "${common_path}/dfx_utils/include", 42 "${common_path}/include", 43 "${distributedaudio_path}/audiohandler/include", 44 "${innerkits_path}/native_cpp/audio_sink/include", 45 "${innerkits_path}/native_cpp/audio_source/include", 46 "${interfaces_path}/inner_kits/native_cpp/audio_sink/include", 47 "${interfaces_path}/inner_kits/native_cpp/audio_source/include", 48 "${services_path}/audiomanager/managersource/include", 49 "${services_path}/common/audiodata/include", 50 "${services_path}/common/audioeventcallback", 51 "${services_path}/common/audioparam", 52 "${services_path}/audiomanager/common/include", 53 ] 54 55 if (distributed_audio_extension_sa) { 56 include_dirs += [ 57 "${distributedaudio_ext_path}/services/audioprocessor/aeceffectprocessor/include", 58 "${distributedaudio_ext_path}/services/audioprocessor/effectcomponent/audiopipeline/include", 59 "${distributedaudio_ext_path}/services/audioprocessor/effectcomponent/elementfactory/include", 60 "${distributedaudio_ext_path}/services/audioprocessor/effectcomponent/elements/include", 61 "${distributedaudio_ext_path}/services/audioprocessor/effectcomponent/pipelinemanager/include", 62 ] 63 } 64 65 sources = [ 66 "${audio_control_path}/controlsource/src/daudio_source_dev_ctrl_manager.cpp", 67 "${audio_hdi_proxy_path}/src/daudio_hdi_handler.cpp", 68 "${audio_hdi_proxy_path}/src/daudio_manager_callback.cpp", 69 "${audio_transport_path}/audioctrltransport/src/daudio_source_ctrl_trans.cpp", 70 "${common_path}/dfx_utils/src/daudio_hidumper.cpp", 71 "${interfaces_path}/inner_kits/native_cpp/audio_sink/src/daudio_sink_proxy.cpp", 72 "${interfaces_path}/inner_kits/native_cpp/audio_source/src/daudio_source_proxy.cpp", 73 "${services_path}/audiomanager/managersource/src/daudio_source_dev.cpp", 74 "${services_path}/audiomanager/managersource/src/daudio_source_manager.cpp", 75 "${services_path}/audiomanager/managersource/src/daudio_source_mgr_callback.cpp", 76 "${services_path}/audiomanager/managersource/src/dmic_dev.cpp", 77 "${services_path}/audiomanager/managersource/src/dspeaker_dev.cpp", 78 "src/daudio_ipc_callback_proxy.cpp", 79 "src/daudio_source_service.cpp", 80 "src/daudio_source_stub.cpp", 81 ] 82 83 if (distributed_audio_extension_sa) { 84 sources += [ "${services_path}/audiomanager/managersource/src/daudio_echo_cannel_manager.cpp" ] 85 } 86 87 deps = [ 88 "${audio_transport_path}/receiverengine:distributed_audio_decode_transport", 89 "${audio_transport_path}/senderengine:distributed_audio_encode_transport", 90 "${distributedaudio_path}/audiohandler:distributed_audio_handler", 91 "${services_path}/common:distributed_audio_utils", 92 ] 93 94 external_deps = [ 95 "access_token:libaccesstoken_sdk", 96 "access_token:libtokenid_sdk", 97 "access_token:libtokensetproc_shared", 98 "audio_framework:audio_capturer", 99 "audio_framework:audio_client", 100 "audio_framework:audio_renderer", 101 "cJSON:cjson", 102 "c_utils:utils", 103 "device_manager:devicemanagersdk", 104 "distributed_hardware_fwk:distributed_av_receiver", 105 "distributed_hardware_fwk:distributed_av_sender", 106 "distributed_hardware_fwk:distributedhardwareutils", 107 "distributed_hardware_fwk:libdhfwk_sdk", 108 "drivers_interface_distributed_audio:libdaudio_proxy_1.0", 109 "drivers_interface_distributed_audio:libdaudioext_proxy_2.1", 110 "dsoftbus:softbus_client", 111 "eventhandler:libeventhandler", 112 "hdf_core:libhdf_utils", 113 "hdf_core:libhdi", 114 "hicollie:libhicollie", 115 "hilog:libhilog", 116 "hisysevent:libhisysevent", 117 "hitrace:hitrace_meter", 118 "ipc:ipc_core", 119 "ipc:ipc_single", 120 "safwk:system_ability_fwk", 121 "samgr:samgr_proxy", 122 ] 123 124 if (daudio_os_account) { 125 external_deps += [ 126 "os_account:libaccountkits", 127 "os_account:os_account_innerkits", 128 ] 129 } 130 131 cflags = [] 132 133 if (distributed_audio_extension_sa) { 134 cflags += [ "-DECHO_CANNEL_ENABLE" ] 135 } 136 if (distributed_audio_shared_buffer) { 137 cflags += [ "-DAUDIO_SUPPORT_SHARED_BUFFER" ] 138 } 139 140 cflags_cc = cflags 141 142 ldflags = [ 143 "-fpie", 144 "-Wl,-z,relro", 145 "-Wl,-z,now", 146 ] 147 148 defines = [ 149 "HI_LOG_ENABLE", 150 "LOG_DOMAIN=0xD004130", 151 ] 152 153 if (daudio_os_account) { 154 defines += [ "OS_ACCOUNT_PART" ] 155 } 156 157 if (build_variant == "root") { 158 defines += [ 159 "DUMP_DSPEAKERDEV_FILE", 160 "DUMP_DMICDEV_FILE", 161 ] 162 } 163 164 subsystem_name = "distributedhardware" 165 166 part_name = "distributed_audio" 167} 168