1# Copyright (c) 2022-2023 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_capturer_source") {
18  sanitize = {
19    cfi = true
20    cfi_cross_dso = true
21    cfi_vcall_icall_only = true
22    debug = false
23  }
24  install_enable = true
25  sources = [ "primary/audio_capturer_source.cpp" ]
26  cflags = [ "-fPIC" ]
27  cflags += [ "-Wall" ]
28  cflags_cc = cflags
29
30  include_dirs = [
31    "common",
32    "../common/include",
33    "../../audioutils/include",
34    "../../../../interfaces/inner_api/native/audiocommon/include",
35    "../../../../services/audio_service/common/include/",
36  ]
37
38  deps = [
39    "../../../../services/audio_service:audio_common",
40    "../../audioutils:audio_utils",
41  ]
42
43  external_deps = [
44    "c_utils:utils",
45    "drivers_interface_audio:libaudio_proxy_4.0",
46    "hilog:libhilog",
47    "init:libbegetutil",
48    "media_foundation:media_monitor_client",
49  ]
50  defines = []
51  if (audio_framework_feature_power_manager) {
52    external_deps += [ "power_manager:powermgr_client" ]
53    defines += [ "FEATURE_POWER_MANAGER" ]
54  }
55
56  part_name = "audio_framework"
57  subsystem_name = "multimedia"
58}
59
60ohos_shared_library("fast_audio_capturer_source") {
61  sanitize = {
62    cfi = true
63    cfi_cross_dso = true
64    cfi_vcall_icall_only = true
65    debug = false
66  }
67  install_enable = true
68  sources = [ "fast/fast_audio_capturer_source.cpp" ]
69  cflags = [ "-fPIC" ]
70  cflags += [ "-Wall" ]
71  cflags_cc = cflags
72
73  include_dirs = [
74    "../common/include",
75    "../../../../interfaces/inner_api/native/audiocommon/include",
76    "../../audioutils/include",
77    "common",
78  ]
79
80  deps = [ "../../audioutils:audio_utils" ]
81
82  external_deps = [
83    "drivers_interface_audio:libaudio_proxy_4.0",
84    "hilog:libhilog",
85  ]
86  defines = []
87  if (audio_framework_feature_power_manager) {
88    external_deps += [ "power_manager:powermgr_client" ]
89    defines += [ "FEATURE_POWER_MANAGER" ]
90  }
91
92  part_name = "audio_framework"
93  subsystem_name = "multimedia"
94}
95
96ohos_shared_library("remote_audio_capturer_source") {
97  sanitize = {
98    cfi = true
99    cfi_cross_dso = true
100    cfi_vcall_icall_only = true
101    debug = false
102  }
103  install_enable = true
104  sources = [ "remote/remote_audio_capturer_source.cpp" ]
105  cflags = [ "-fPIC" ]
106  cflags += [ "-Wall" ]
107  cflags_cc = cflags
108
109  include_dirs = [
110    "common",
111    "../common/include",
112    "../devicemanager/interface",
113    "../../audioutils/include",
114    "../../../../interfaces/inner_api/native/audiocommon/include",
115  ]
116
117  deps = [
118    "../../audioutils:audio_utils",
119    "../devicemanager:audio_device_manager",
120  ]
121
122  external_deps = [
123    "c_utils:utils",
124    "drivers_interface_distributed_audio:libdaudio_proxy_1.0",
125    "hilog:libhilog",
126  ]
127  defines = []
128  if (audio_framework_feature_daudio_enable) {
129    defines += [ "FEATURE_DISTRIBUTE_AUDIO" ]
130  }
131
132  part_name = "audio_framework"
133  subsystem_name = "multimedia"
134}
135
136ohos_shared_library("remote_fast_audio_capturer_source") {
137  branch_protector_ret = "pac_ret"
138  sanitize = {
139    cfi = true
140    cfi_cross_dso = true
141    cfi_vcall_icall_only = true
142    debug = false
143  }
144  install_enable = true
145  sources = [ "remote_fast/remote_fast_audio_capturer_source.cpp" ]
146  cflags = [ "-fPIC" ]
147  cflags += [ "-Wall" ]
148  cflags_cc = cflags
149
150  include_dirs = [
151    "common",
152    "../devicemanager/interface",
153    "../common/include",
154    "../../audioutils/include",
155    "../../../../interfaces/inner_api/native/audiocommon/include",
156  ]
157
158  deps = [
159    "../../audioutils:audio_utils",
160    "../devicemanager:audio_device_manager",
161  ]
162
163  external_deps = [
164    "c_utils:utils",
165    "drivers_interface_distributed_audio:libdaudio_proxy_1.0",
166    "hilog:libhilog",
167  ]
168  defines = []
169  if (audio_framework_feature_daudio_enable) {
170    defines += [ "FEATURE_DISTRIBUTE_AUDIO" ]
171  }
172
173  part_name = "audio_framework"
174  subsystem_name = "multimedia"
175}
176
177ohos_shared_library("audio_capturer_file_source") {
178  sanitize = {
179    cfi = true
180    cfi_cross_dso = true
181    cfi_vcall_icall_only = true
182    debug = false
183  }
184  install_enable = true
185
186  sources = [ "file/audio_capturer_file_source.cpp" ]
187
188  cflags = [ "-fPIC" ]
189  cflags += [ "-Wall" ]
190
191  cflags_cc = cflags
192
193  include_dirs = [
194    "common",
195    "../common/include",
196    "../../../../interfaces/inner_api/native/audiocommon/include",
197  ]
198  external_deps = [
199    "hilog:libhilog",
200    "pulseaudio:pulse",
201  ]
202
203  part_name = "audio_framework"
204  subsystem_name = "multimedia"
205}
206
207ohos_shared_library("capturer_source_adapter") {
208  sanitize = {
209    cfi = true
210    cfi_cross_dso = true
211    cfi_vcall_icall_only = true
212    debug = false
213  }
214  install_enable = true
215
216  sources = [
217    "common/capturer_source_adapter.c",
218    "common/i_audio_capturer_source.cpp",
219  ]
220
221  cflags = [ "-fPIC" ]
222  cflags += [ "-Wall" ]
223
224  include_dirs = [
225    "common",
226    "file",
227    "primary",
228    "remote",
229    "../common/include",
230    "../devicemanager/interface",
231    "../../../../interfaces/inner_api/native/audiocommon/include",
232  ]
233
234  deps = [
235    ":audio_capturer_file_source",
236    ":audio_capturer_source",
237  ]
238
239  if (audio_framework_feature_daudio_enable == true) {
240    deps += [
241      ":remote_audio_capturer_source",
242      ":remote_fast_audio_capturer_source",
243    ]
244    cflags += [ "-DDAUDIO_ENABLE" ]
245  }
246
247  cflags_cc = cflags
248
249  external_deps = [
250    "hilog:libhilog",
251    "pulseaudio:pulse",
252  ]
253
254  part_name = "audio_framework"
255  subsystem_name = "multimedia"
256}
257