1# Copyright (c) 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") 15 16ohos_shared_library("audio_engine_utils") { 17 stack_protector_ret = true 18 sanitize = { 19 cfi = true 20 cfi_cross_dso = true 21 cfi_vcall_icall_only = true 22 debug = false 23 } 24 install_enable = true 25 26 sources = [ 27 "buffer/hpae_pcm_buffer.cpp", 28 "buffer/hpae_pcm_process.cpp", 29 "dfx/hpae_dfx_tree.cpp", 30 "simd/simd_utils.cpp", 31 "utils/hpae_format_convert.cpp", 32 "utils/hpae_no_lock_queue.cpp", 33 "utils/hpae_pcm_dumper.cpp", 34 ] 35 36 include_dirs = [ 37 "buffer", 38 "simd", 39 "utils", 40 "dfx", 41 "buffer", 42 "manager/include", 43 "../audio_service/common/include", 44 "../audio_service/server/include", 45 "../../interfaces/inner_api/native/audiocommon/include", 46 "../../frameworks/native/audioutils/include", 47 ] 48 49 cflags = [ 50 "-Wall", 51 "-Werror", 52 "-D_FORTIFY_SOURCE=2 -O2", 53 ] 54 55 deps = [ 56 "../audio_service:audio_common", 57 "../../frameworks/native/audioutils:audio_utils", 58 ] 59 60 external_deps = [ 61 "c_utils:utils", 62 "hilog:libhilog", 63 ] 64 65 subsystem_name = "multimedia" 66 part_name = "audio_framework" 67} 68 69ohos_shared_library("audio_engine_plugins") { 70 stack_protector_ret = true 71 sanitize = { 72 cfi = true 73 cfi_cross_dso = true 74 cfi_vcall_icall_only = true 75 debug = false 76 } 77 install_enable = true 78 79 sources = [ 80 "plugin/channel_converter/src/channel_converter.cpp", 81 "plugin/channel_converter/src/down_mixer.cpp", 82 "plugin/resample/proresampler/audio_proresampler.cpp", 83 "plugin/resample/proresampler/audio_proresampler_process.c", 84 ] 85 86 include_dirs = [ 87 "plugin/resample/include", 88 "../../interfaces/inner_api/native/audiocommon/include", 89 "plugin/channel_converter/include", 90 ] 91 92 cflags = [ 93 "-Wall", 94 "-Werror", 95 "-D_FORTIFY_SOURCE=2 -O2", 96 ] 97 98 external_deps = [ 99 "c_utils:utils", 100 "hilog:libhilog", 101 ] 102 103 subsystem_name = "multimedia" 104 part_name = "audio_framework" 105} 106 107config("audio_engine_node_config") { 108 include_dirs = [ 109 "node/include", 110 "manager/include", 111 "buffer", 112 "simd", 113 "utils", 114 "dfx", 115 "plugin/resample/include", 116 "plugin/channel_converter/include", 117 "plugin/bitdepth_converter", 118 "../audio_service/common/include", 119 "../audio_service/common/include/limiter", 120 "../audio_service/server/include", 121 "../audio_policy/common/include", 122 "../audio_policy/util/include", 123 "../../frameworks/native/audioeffect/include", 124 "../../interfaces/inner_api/native/audiocommon/include", 125 "../../frameworks/native/audioclock/include", 126 "../../frameworks/native/hdiadapter_new/include", 127 ] 128 129 cflags = [ 130 "-Wall", 131 "-Werror", 132 "-D_FORTIFY_SOURCE=2 -O2", 133 ] 134 cflags += [ "-Os" ] 135 cflags += [ "-DENABLE_HOOK_PCM" ] 136 cflags += [ "-DENABLE_HIDUMP_DFX" ] 137 cflags_cc = cflags 138} 139 140ohos_shared_library("audio_engine_node") { 141 stack_protector_ret = true 142 sanitize = { 143 cfi = true 144 cfi_cross_dso = true 145 cfi_vcall_icall_only = true 146 debug = false 147 } 148 install_enable = true 149 150 defines = [] 151 152 if (is_emulator) { 153 defines += [ "IS_EMULATOR" ] 154 } 155 156 configs = [ ":audio_engine_node_config" ] 157 158 sources = [ 159 "node/src/hpae_audio_format_converter_node.cpp", 160 "node/src/hpae_capture_effect_node.cpp", 161 "node/src/hpae_co_buffer_node.cpp", 162 "node/src/hpae_gain_node.cpp", 163 "node/src/hpae_inner_cap_sink_node.cpp", 164 "node/src/hpae_loudness_gain_node.cpp", 165 "node/src/hpae_mixer_node.cpp", 166 "node/src/hpae_node_common.cpp", 167 "node/src/hpae_offload_sinkoutput_node.cpp", 168 "node/src/hpae_output_cluster.cpp", 169 "node/src/hpae_plugin_node.cpp", 170 "node/src/hpae_process_cluster.cpp", 171 "node/src/hpae_render_effect_node.cpp", 172 "node/src/hpae_resample_node.cpp", 173 "node/src/hpae_sink_input_node.cpp", 174 "node/src/hpae_sink_output_node.cpp", 175 "node/src/hpae_source_input_cluster.cpp", 176 "node/src/hpae_source_input_node.cpp", 177 "node/src/hpae_source_output_node.cpp", 178 "node/src/hpae_source_process_cluster.cpp", 179 "node/src/hpae_remote_sink_output_node.cpp", 180 "node/src/hpae_remote_output_cluster.cpp", 181 ] 182 183 deps = [ 184 ":audio_engine_plugins", 185 ":audio_engine_utils", 186 "../../frameworks/native/audioclock:audio_clock", 187 "../../frameworks/native/audioeffect:audio_effect", 188 "../../frameworks/native/audioutils:audio_utils", 189 "../../frameworks/native/hdiadapter_new:hdiadapter_new", 190 "../audio_policy:audio_foundation", 191 "../audio_service:audio_common", 192 ] 193 194 external_deps = [ 195 "c_utils:utils", 196 "hilog:libhilog", 197 ] 198 199 subsystem_name = "multimedia" 200 part_name = "audio_framework" 201} 202 203ohos_shared_library("audio_engine_manager") { 204 stack_protector_ret = true 205 sanitize = { 206 cfi = true 207 cfi_cross_dso = true 208 cfi_vcall_icall_only = true 209 debug = false 210 } 211 install_enable = true 212 213 configs = [ ":audio_engine_node_config" ] 214 215 include_dirs = [ 216 "manager/include", 217 "../audio_policy/common/include", 218 "../audio_policy/server/infra/datashare/include", 219 "../../frameworks/native/audioeffect/include", 220 "../../frameworks/native/audioqosmanager/include", 221 "../../frameworks/native/audioschedule/include", 222 ] 223 224 sources = [ 225 "manager/src/hpae_capturer_manager.cpp", 226 "manager/src/hpae_inner_capturer_manager.cpp", 227 "manager/src/hpae_manager.cpp", 228 "manager/src/hpae_manager_impl.cpp", 229 "manager/src/hpae_offload_renderer_manager.cpp", 230 "manager/src/hpae_policy_manager.cpp", 231 "manager/src/hpae_renderer_manager.cpp", 232 "manager/src/hpae_signal_process_thread.cpp", 233 "manager/src/hpae_soft_link.cpp", 234 "manager/src/i_hpae_capturer_manager.cpp", 235 "manager/src/i_hpae_manager.cpp", 236 "manager/src/i_hpae_renderer_manager.cpp", 237 ] 238 239 deps = [ 240 ":audio_engine_node", 241 ":audio_engine_utils", 242 "../../frameworks/native/audioeffect:audio_effect", 243 "../../frameworks/native/audioqosmanager:audio_qosmanager", 244 "../../frameworks/native/audioschedule:audio_schedule", 245 "../../frameworks/native/audioutils:audio_utils", 246 "../../frameworks/native/hdiadapter_new:hdiadapter_new", 247 "../audio_policy:audio_foundation", 248 "../audio_policy:audio_setting_provider", 249 "../audio_service:audio_common", 250 ] 251 252 external_deps = [ 253 "c_utils:utils", 254 "data_share:datashare_common", 255 "data_share:datashare_consumer", 256 "hilog:libhilog", 257 "init:libbegetutil", 258 "os_account:os_account_innerkits", 259 "samgr:samgr_proxy", 260 ] 261 262 subsystem_name = "multimedia" 263 part_name = "audio_framework" 264} 265