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("../../../config.gni")
16import("../../../sensor.gni")
17import("../../../window_manager.gni")
18
19config("audio_effect_config") {
20  include_dirs = [
21    "include",
22    "../audiostream/include",
23    "../../../interfaces/inner_api/native/audiorenderer/include",
24    "../../../interfaces/inner_api/native/audiocommon/include",
25    "../../../interfaces/inner_api/native/audiomanager/include",
26    "../../../services/audio_service/client/include",
27    "../../../services/audio_service/test/example",
28    "../../../services/audio_policy/server/include/service/manager",
29  ]
30
31  cflags = [
32    "-Wall",
33    "-Werror",
34    "-fno-access-control",
35  ]
36
37  if (sensor_enable == true) {
38    cflags += [ "-DSENSOR_ENABLE" ]
39  }
40
41  if (window_manager_enable == true) {
42    cflags += [ "-DWINDOW_MANAGER_ENABLE" ]
43  }
44}
45
46config("audio_effect_integration_config") {
47  include_dirs = [ "../../../interfaces/inner_api/native/audiocommon/include" ]
48}
49
50ohos_shared_library("audio_effect") {
51  branch_protector_ret = "pac_ret"
52  sanitize = {
53    cfi = true
54    cfi_cross_dso = true
55    cfi_vcall_icall_only = true
56    debug = false
57  }
58  install_enable = true
59
60  configs = [ ":audio_effect_config" ]
61
62  sources = [
63    "src/audio_effect_chain.cpp",
64    "src/audio_effect_chain_adapter.cpp",
65    "src/audio_effect_chain_manager.cpp",
66    "src/audio_effect_hdi_param.cpp",
67    "src/audio_effect_rotation.cpp",
68    "src/audio_effect_volume.cpp",
69    "src/audio_enhance_chain.cpp",
70    "src/audio_enhance_chain_adapter.cpp",
71    "src/audio_enhance_chain_manager.cpp",
72    "src/audio_head_tracker.cpp",
73  ]
74
75  deps = [
76    "../../../services/audio_policy:audio_setting_provider",
77    "../audioutils:audio_utils",
78  ]
79
80  external_deps = [
81    "c_utils:utils",
82    "data_share:datashare_common",
83    "data_share:datashare_consumer",
84    "drivers_interface_audio:libeffect_proxy_1.0",
85    "hdf_core:libhdf_utils",
86    "hilog:libhilog",
87    "ipc:ipc_single",
88    "media_foundation:media_monitor_client",
89    "os_account:os_account_innerkits",
90    "pulseaudio:pulse",
91    "samgr:samgr_proxy",
92  ]
93
94  if (sensor_enable == true) {
95    external_deps += [ "sensor:sensor_interface_native" ]
96  }
97
98  version_script = "../../../audio_framework.versionscript"
99
100  part_name = "audio_framework"
101  subsystem_name = "multimedia"
102}
103
104ohos_static_library("audio_effect_integration") {
105  sanitize = {
106    cfi = true
107    cfi_cross_dso = true
108    cfi_vcall_icall_only = true
109    debug = false
110  }
111
112  public_configs = [ ":audio_effect_integration_config" ]
113
114  part_name = "audio_framework"
115  subsystem_name = "multimedia"
116}
117