• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023-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_config") {
18  include_dirs = [
19    "../audiocapturer/include",
20    "../audiorenderer/include",
21    "../audioutils/include/",
22    "../../../interfaces/inner_api/native/audiocommon/include",
23    "../../../interfaces/inner_api/native/audiocapturer/include",
24    "../../../interfaces/inner_api/native/audiomanager/include",
25    "../../../interfaces/inner_api/native/audiorenderer/include",
26    "../../../interfaces/inner_api/native/audiostream/include",
27    "../../../services/audio_service/client/include",
28  ]
29
30  cflags = [
31    "-Wall",
32    "-Werror",
33  ]
34}
35
36ohos_shared_library("ohaudio") {
37  sanitize = {
38    cfi = true
39    cfi_cross_dso = true
40    cfi_vcall_icall_only = true
41    debug = false
42    integer_overflow = true
43    ubsan = true
44    boundary_sanitize = true
45  }
46  include_dirs = [
47    "../../../interfaces/kits/c/",
48    "../../../interfaces/kits/c/common/",
49    "../../../interfaces/kits/c/audio_renderer/",
50    "../../../interfaces/kits/c/audio_capturer/",
51    "../../../interfaces/kits/c/audio_manager/",
52    "../../native/audiopolicy/include/",
53  ]
54
55  configs = [ ":audio_config" ]
56
57  sources = [
58    "./OHAudioCapturer.cpp",
59    "./OHAudioDeviceDescriptor.cpp",
60    "./OHAudioManager.cpp",
61    "./OHAudioRenderer.cpp",
62    "./OHAudioRoutingManager.cpp",
63    "./OHAudioSessionManager.cpp",
64    "./OHAudioStreamBuilder.cpp",
65  ]
66
67  deps = [
68    "../../../services/audio_service:audio_client",
69    "../audiocapturer:audio_capturer",
70    "../audiorenderer:audio_renderer",
71  ]
72  cflags = [ "-Werror" ]
73
74  external_deps = [
75    "c_utils:utils",
76    "hilog:libhilog",
77    "init:libbegetutil",
78  ]
79
80  innerapi_tags = [ "ndk" ]
81
82  output_name = "ohaudio"
83  output_extension = "so"
84  subsystem_name = "multimedia"
85  part_name = "audio_framework"
86}
87
88group("oh_audio_renderer_test_packages") {
89  deps = [
90    ":oh_audio_capturer_test",
91    ":oh_audio_renderer_test",
92    ":oh_audio_session_manager_test",
93  ]
94}
95
96ohos_executable("oh_audio_capturer_test") {
97  install_enable = false
98
99  include_dirs = [
100    "../../../interfaces/kits/c/",
101    "../../../interfaces/kits/c/common/",
102    "../../../interfaces/kits/c/audio_renderer/",
103    "../../../interfaces/kits/c/audio_capturer/",
104  ]
105
106  sources = [ "test/example/oh_audio_capturer_test.cpp" ]
107
108  configs = [ ":audio_config" ]
109
110  deps = [ ":ohaudio" ]
111
112  external_deps = [ "hilog:libhilog" ]
113
114  part_name = "audio_framework"
115  subsystem_name = "multimedia"
116}
117
118ohos_executable("oh_audio_capturer_lowlatency_test") {
119  install_enable = false
120
121  include_dirs = [
122    "../../../interfaces/kits/c/",
123    "../../../interfaces/kits/c/common/",
124    "../../../interfaces/kits/c/audio_renderer/",
125    "../../../interfaces/kits/c/audio_capturer/",
126    "../audioutils/include",
127    "../../../interfaces/inner_api/native/audiocommon/include",
128    "../../../interfaces/inner_api/native/audiomanager/include",
129    "../../../services/audio_service/client/include",
130  ]
131
132  sources = [ "test/example/oh_audio_capturer_lowlatency_test.cpp" ]
133
134  configs = [ ":audio_config" ]
135
136  deps = [
137    ":ohaudio",
138    "../audioutils:audio_utils",
139  ]
140
141  external_deps = [
142    "bounds_checking_function:libsec_shared",
143    "c_utils:utils",
144    "hilog:libhilog",
145    "init:libbegetutil",
146  ]
147
148  part_name = "audio_framework"
149  subsystem_name = "multimedia"
150}
151
152ohos_executable("oh_audio_renderer_test") {
153  install_enable = false
154
155  include_dirs = [
156    "../../../interfaces/kits/c/",
157    "../../../interfaces/kits/c/common/",
158    "../../../interfaces/kits/c/audio_renderer/",
159    "../../../interfaces/kits/c/audio_capturer/",
160  ]
161
162  sources = [ "test/example/oh_audio_renderer_test.cpp" ]
163
164  configs = [ ":audio_config" ]
165
166  deps = [ ":ohaudio" ]
167
168  external_deps = [ "hilog:libhilog" ]
169
170  part_name = "audio_framework"
171  subsystem_name = "multimedia"
172}
173
174ohos_executable("oh_audio_session_manager_test") {
175  stack_protector_ret = true
176
177  sanitize = {
178    cfi = true
179    cfi_cross_dso = true
180    cfi_vcall_icall_only = true
181    debug = false
182    integer_overflow = true
183    ubsan = true
184    boundary_sanitize = true
185  }
186
187  install_enable = false
188
189  include_dirs = [
190    "../../../interfaces/kits/c/",
191    "../../../interfaces/kits/c/audio_manager/",
192    "../../../interfaces/kits/c/common/",
193    "../../../interfaces/kits/c/audio_renderer/",
194  ]
195
196  sources = [ "test/example/oh_audio_session_manager_test.cpp" ]
197
198  configs = [ ":audio_config" ]
199
200  deps = [
201    ":ohaudio",
202    "../audioutils:audio_utils",
203  ]
204
205  external_deps = [
206    "bounds_checking_function:libsec_shared",
207    "c_utils:utils",
208    "hilog:libhilog",
209    "init:libbegetutil",
210  ]
211
212  part_name = "audio_framework"
213  subsystem_name = "multimedia"
214}
215