• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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_capturer_config") {
18  include_dirs = [
19    "include",
20    "../../../interfaces/inner_api/native/audiocommon/include",
21    "../../../interfaces/inner_api/native/audiocapturer/include",
22    "../../../frameworks/native/audiostream/include",
23    "../../../services/audio_service/client/include",
24  ]
25
26  cflags = [
27    "-Wall",
28    "-Werror",
29  ]
30}
31
32config("audio_external_library_config") {
33  include_dirs = [
34    "include",
35    "../../../interfaces/inner_api/native/audiocapturer/include",
36    "../../../interfaces/inner_api/native/audiocommon/include",
37    "../../../frameworks/native/audiostream/include",
38    "../../../services/audio_service/client/include",
39    "../../../interfaces/kits/c/common",
40  ]
41}
42
43ohos_shared_library("audio_capturer") {
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_capturer_config" ]
57
58  sources = [
59    "../../../services/audio_policy/server/src/service/device/audio_device_descriptor.cpp",
60    "src/audio_capturer.cpp",
61    "src/audio_capturer_proxy_obj.cpp",
62  ]
63
64  defines = []
65  if (audio_framework_feature_inner_capturer) {
66    defines += [ "HAS_FEATURE_INNERCAPTURER" ]
67  }
68
69  deps = [
70    "../../../services/audio_policy:audio_policy_client",
71    "../../../services/audio_service:audio_client",
72    "../audioutils:audio_utils",
73  ]
74
75  if (audio_framework_feature_low_latency) {
76    defines += [ "SUPPORT_LOW_LATENCY" ]
77  }
78
79  public_configs = [ ":audio_external_library_config" ]
80
81  external_deps = [
82    "c_utils:utils",
83    "eventhandler:libeventhandler",
84    "hilog:libhilog",
85    "ipc:ipc_single",
86    "media_foundation:media_monitor_client",
87    "media_foundation:media_monitor_common",
88    "pulseaudio:pulse",
89    "samgr:samgr_proxy",
90  ]
91
92  version_script = "../../../audio_framework.versionscript"
93  innerapi_tags = [ "platformsdk" ]
94
95  part_name = "audio_framework"
96  subsystem_name = "multimedia"
97}
98
99group("audio_capturer_test_packages") {
100  deps = [ ":audio_capturer_test" ]
101}
102
103ohos_executable("audio_capturer_test") {
104  install_enable = false
105
106  sources = [ "test/example/audio_capturer_test.cpp" ]
107
108  configs = [ ":audio_capturer_config" ]
109
110  deps = [ ":audio_capturer" ]
111
112  external_deps = [ "hilog:libhilog" ]
113
114  part_name = "audio_framework"
115  subsystem_name = "multimedia"
116}
117
118ohos_executable("audio_inner_capturer_test") {
119  install_enable = false
120  sanitize = {
121    cfi = true
122    cfi_cross_dso = true
123    debug = false
124    integer_overflow = true
125    ubsan = true
126    boundary_sanitize = true
127  }
128  cflags = [
129    "-Wall",
130    "-Werror",
131  ]
132
133  include_dirs = [ "../../../interfaces/inner_api/native/audiocommon/include" ]
134
135  sources = [ "test/example/audio_inner_capturer_test.cpp" ]
136
137  deps = [ ":audio_capturer" ]
138
139  external_deps = [
140    "c_utils:utils",
141    "hilog:libhilog",
142  ]
143
144  part_name = "audio_framework"
145  subsystem_name = "multimedia"
146}
147