1# Copyright (c) 2021-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("../../../audio_framework_test_sources.gni") 16import("../../../config.gni") 17import("../../../sensor.gni") 18import("../../../window_manager.gni") 19 20config("audio_effect_config") { 21 include_dirs = [ 22 "include", 23 "../audiostream/include", 24 "../../../interfaces/inner_api/native/audiorenderer/include", 25 "../../../interfaces/inner_api/native/audiocommon/include", 26 "../../../interfaces/inner_api/native/audiomanager/include", 27 "../../../services/audio_service/client/include", 28 "../../../services/audio_service/common/include", 29 "../../../services/audio_service/test/example", 30 "../../../services/audio_policy/server/infra/datashare/include", 31 "../../../services/audio_policy/util/include", 32 "../audioschedule/include", 33 ] 34 35 cflags = [ 36 "-Wall", 37 "-Werror", 38 "-fno-access-control", 39 ] 40 41 if (sensor_enable == true) { 42 cflags += [ "-DSENSOR_ENABLE" ] 43 } 44 45 if (window_manager_enable == true) { 46 cflags += [ "-DWINDOW_MANAGER_ENABLE" ] 47 } 48} 49 50config("audio_effect_integration_config") { 51 include_dirs = [ "../../../interfaces/inner_api/native/audiocommon/include" ] 52} 53 54audio_ohos_library("audio_effect") { 55 branch_protector_ret = "pac_ret" 56 sanitize = { 57 cfi = true 58 cfi_cross_dso = true 59 cfi_vcall_icall_only = true 60 debug = false 61 integer_overflow = true 62 ubsan = true 63 boundary_sanitize = true 64 } 65 install_enable = true 66 67 configs = [ ":audio_effect_config" ] 68 69 sources = [ 70 "src/audio_effect_chain.cpp", 71 "src/audio_effect_chain_manager.cpp", 72 "src/audio_effect_hdi_param.cpp", 73 "src/audio_effect_rotation.cpp", 74 "src/audio_effect_volume.cpp", 75 "src/audio_enhance_chain.cpp", 76 "src/audio_enhance_chain_manager_impl.cpp", 77 "src/audio_head_tracker.cpp", 78 "src/chain_pool_impl.cpp", 79 "src/thread_handler_impl.cpp", 80 ] 81 82 deps = [ 83 "../../../services/audio_policy:audio_foundation", 84 "../../../services/audio_policy:audio_setting_provider", 85 "../../../services/audio_service:audio_common", 86 "../audioschedule:audio_schedule", 87 "../audioutils:audio_utils", 88 ] 89 90 external_deps = [ 91 "c_utils:utils", 92 "data_share:datashare_common", 93 "data_share:datashare_consumer", 94 "drivers_interface_audio:libeffect_proxy_1.0", 95 "hdf_core:libhdf_utils", 96 "hilog:libhilog", 97 "ipc:ipc_single", 98 "media_foundation:media_monitor_client", 99 "os_account:os_account_innerkits", 100 "samgr:samgr_proxy", 101 ] 102 defines = [] 103 if (!audio_framework_feature_new_engine_flag) { 104 sources += [ 105 "src/audio_effect_chain_adapter.cpp", 106 "src/audio_enhance_chain_adapter.cpp", 107 ] 108 external_deps += [ 109 "pulseaudio:pulse", 110 ] 111 defines += [ "SUPPORT_OLD_ENGINE" ] 112 } 113 if (sensor_enable == true) { 114 external_deps += [ "sensor:sensor_interface_native" ] 115 } 116 117 cflags = [ "-Os" ] 118 cflags_cc = cflags 119 120 part_name = "audio_framework" 121 subsystem_name = "multimedia" 122 version_script = "libaudio_effect.versionscript" 123} 124 125ohos_static_library("audio_effect_integration") { 126 sanitize = { 127 cfi = true 128 cfi_cross_dso = true 129 cfi_vcall_icall_only = true 130 debug = false 131 integer_overflow = true 132 ubsan = true 133 boundary_sanitize = true 134 } 135 136 public_configs = [ ":audio_effect_integration_config" ] 137 138 part_name = "audio_framework" 139 subsystem_name = "multimedia" 140} 141