• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-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")
15import("../../../config.gni")
16
17config("audio_toneplayer_config") {
18  include_dirs = [
19    "include",
20    "../audiostream/include",
21    "../audioutils/include",
22    "../audiorenderer/include",
23    "../../../interfaces/inner_api/native/audiocommon/include",
24    "../../../interfaces/inner_api/native/audiomanager/include",
25    "../../../interfaces/inner_api/native/audiorenderer/include",
26    "../../../interfaces/inner_api/native/toneplayer/include",
27    "../../../services/audio_policy/include",
28    "../../../services/audio_service/client",
29    "../../../services/test",
30  ]
31
32  cflags = [
33    "-Wall",
34    "-Werror",
35  ]
36}
37
38if (!audio_framework_feature_dtmf_tone) {
39  group("audio_toneplayer") {
40    deps = []
41  }
42} else {
43  ohos_shared_library("audio_toneplayer") {
44    branch_protector_ret = "pac_ret"
45    sanitize = {
46      cfi = true
47      cfi_cross_dso = true
48      cfi_vcall_icall_only = true
49      debug = false
50      integer_overflow = true
51      ubsan = true
52      boundary_sanitize = true
53    }
54    install_enable = true
55
56    configs = [ ":audio_toneplayer_config" ]
57
58    sources = [ "src/toneplayer_impl.cpp" ]
59
60    defines = [ "FEATURE_DTMF_TONE" ]
61
62    deps = [
63      "../../../services/audio_policy:audio_policy_client",
64      "../audiorenderer:audio_renderer",
65      "../audioutils:audio_utils",
66    ]
67
68    public_configs = [ ":audio_external_library_config" ]
69
70    external_deps = [
71      "c_utils:utils",
72      "eventhandler:libeventhandler",
73      "hilog:libhilog",
74      "init:libbegetutil",
75      "ipc:ipc_single",
76      "pulseaudio:pulse",
77    ]
78
79    if (audio_telephony_core_service_enable) {
80      external_deps += [ "core_service:tel_core_service_api" ]
81      defines += [ "AUDIO_TEL_CORE_SERVICE_ENABLE" ]
82    }
83
84    if (audio_telephony_cellular_data_enable) {
85      external_deps += [ "cellular_data:tel_cellular_data_api" ]
86      defines += [ "AUIDO_TEL_CELLULAR_DATA_ENABLE" ]
87    }
88
89    public_external_deps = [ "bounds_checking_function:libsec_shared" ]
90
91    version_script = "../../../audio_framework.versionscript"
92    innerapi_tags = [ "platformsdk" ]
93
94    part_name = "audio_framework"
95    subsystem_name = "multimedia"
96  }
97}
98
99if (!audio_framework_feature_dtmf_tone) {
100  group("audio_toneplayer_test") {
101    deps = []
102  }
103} else {
104  ohos_executable("audio_toneplayer_test") {
105    install_enable = false
106
107    sources = [ "test/example/audio_toneplayer_test.cpp" ]
108
109    configs = [ ":audio_toneplayer_config" ]
110
111    defines = [ "FEATURE_DTMF_TONE" ]
112
113    deps = [ ":audio_toneplayer" ]
114
115    external_deps = [
116      "hilog:libhilog",
117      "pulseaudio:pulse",
118    ]
119
120    part_name = "audio_framework"
121    subsystem_name = "multimedia"
122  }
123}
124
125config("audio_external_library_config") {
126  include_dirs = [
127    "include",
128    "../../../interfaces/inner_api/native/toneplayer/include",
129  ]
130}
131