• 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/audiodefinitions/include",
38    "../../../frameworks/native/audiostream/include",
39    "../../../services/audio_service/client/include",
40    "../../../interfaces/kits/c/common",
41  ]
42}
43
44ohos_shared_library("audio_capturer") {
45  branch_protector_ret = "pac_ret"
46  sanitize = {
47    cfi = true
48    cfi_cross_dso = true
49    cfi_vcall_icall_only = true
50    debug = false
51    integer_overflow = true
52    ubsan = true
53    boundary_sanitize = true
54  }
55  install_enable = true
56
57  configs = [ ":audio_capturer_config" ]
58
59  sources = [
60    "../../../services/audio_policy/server/domain/device/src/audio_device_descriptor.cpp",
61    "src/audio_capturer.cpp",
62    "src/audio_capturer_proxy_obj.cpp",
63  ]
64
65  defines = []
66  if (audio_framework_feature_inner_capturer) {
67    defines += [ "HAS_FEATURE_INNERCAPTURER" ]
68  }
69
70  deps = [
71    "../../../services/audio_service:audio_common",
72    "../../../services/audio_policy:audio_policy_client",
73    "../../../services/audio_service:audio_client",
74    "../audiodefinitions:audio_definitions",
75    "../audioutils:audio_utils",
76  ]
77
78  if (audio_framework_feature_low_latency) {
79    defines += [ "SUPPORT_LOW_LATENCY" ]
80  }
81
82  public_configs = [ ":audio_external_library_config" ]
83
84  external_deps = [
85    "c_utils:utils",
86    "eventhandler:libeventhandler",
87    "hilog:libhilog",
88    "ipc:ipc_single",
89    "media_foundation:media_monitor_client",
90    "media_foundation:media_monitor_common",
91    "samgr:samgr_proxy",
92  ]
93
94  version_script = "../../../audio_framework.versionscript"
95  innerapi_tags = [ "platformsdk" ]
96
97  part_name = "audio_framework"
98  subsystem_name = "multimedia"
99}
100
101group("audio_capturer_test_packages") {
102  deps = [ ":audio_capturer_test" ]
103}
104
105ohos_executable("audio_capturer_test") {
106  install_enable = false
107
108  sources = [ "test/example/audio_capturer_test.cpp" ]
109
110  configs = [ ":audio_capturer_config" ]
111
112  deps = [ ":audio_capturer" ]
113
114  external_deps = [
115    "c_utils:utils",
116    "hilog:libhilog",
117  ]
118
119  part_name = "audio_framework"
120  subsystem_name = "multimedia"
121}
122
123ohos_executable("audio_inner_capturer_test") {
124  install_enable = false
125  sanitize = {
126    cfi = true
127    cfi_cross_dso = true
128    debug = false
129    integer_overflow = true
130    ubsan = true
131    boundary_sanitize = true
132  }
133  cflags = [
134    "-Wall",
135    "-Werror",
136  ]
137
138  include_dirs = [ "../../../interfaces/inner_api/native/audiocommon/include" ]
139
140  sources = [ "test/example/audio_inner_capturer_test.cpp" ]
141
142  deps = [ ":audio_capturer" ]
143
144  external_deps = [
145    "c_utils:utils",
146    "hilog:libhilog",
147  ]
148
149  part_name = "audio_framework"
150  subsystem_name = "multimedia"
151}
152