1# Copyright (c) 2024 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_hdf_operate.cpp", 68 "${audio_hdi_proxy_path}/src/daudio_hdi_handler.cpp", 69 "${audio_hdi_proxy_path}/src/daudio_manager_callback.cpp", 70 "${audio_transport_path}/audioctrltransport/src/daudio_source_ctrl_trans.cpp", 71 "${common_path}/dfx_utils/src/daudio_hidumper.cpp", 72 "${interfaces_path}/inner_kits/native_cpp/audio_sink/src/daudio_sink_proxy.cpp", 73 "${interfaces_path}/inner_kits/native_cpp/audio_source/src/daudio_source_proxy.cpp", 74 "${services_path}/audiomanager/managersource/src/daudio_source_dev.cpp", 75 "${services_path}/audiomanager/managersource/src/daudio_source_manager.cpp", 76 "${services_path}/audiomanager/managersource/src/daudio_source_mgr_callback.cpp", 77 "${services_path}/audiomanager/managersource/src/dmic_dev.cpp", 78 "${services_path}/audiomanager/managersource/src/dspeaker_dev.cpp", 79 "src/daudio_ipc_callback_proxy.cpp", 80 "src/daudio_source_service.cpp", 81 "src/daudio_source_stub.cpp", 82 ] 83 84 if (distributed_audio_extension_sa) { 85 sources += [ "${services_path}/audiomanager/managersource/src/daudio_echo_cannel_manager.cpp" ] 86 } 87 88 deps = [ 89 "${audio_transport_path}/receiverengine:distributed_audio_decode_transport", 90 "${audio_transport_path}/senderengine:distributed_audio_encode_transport", 91 "${distributedaudio_path}/audiohandler:distributed_audio_handler", 92 "${services_path}/common:distributed_audio_utils", 93 ] 94 95 external_deps = [ 96 "access_token:libaccesstoken_sdk", 97 "access_token:libtokenid_sdk", 98 "audio_framework:audio_capturer", 99 "audio_framework:audio_client", 100 "audio_framework:audio_renderer", 101 "cJSON:cjson", 102 "c_utils:utils", 103 "distributed_hardware_fwk:distributed_av_receiver", 104 "distributed_hardware_fwk:distributed_av_sender", 105 "distributed_hardware_fwk:distributedhardwareutils", 106 "drivers_interface_distributed_audio:libdaudio_proxy_1.0", 107 "drivers_interface_distributed_audio:libdaudioext_proxy_2.0", 108 "dsoftbus:softbus_client", 109 "eventhandler:libeventhandler", 110 "hdf_core:libhdf_utils", 111 "hdf_core:libhdi", 112 "hicollie:libhicollie", 113 "hilog:libhilog", 114 "hisysevent:libhisysevent", 115 "hitrace:hitrace_meter", 116 "ipc:ipc_core", 117 "ipc:ipc_single", 118 "safwk:system_ability_fwk", 119 "samgr:samgr_proxy", 120 ] 121 122 cflags = [] 123 124 if (distributed_audio_extension_sa) { 125 cflags += [ "-DECHO_CANNEL_ENABLE" ] 126 } 127 if (distributed_audio_shared_buffer) { 128 cflags += [ "-DAUDIO_SUPPORT_SHARED_BUFFER" ] 129 } 130 131 cflags_cc = cflags 132 133 ldflags = [ 134 "-fpie", 135 "-Wl,-z,relro", 136 "-Wl,-z,now", 137 ] 138 139 defines = [ 140 "HI_LOG_ENABLE", 141 "LOG_DOMAIN=0xD004130", 142 ] 143 144 if (build_variant == "root") { 145 defines += [ 146 "DUMP_DSPEAKERDEV_FILE", 147 "DUMP_DMICDEV_FILE", 148 ] 149 } 150 151 subsystem_name = "distributedhardware" 152 153 part_name = "distributed_audio" 154} 155