• 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
17ohos_shared_library("audio_renderer_sink") {
18  branch_protector_ret = "pac_ret"
19  sanitize = {
20    cfi = true
21    cfi_cross_dso = true
22    cfi_vcall_icall_only = true
23    debug = false
24    integer_overflow = true
25    ubsan = true
26    boundary_sanitize = true
27  }
28  install_enable = true
29
30  sources = [ "primary/audio_renderer_sink.cpp" ]
31
32  cflags = [ "-fPIC" ]
33  cflags += [ "-Wall" ]
34  cflags += [ "-Os" ]
35  cflags_cc = cflags
36
37  include_dirs = [
38    "common",
39    "../common/include",
40    "../../audioutils/include",
41    "../../audioeffect/include",
42    "../../../../interfaces/inner_api/native/audiocommon/include",
43    "../../../../services/audio_service/common/include/",
44  ]
45
46  deps = [
47    "../../../../services/audio_service:audio_common",
48    "../../audioeffect:audio_effect",
49    "../../audioutils:audio_utils",
50  ]
51
52  external_deps = [
53    "c_utils:utils",
54    "drivers_interface_audio:libaudio_proxy_4.0",
55    "hdf_core:libhdf_ipc_adapter",
56    "hdf_core:libhdf_utils",
57    "hilog:libhilog",
58    "init:libbegetutil",
59    "ipc:ipc_single",
60    "media_foundation:media_monitor_client",
61    "media_foundation:media_monitor_common",
62    "pulseaudio:pulse",
63    "samgr:samgr_proxy",
64  ]
65  defines = []
66  if (audio_framework_feature_power_manager) {
67    external_deps += [ "power_manager:powermgr_client" ]
68    defines += [ "FEATURE_POWER_MANAGER" ]
69  }
70
71  part_name = "audio_framework"
72  subsystem_name = "multimedia"
73}
74
75ohos_shared_library("fast_audio_renderer_sink") {
76  branch_protector_ret = "pac_ret"
77  sanitize = {
78    cfi = true
79    cfi_cross_dso = true
80    cfi_vcall_icall_only = true
81    debug = false
82    integer_overflow = true
83    ubsan = true
84    boundary_sanitize = true
85  }
86  install_enable = true
87
88  sources = [ "fast/fast_audio_renderer_sink.cpp" ]
89
90  include_dirs = [
91    "common",
92    "../common/include",
93    "../../audioutils/include",
94    "../../../../interfaces/inner_api/native/audiocommon/include",
95  ]
96
97  deps = [ "../../audioutils:audio_utils" ]
98
99  external_deps = [
100    "bounds_checking_function:libsec_shared",
101    "c_utils:utils",
102    "drivers_interface_audio:libaudio_proxy_4.0",
103    "hdf_core:libhdf_utils",
104    "hilog:libhilog",
105    "ipc:ipc_single",
106  ]
107  defines = []
108  if (audio_framework_feature_power_manager) {
109    external_deps += [ "power_manager:powermgr_client" ]
110    defines += [ "FEATURE_POWER_MANAGER" ]
111  }
112  cflags = [ "-Os" ]
113  cflags_cc = cflags
114
115  part_name = "audio_framework"
116  subsystem_name = "multimedia"
117}
118
119ohos_shared_library("bluetooth_renderer_sink") {
120  branch_protector_ret = "pac_ret"
121  sanitize = {
122    cfi = true
123    cfi_cross_dso = true
124    cfi_vcall_icall_only = true
125    debug = false
126    integer_overflow = true
127    ubsan = true
128    boundary_sanitize = true
129  }
130  install_enable = true
131
132  sources = [ "bluetooth/bluetooth_renderer_sink.cpp" ]
133
134  cflags = [ "-fPIC" ]
135  cflags += [ "-Wall" ]
136  cflags += [ "-Os" ]
137
138  cflags_cc = cflags
139
140  include_dirs = [
141    "common",
142    "../common/include",
143    "../../audioutils/include",
144    "../../../../interfaces/inner_api/native/audiocommon/include",
145    "../../../../services/audio_service/common/include/",
146  ]
147
148  deps = [
149    "../../../../services/audio_service:audio_common",
150    "../../audioutils:audio_utils",
151  ]
152
153  external_deps = [
154    "bounds_checking_function:libsec_shared",
155    "c_utils:utils",
156    "drivers_peripheral_bluetooth:hdi_audio_bluetooth_header",
157    "hdf_core:libhdf_ipc_adapter",
158    "hdf_core:libhdf_utils",
159    "hdf_core:libhdi",
160    "hilog:libhilog",
161    "init:libbegetutil",
162    "ipc:ipc_single",
163    "media_foundation:media_monitor_client",
164    "samgr:samgr_proxy",
165  ]
166  defines = []
167  if (audio_framework_feature_power_manager) {
168    external_deps += [ "power_manager:powermgr_client" ]
169    defines += [ "FEATURE_POWER_MANAGER" ]
170  }
171
172  if (use_libfuzzer || use_clang_coverage) {
173    defines += [ "TEST_COVERAGE" ]
174  }
175
176  part_name = "audio_framework"
177  subsystem_name = "multimedia"
178}
179
180ohos_shared_library("remote_audio_renderer_sink") {
181  branch_protector_ret = "pac_ret"
182  sanitize = {
183    cfi = true
184    cfi_cross_dso = true
185    cfi_vcall_icall_only = true
186    debug = false
187    integer_overflow = true
188    ubsan = true
189    boundary_sanitize = true
190  }
191  install_enable = true
192
193  sources = [ "remote/remote_audio_renderer_sink.cpp" ]
194
195  cflags = [ "-fPIC" ]
196  cflags += [ "-Wall" ]
197  cflags += [ "-Os" ]
198  cflags_cc = cflags
199
200  include_dirs = [
201    "common",
202    "../common/include",
203    "../devicemanager/interface",
204    "../../audioutils/include",
205    "../../../../interfaces/inner_api/native/audiocommon/include",
206    "../../../../services/audio_service/common/include/",
207  ]
208
209  deps = [
210    "../../../../services/audio_service:audio_common",
211    "../../audioutils:audio_utils",
212    "../devicemanager:audio_device_manager",
213  ]
214
215  external_deps = [
216    "bounds_checking_function:libsec_shared",
217    "c_utils:utils",
218    "drivers_interface_distributed_audio:libdaudio_proxy_1.0",
219    "hdf_core:libhdf_utils",
220    "hilog:libhilog",
221  ]
222  defines = []
223  if (audio_framework_feature_distributed_audio) {
224    defines += [ "FEATURE_DISTRIBUTE_AUDIO" ]
225  }
226
227  part_name = "audio_framework"
228  subsystem_name = "multimedia"
229}
230
231ohos_shared_library("remote_fast_audio_renderer_sink") {
232  branch_protector_ret = "pac_ret"
233  sanitize = {
234    cfi = true
235    cfi_cross_dso = true
236    cfi_vcall_icall_only = true
237    debug = false
238    integer_overflow = true
239    ubsan = true
240    boundary_sanitize = true
241  }
242  install_enable = true
243
244  sources = [ "remote_fast/remote_fast_audio_renderer_sink.cpp" ]
245
246  cflags = [ "-fPIC" ]
247  cflags += [ "-Wall" ]
248  cflags += [ "-Os" ]
249  cflags_cc = cflags
250
251  include_dirs = [
252    "common",
253    "fast",
254    "remote_fast",
255    "../common/include",
256    "../devicemanager/interface",
257    "../../audioutils/include",
258    "../../../../interfaces/inner_api/native/audiocommon/include",
259  ]
260
261  deps = [
262    "../../audioutils:audio_utils",
263    "../devicemanager:audio_device_manager",
264  ]
265
266  external_deps = [
267    "bounds_checking_function:libsec_shared",
268    "c_utils:utils",
269    "drivers_interface_distributed_audio:libdaudio_proxy_1.0",
270    "hdf_core:libhdf_utils",
271    "hilog:libhilog",
272  ]
273  defines = []
274  if (audio_framework_feature_distributed_audio) {
275    defines += [ "FEATURE_DISTRIBUTE_AUDIO" ]
276  }
277
278  part_name = "audio_framework"
279  subsystem_name = "multimedia"
280}
281
282ohos_shared_library("audio_renderer_file_sink") {
283  branch_protector_ret = "pac_ret"
284  sanitize = {
285    cfi = true
286    cfi_cross_dso = true
287    cfi_vcall_icall_only = true
288    debug = false
289    integer_overflow = true
290    ubsan = true
291    boundary_sanitize = true
292  }
293  install_enable = true
294
295  sources = [ "file/audio_renderer_file_sink.cpp" ]
296
297  cflags = [ "-fPIC" ]
298  cflags += [ "-Wall" ]
299  cflags += [ "-Os" ]
300
301  cflags_cc = cflags
302
303  include_dirs = [
304    "common",
305    "../common/include",
306    "../../../../interfaces/inner_api/native/audiocommon/include",
307  ]
308
309  external_deps = [
310    "c_utils:utils",
311    "hilog:libhilog",
312  ]
313
314  part_name = "audio_framework"
315  subsystem_name = "multimedia"
316}
317
318ohos_shared_library("offload_audio_renderer_sink") {
319  branch_protector_ret = "pac_ret"
320  sanitize = {
321    cfi = true
322    cfi_cross_dso = true
323    cfi_vcall_icall_only = true
324    debug = false
325    integer_overflow = true
326    ubsan = true
327    boundary_sanitize = true
328  }
329  install_enable = true
330
331  sources = [ "offload/offload_audio_renderer_sink.cpp" ]
332
333  cflags = [ "-fPIC" ]
334  cflags += [ "-Wall" ]
335  cflags += [ "-Os" ]
336
337  cflags_cc = cflags
338
339  include_dirs = [
340    "common",
341    "../common/include",
342    "../../audioutils/include",
343    "../../../../interfaces/inner_api/native/audiocommon/include",
344    "../../../../services/audio_service/common/include/",
345  ]
346
347  deps = [
348    "../../../../services/audio_service:audio_common",
349    "../../audioutils:audio_utils",
350  ]
351
352  external_deps = [
353    "c_utils:utils",
354    "drivers_interface_audio:libaudio_proxy_4.0",
355    "hdf_core:libhdf_utils",
356    "hilog:libhilog",
357    "ipc:ipc_single",
358    "media_foundation:media_monitor_client",
359    "samgr:samgr_proxy",
360  ]
361
362  defines = []
363  if (audio_framework_feature_power_manager) {
364    external_deps += [ "power_manager:powermgr_client" ]
365    defines += [ "FEATURE_POWER_MANAGER" ]
366  }
367
368  part_name = "audio_framework"
369  subsystem_name = "multimedia"
370}
371
372ohos_shared_library("multichannel_audio_renderer_sink") {
373  branch_protector_ret = "pac_ret"
374  sanitize = {
375    cfi = true
376    cfi_cross_dso = true
377    cfi_vcall_icall_only = true
378    debug = false
379    integer_overflow = true
380    ubsan = true
381    boundary_sanitize = true
382  }
383  install_enable = true
384
385  sources = [ "multichannel/multichannel_audio_renderer_sink.cpp" ]
386
387  cflags = [ "-fPIC" ]
388  cflags += [ "-Wall" ]
389  cflags += [ "-Os" ]
390  cflags_cc = cflags
391
392  include_dirs = [
393    "common",
394    "../common/include",
395    "../../audioutils/include",
396    "../../../../interfaces/inner_api/native/audiocommon/include",
397    "../../../../services/audio_service/common/include/",
398  ]
399
400  deps = [
401    "../../../../services/audio_service:audio_common",
402    "../../audioutils:audio_utils",
403  ]
404
405  external_deps = [
406    "c_utils:utils",
407    "drivers_interface_audio:libaudio_proxy_4.0",
408    "hdf_core:libhdf_utils",
409    "hilog:libhilog",
410    "init:libbegetutil",
411    "ipc:ipc_single",
412  ]
413  defines = []
414  if (audio_framework_feature_power_manager) {
415    external_deps += [ "power_manager:powermgr_client" ]
416    defines += [ "FEATURE_POWER_MANAGER" ]
417  }
418
419  part_name = "audio_framework"
420  subsystem_name = "multimedia"
421}
422
423ohos_shared_library("renderer_sink_adapter") {
424  branch_protector_ret = "pac_ret"
425  sanitize = {
426    cfi = true
427    cfi_cross_dso = true
428    cfi_vcall_icall_only = true
429    debug = false
430    integer_overflow = true
431    ubsan = true
432    boundary_sanitize = true
433  }
434  install_enable = true
435
436  sources = [
437    "common/i_audio_renderer_sink.cpp",
438    "common/renderer_sink_adapter.c",
439  ]
440
441  cflags = [ "-fPIC" ]
442  cflags += [ "-Wall" ]
443  cflags += [ "-Os" ]
444
445  include_dirs = [
446    "common",
447    "primary",
448    "fast",
449    "file",
450    "bluetooth",
451    "remote",
452    "offload",
453    "multichannel",
454    "../common/include",
455    "../devicemanager/interface",
456    "../../../../interfaces/inner_api/native/audiocommon/include",
457  ]
458
459  deps = [
460    ":audio_renderer_sink",
461    ":bluetooth_renderer_sink",
462    ":fast_audio_renderer_sink",
463    ":multichannel_audio_renderer_sink",
464    ":offload_audio_renderer_sink",
465  ]
466
467  if (audio_framework_feature_file_io == true) {
468    deps += [ ":audio_renderer_file_sink" ]
469    defines = [ "FEATURE_FILE_IO" ]
470  }
471
472  if (audio_framework_feature_distributed_audio == true) {
473    deps += [
474      ":remote_audio_renderer_sink",
475      ":remote_fast_audio_renderer_sink",
476    ]
477    cflags += [ "-DDAUDIO_ENABLE" ]
478  }
479
480  cflags_cc = cflags
481
482  external_deps = [
483    "c_utils:utils",
484    "hilog:libhilog",
485    "ipc:ipc_single",
486  ]
487
488  part_name = "audio_framework"
489  subsystem_name = "multimedia"
490}
491