1# Copyright (c) 2022-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}/interface",
38    "${audio_transport_path}/receiverengine/include",
39    "${audio_transport_path}/senderengine/include",
40    "${common_path}/dfx_utils/include",
41    "${common_path}/include",
42    "${distributedaudio_path}/audiohandler/include",
43    "${innerkits_path}/native_cpp/audio_sink/include",
44    "${innerkits_path}/native_cpp/audio_source/include",
45    "${interfaces_path}/inner_kits/native_cpp/audio_sink/include",
46    "${interfaces_path}/inner_kits/native_cpp/audio_source/include",
47    "${services_path}/audiomanager/managersource/include",
48    "${services_path}/common/audiodata/include",
49    "${services_path}/common/audioeventcallback",
50    "${services_path}/common/audioparam",
51    "${services_path}/audiomanager/common/include",
52  ]
53
54  if (distributed_audio_extension_sa) {
55    include_dirs += [
56      "${distributedaudio_ext_path}/services/audioprocessor/aeceffectprocessor/include",
57      "${distributedaudio_ext_path}/services/audioprocessor/effectcomponent/audiopipeline/include",
58      "${distributedaudio_ext_path}/services/audioprocessor/effectcomponent/elementfactory/include",
59      "${distributedaudio_ext_path}/services/audioprocessor/effectcomponent/elements/include",
60      "${distributedaudio_ext_path}/services/audioprocessor/effectcomponent/pipelinemanager/include",
61    ]
62  }
63
64  sources = [
65    "${audio_control_path}/controlsource/src/daudio_source_dev_ctrl_manager.cpp",
66    "${audio_hdi_proxy_path}/src/daudio_hdf_operate.cpp",
67    "${audio_hdi_proxy_path}/src/daudio_hdi_handler.cpp",
68    "${audio_hdi_proxy_path}/src/daudio_manager_callback.cpp",
69    "${common_path}/dfx_utils/src/daudio_hidumper.cpp",
70    "${interfaces_path}/inner_kits/native_cpp/audio_sink/src/daudio_sink_proxy.cpp",
71    "${interfaces_path}/inner_kits/native_cpp/audio_source/src/daudio_source_proxy.cpp",
72    "${services_path}/audiomanager/managersource/src/daudio_source_dev.cpp",
73    "${services_path}/audiomanager/managersource/src/daudio_source_manager.cpp",
74    "${services_path}/audiomanager/managersource/src/daudio_source_mgr_callback.cpp",
75    "${services_path}/audiomanager/managersource/src/dmic_dev.cpp",
76    "${services_path}/audiomanager/managersource/src/dspeaker_dev.cpp",
77    "src/daudio_ipc_callback_proxy.cpp",
78    "src/daudio_source_service.cpp",
79    "src/daudio_source_stub.cpp",
80  ]
81
82  if (distributed_audio_extension_sa) {
83    sources += [ "${services_path}/audiomanager/managersource/src/daudio_echo_cannel_manager.cpp" ]
84  }
85
86  deps = [
87    "${audio_transport_path}/receiverengine:distributed_audio_decode_transport",
88    "${audio_transport_path}/senderengine:distributed_audio_encode_transport",
89    "${distributedaudio_path}/audiohandler:distributed_audio_handler",
90    "${services_path}/common:distributed_audio_utils",
91  ]
92
93  external_deps = [
94    "access_token:libaccesstoken_sdk",
95    "access_token:libtokenid_sdk",
96    "audio_framework:audio_capturer",
97    "audio_framework:audio_client",
98    "audio_framework:audio_renderer",
99    "cJSON:cjson",
100    "c_utils:utils",
101    "distributed_hardware_fwk:distributed_av_receiver",
102    "distributed_hardware_fwk:distributed_av_sender",
103    "distributed_hardware_fwk:distributedhardwareutils",
104    "drivers_interface_distributed_audio:libdaudio_proxy_1.0",
105    "drivers_interface_distributed_audio:libdaudioext_proxy_2.0",
106    "dsoftbus:softbus_client",
107    "eventhandler:libeventhandler",
108    "hdf_core:libhdf_utils",
109    "hdf_core:libhdi",
110    "hicollie:libhicollie",
111    "hilog:libhilog",
112    "hisysevent:libhisysevent",
113    "hitrace:hitrace_meter",
114    "ipc:ipc_core",
115    "ipc:ipc_single",
116    "safwk:system_ability_fwk",
117    "samgr:samgr_proxy",
118  ]
119
120  cflags = []
121
122  if (distributed_audio_extension_sa) {
123    cflags += [ "-DECHO_CANNEL_ENABLE" ]
124  }
125
126  cflags_cc = cflags
127
128  defines = [
129    "HI_LOG_ENABLE",
130    "LOG_DOMAIN=0xD004130",
131  ]
132
133  if (build_variant == "root") {
134    defines += [
135      "DUMP_DSPEAKERDEV_FILE",
136      "DUMP_DMICDEV_FILE",
137    ]
138  }
139
140  subsystem_name = "distributedhardware"
141
142  part_name = "distributed_audio"
143}
144