150a07fd2Sopenharmony_ci# Copyright (c) 2022-2024 Huawei Device Co., Ltd.
250a07fd2Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
350a07fd2Sopenharmony_ci# you may not use this file except in compliance with the License.
450a07fd2Sopenharmony_ci# You may obtain a copy of the License at
550a07fd2Sopenharmony_ci#
650a07fd2Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
750a07fd2Sopenharmony_ci#
850a07fd2Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
950a07fd2Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
1050a07fd2Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1150a07fd2Sopenharmony_ci# See the License for the specific language governing permissions and
1250a07fd2Sopenharmony_ci# limitations under the License.
1350a07fd2Sopenharmony_ci
1450a07fd2Sopenharmony_ciimport("//build/ohos.gni")
1550a07fd2Sopenharmony_ciimport("//build/ohos_var.gni")
1650a07fd2Sopenharmony_ciimport("../../../distributedaudio.gni")
1750a07fd2Sopenharmony_ci
1850a07fd2Sopenharmony_ciohos_shared_library("distributed_audio_source") {
1950a07fd2Sopenharmony_ci  branch_protector_ret = "pac_ret"
2050a07fd2Sopenharmony_ci  sanitize = {
2150a07fd2Sopenharmony_ci    boundary_sanitize = true
2250a07fd2Sopenharmony_ci    cfi = true
2350a07fd2Sopenharmony_ci    cfi_cross_dso = true
2450a07fd2Sopenharmony_ci    debug = false
2550a07fd2Sopenharmony_ci    integer_overflow = true
2650a07fd2Sopenharmony_ci    ubsan = true
2750a07fd2Sopenharmony_ci  }
2850a07fd2Sopenharmony_ci  stack_protector_ret = true
2950a07fd2Sopenharmony_ci
3050a07fd2Sopenharmony_ci  include_dirs = [
3150a07fd2Sopenharmony_ci    "include",
3250a07fd2Sopenharmony_ci    "${audio_client_path}/micclient/include",
3350a07fd2Sopenharmony_ci    "${audio_client_path}/spkclient/include",
3450a07fd2Sopenharmony_ci    "${audio_control_path}/controlsource/include",
3550a07fd2Sopenharmony_ci    "${audio_hdi_proxy_path}/include",
3650a07fd2Sopenharmony_ci    "${audio_processor_path}/interface",
3750a07fd2Sopenharmony_ci    "${audio_transport_path}/interface",
3850a07fd2Sopenharmony_ci    "${audio_transport_path}/receiverengine/include",
3950a07fd2Sopenharmony_ci    "${audio_transport_path}/senderengine/include",
4050a07fd2Sopenharmony_ci    "${common_path}/dfx_utils/include",
4150a07fd2Sopenharmony_ci    "${common_path}/include",
4250a07fd2Sopenharmony_ci    "${distributedaudio_path}/audiohandler/include",
4350a07fd2Sopenharmony_ci    "${innerkits_path}/native_cpp/audio_sink/include",
4450a07fd2Sopenharmony_ci    "${innerkits_path}/native_cpp/audio_source/include",
4550a07fd2Sopenharmony_ci    "${interfaces_path}/inner_kits/native_cpp/audio_sink/include",
4650a07fd2Sopenharmony_ci    "${interfaces_path}/inner_kits/native_cpp/audio_source/include",
4750a07fd2Sopenharmony_ci    "${services_path}/audiomanager/managersource/include",
4850a07fd2Sopenharmony_ci    "${services_path}/common/audiodata/include",
4950a07fd2Sopenharmony_ci    "${services_path}/common/audioeventcallback",
5050a07fd2Sopenharmony_ci    "${services_path}/common/audioparam",
5150a07fd2Sopenharmony_ci    "${services_path}/audiomanager/common/include",
5250a07fd2Sopenharmony_ci  ]
5350a07fd2Sopenharmony_ci
5450a07fd2Sopenharmony_ci  if (distributed_audio_extension_sa) {
5550a07fd2Sopenharmony_ci    include_dirs += [
5650a07fd2Sopenharmony_ci      "${distributedaudio_ext_path}/services/audioprocessor/aeceffectprocessor/include",
5750a07fd2Sopenharmony_ci      "${distributedaudio_ext_path}/services/audioprocessor/effectcomponent/audiopipeline/include",
5850a07fd2Sopenharmony_ci      "${distributedaudio_ext_path}/services/audioprocessor/effectcomponent/elementfactory/include",
5950a07fd2Sopenharmony_ci      "${distributedaudio_ext_path}/services/audioprocessor/effectcomponent/elements/include",
6050a07fd2Sopenharmony_ci      "${distributedaudio_ext_path}/services/audioprocessor/effectcomponent/pipelinemanager/include",
6150a07fd2Sopenharmony_ci    ]
6250a07fd2Sopenharmony_ci  }
6350a07fd2Sopenharmony_ci
6450a07fd2Sopenharmony_ci  sources = [
6550a07fd2Sopenharmony_ci    "${audio_control_path}/controlsource/src/daudio_source_dev_ctrl_manager.cpp",
6650a07fd2Sopenharmony_ci    "${audio_hdi_proxy_path}/src/daudio_hdf_operate.cpp",
6750a07fd2Sopenharmony_ci    "${audio_hdi_proxy_path}/src/daudio_hdi_handler.cpp",
6850a07fd2Sopenharmony_ci    "${audio_hdi_proxy_path}/src/daudio_manager_callback.cpp",
6950a07fd2Sopenharmony_ci    "${common_path}/dfx_utils/src/daudio_hidumper.cpp",
7050a07fd2Sopenharmony_ci    "${interfaces_path}/inner_kits/native_cpp/audio_sink/src/daudio_sink_proxy.cpp",
7150a07fd2Sopenharmony_ci    "${interfaces_path}/inner_kits/native_cpp/audio_source/src/daudio_source_proxy.cpp",
7250a07fd2Sopenharmony_ci    "${services_path}/audiomanager/managersource/src/daudio_source_dev.cpp",
7350a07fd2Sopenharmony_ci    "${services_path}/audiomanager/managersource/src/daudio_source_manager.cpp",
7450a07fd2Sopenharmony_ci    "${services_path}/audiomanager/managersource/src/daudio_source_mgr_callback.cpp",
7550a07fd2Sopenharmony_ci    "${services_path}/audiomanager/managersource/src/dmic_dev.cpp",
7650a07fd2Sopenharmony_ci    "${services_path}/audiomanager/managersource/src/dspeaker_dev.cpp",
7750a07fd2Sopenharmony_ci    "src/daudio_ipc_callback_proxy.cpp",
7850a07fd2Sopenharmony_ci    "src/daudio_source_service.cpp",
7950a07fd2Sopenharmony_ci    "src/daudio_source_stub.cpp",
8050a07fd2Sopenharmony_ci  ]
8150a07fd2Sopenharmony_ci
8250a07fd2Sopenharmony_ci  if (distributed_audio_extension_sa) {
8350a07fd2Sopenharmony_ci    sources += [ "${services_path}/audiomanager/managersource/src/daudio_echo_cannel_manager.cpp" ]
8450a07fd2Sopenharmony_ci  }
8550a07fd2Sopenharmony_ci
8650a07fd2Sopenharmony_ci  deps = [
8750a07fd2Sopenharmony_ci    "${audio_transport_path}/receiverengine:distributed_audio_decode_transport",
8850a07fd2Sopenharmony_ci    "${audio_transport_path}/senderengine:distributed_audio_encode_transport",
8950a07fd2Sopenharmony_ci    "${distributedaudio_path}/audiohandler:distributed_audio_handler",
9050a07fd2Sopenharmony_ci    "${services_path}/common:distributed_audio_utils",
9150a07fd2Sopenharmony_ci  ]
9250a07fd2Sopenharmony_ci
9350a07fd2Sopenharmony_ci  external_deps = [
9450a07fd2Sopenharmony_ci    "access_token:libaccesstoken_sdk",
9550a07fd2Sopenharmony_ci    "access_token:libtokenid_sdk",
9650a07fd2Sopenharmony_ci    "audio_framework:audio_capturer",
9750a07fd2Sopenharmony_ci    "audio_framework:audio_client",
9850a07fd2Sopenharmony_ci    "audio_framework:audio_renderer",
9950a07fd2Sopenharmony_ci    "cJSON:cjson",
10050a07fd2Sopenharmony_ci    "c_utils:utils",
10150a07fd2Sopenharmony_ci    "distributed_hardware_fwk:distributed_av_receiver",
10250a07fd2Sopenharmony_ci    "distributed_hardware_fwk:distributed_av_sender",
10350a07fd2Sopenharmony_ci    "distributed_hardware_fwk:distributedhardwareutils",
10450a07fd2Sopenharmony_ci    "drivers_interface_distributed_audio:libdaudio_proxy_1.0",
10550a07fd2Sopenharmony_ci    "drivers_interface_distributed_audio:libdaudioext_proxy_2.0",
10650a07fd2Sopenharmony_ci    "dsoftbus:softbus_client",
10750a07fd2Sopenharmony_ci    "eventhandler:libeventhandler",
10850a07fd2Sopenharmony_ci    "hdf_core:libhdf_utils",
10950a07fd2Sopenharmony_ci    "hdf_core:libhdi",
11050a07fd2Sopenharmony_ci    "hicollie:libhicollie",
11150a07fd2Sopenharmony_ci    "hilog:libhilog",
11250a07fd2Sopenharmony_ci    "hisysevent:libhisysevent",
11350a07fd2Sopenharmony_ci    "hitrace:hitrace_meter",
11450a07fd2Sopenharmony_ci    "ipc:ipc_core",
11550a07fd2Sopenharmony_ci    "ipc:ipc_single",
11650a07fd2Sopenharmony_ci    "safwk:system_ability_fwk",
11750a07fd2Sopenharmony_ci    "samgr:samgr_proxy",
11850a07fd2Sopenharmony_ci  ]
11950a07fd2Sopenharmony_ci
12050a07fd2Sopenharmony_ci  cflags = []
12150a07fd2Sopenharmony_ci
12250a07fd2Sopenharmony_ci  if (distributed_audio_extension_sa) {
12350a07fd2Sopenharmony_ci    cflags += [ "-DECHO_CANNEL_ENABLE" ]
12450a07fd2Sopenharmony_ci  }
12550a07fd2Sopenharmony_ci
12650a07fd2Sopenharmony_ci  cflags_cc = cflags
12750a07fd2Sopenharmony_ci
12850a07fd2Sopenharmony_ci  defines = [
12950a07fd2Sopenharmony_ci    "HI_LOG_ENABLE",
13050a07fd2Sopenharmony_ci    "LOG_DOMAIN=0xD004130",
13150a07fd2Sopenharmony_ci  ]
13250a07fd2Sopenharmony_ci
13350a07fd2Sopenharmony_ci  if (build_variant == "root") {
13450a07fd2Sopenharmony_ci    defines += [
13550a07fd2Sopenharmony_ci      "DUMP_DSPEAKERDEV_FILE",
13650a07fd2Sopenharmony_ci      "DUMP_DMICDEV_FILE",
13750a07fd2Sopenharmony_ci    ]
13850a07fd2Sopenharmony_ci  }
13950a07fd2Sopenharmony_ci
14050a07fd2Sopenharmony_ci  subsystem_name = "distributedhardware"
14150a07fd2Sopenharmony_ci
14250a07fd2Sopenharmony_ci  part_name = "distributed_audio"
14350a07fd2Sopenharmony_ci}
144