• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 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
17config("audio_config") {
18  include_dirs = [
19    "../audiocapturer/include",
20    "../audiorenderer/include",
21    "../../../interfaces/inner_api/native/audiocommon/include",
22    "../../../interfaces/inner_api/native/audiocapturer/include",
23    "../../../interfaces/inner_api/native/audiomanager/include",
24    "../../../interfaces/inner_api/native/audiorenderer/include",
25    "../../../interfaces/inner_api/native/audiostream/include",
26    "../../../services/audio_service/client/include",
27  ]
28
29  cflags = [
30    "-Wall",
31    "-Werror",
32  ]
33}
34
35ohos_shared_library("ohaudio") {
36  sanitize = {
37    cfi = true
38    cfi_cross_dso = true
39    debug = false
40    blocklist = "../../../cfi_blocklist.txt"
41  }
42  include_dirs = [
43    "../../../interfaces/kits/c/",
44    "../../../interfaces/kits/c/common/",
45    "../../../interfaces/kits/c/audio_renderer/",
46    "../../../interfaces/kits/c/audio_capturer/",
47  ]
48
49  configs = [ ":audio_config" ]
50
51  sources = [
52    "./OHAudioCapturer.cpp",
53    "./OHAudioRenderer.cpp",
54    "./OHAudioStreamBuilder.cpp",
55  ]
56
57  deps = [
58    "../audiocapturer:audio_capturer",
59    "../audiorenderer:audio_renderer",
60  ]
61  cflags = [ "-Werror" ]
62
63  external_deps = [
64    "c_utils:utils",
65    "hilog:libhilog",
66  ]
67
68  innerapi_tags = [ "ndk" ]
69
70  output_name = "ohaudio"
71  output_extension = "so"
72  subsystem_name = "multimedia"
73  part_name = "audio_framework"
74}
75
76group("oh_audio_renderer_test_packages") {
77  deps = [
78    ":oh_audio_capturer_test",
79    ":oh_audio_renderer_test",
80  ]
81}
82
83ohos_executable("oh_audio_capturer_test") {
84  install_enable = false
85
86  include_dirs = [
87    "../../../interfaces/kits/c/",
88    "../../../interfaces/kits/c/common/",
89    "../../../interfaces/kits/c/audio_renderer/",
90    "../../../interfaces/kits/c/audio_capturer/",
91  ]
92
93  sources = [ "test/example/oh_audio_capturer_test.cpp" ]
94
95  configs = [ ":audio_config" ]
96
97  deps = [ ":ohaudio" ]
98
99  external_deps = [ "hilog:libhilog" ]
100
101  part_name = "audio_framework"
102  subsystem_name = "multimedia"
103}
104
105ohos_executable("oh_audio_capturer_lowlatency_test") {
106  install_enable = false
107
108  include_dirs = [
109    "../../../interfaces/kits/c/",
110    "../../../interfaces/kits/c/common/",
111    "../../../interfaces/kits/c/audio_renderer/",
112    "../../../interfaces/kits/c/audio_capturer/",
113    "../audioutils/include",
114    "../../../interfaces/inner_api/native/audiocommon/include",
115    "../../../interfaces/inner_api/native/audiomanager/include",
116    "../../../services/audio_service/client/include",
117  ]
118
119  sources = [ "test/example/oh_audio_capturer_lowlatency_test.cpp" ]
120
121  configs = [ ":audio_config" ]
122
123  deps = [
124    ":ohaudio",
125    "../../../services/audio_service:audio_client",
126    "../audioutils:audio_utils",
127  ]
128
129  external_deps = [
130    "c_utils:utils",
131    "hilog:libhilog",
132    "init:libbegetutil",
133  ]
134
135  part_name = "audio_framework"
136  subsystem_name = "multimedia"
137}
138
139ohos_executable("oh_audio_renderer_test") {
140  install_enable = false
141
142  include_dirs = [
143    "../../../interfaces/kits/c/",
144    "../../../interfaces/kits/c/common/",
145    "../../../interfaces/kits/c/audio_renderer/",
146    "../../../interfaces/kits/c/audio_capturer/",
147  ]
148
149  sources = [ "test/example/oh_audio_renderer_test.cpp" ]
150
151  configs = [ ":audio_config" ]
152
153  deps = [ ":ohaudio" ]
154
155  external_deps = [ "hilog:libhilog" ]
156
157  part_name = "audio_framework"
158  subsystem_name = "multimedia"
159}
160