blob: f50b53a94cdae70846dacf55c8ff126887bf1848 [file] [log] [blame]
Bob Badour56786ac2021-02-25 15:24:36 -08001package {
2 // See: http://go/android-license-faq
3 // A large-scale-change added 'default_applicable_licenses' to import
4 // all of the 'license_kinds' from "frameworks_av_license"
5 // to get the below license kinds:
6 // SPDX-license-identifier-Apache-2.0
7 default_applicable_licenses: ["frameworks_av_license"],
8}
9
jiabind5bd06a2021-04-27 22:04:08 +000010tidy_errors = [
11 // https://clang.llvm.org/extra/clang-tidy/checks/list.html
12 // For many categories, the checks are too many to specify individually.
13 // Feel free to disable as needed - as warnings are generally ignored,
14 // we treat warnings as errors.
15 "android-*",
16 "bugprone-*",
17 "cert-*",
18 "clang-analyzer-security*",
19 "google-*",
20 "misc-*",
21 //"modernize-*", // explicitly list the modernize as they can be subjective.
22 "modernize-avoid-bind",
23 //"modernize-avoid-c-arrays", // std::array<> can be verbose
24 "modernize-concat-nested-namespaces",
25 //"modernize-deprecated-headers", // C headers still ok even if there is C++ equivalent.
26 "modernize-deprecated-ios-base-aliases",
27 "modernize-loop-convert",
28 "modernize-make-shared",
29 "modernize-make-unique",
30 "modernize-pass-by-value",
31 "modernize-raw-string-literal",
32 "modernize-redundant-void-arg",
33 "modernize-replace-auto-ptr",
34 "modernize-replace-random-shuffle",
35 "modernize-return-braced-init-list",
36 "modernize-shrink-to-fit",
37 "modernize-unary-static-assert",
38 // "modernize-use-auto", // found in AAudioAudio.cpp
39 "modernize-use-bool-literals",
40 "modernize-use-default-member-init",
41 "modernize-use-emplace",
42 "modernize-use-equals-default",
43 "modernize-use-equals-delete",
44 // "modernize-use-nodiscard", // found in aidl generated files
45 "modernize-use-noexcept",
46 "modernize-use-nullptr",
47 // "modernize-use-override", // found in aidl generated files
48 // "modernize-use-trailing-return-type", // not necessarily more readable
49 "modernize-use-transparent-functors",
50 "modernize-use-uncaught-exceptions",
51 // "modernize-use-using", // found typedef in several files
52 "performance-*",
53
54 // Remove some pedantic stylistic requirements.
55 "-android-cloexec-dup", // found in SharedMemoryParcelable.cpp
56 "-bugprone-macro-parentheses", // found in SharedMemoryParcelable.h
57 "-bugprone-narrowing-conversions", // found in several interface from size_t to int32_t
58
59 "-google-readability-casting", // C++ casts not always necessary and may be verbose
60 "-google-readability-todo", // do not require TODO(info)
61 "-google-build-using-namespace", // Reenable and fix later.
62 "-google-global-names-in-headers", // found in several files
63
64 "-misc-non-private-member-variables-in-classes", // found in aidl generated files
65
66 "-performance-no-int-to-ptr", // found in SharedMemoryParcelable.h
67]
68
Dan Willemsenb44c69e2017-10-23 17:15:03 -070069cc_library {
70 name: "libaaudio",
71
72 local_include_dirs: [
73 "binding",
74 "client",
75 "core",
76 "fifo",
Phil Burk64dce362018-03-28 15:30:39 -070077 "flowgraph",
Dan Willemsenb44c69e2017-10-23 17:15:03 -070078 "legacy",
79 "utility",
80 ],
Marco Nelissen6b285942019-10-21 14:52:30 -070081 header_libs: [
82 "libaaudio_headers",
83 ],
Dan Willemsenb44c69e2017-10-23 17:15:03 -070084 export_header_lib_headers: ["libaaudio_headers"],
dimitry8e8a9682019-06-04 15:14:02 +020085 version_script: "libaaudio.map.txt",
Dan Willemsenb44c69e2017-10-23 17:15:03 -070086
87 srcs: [
dimitryd81a84a2019-07-17 13:55:16 +020088 "core/AAudioAudio.cpp",
89 ],
90
91 cflags: [
Phil Burk0bd745e2020-10-17 18:20:01 +000092 "-Wthread-safety",
dimitryd81a84a2019-07-17 13:55:16 +020093 "-Wno-unused-parameter",
94 "-Wall",
95 "-Werror",
96
97 // By default, all symbols are hidden.
98 // "-fvisibility=hidden",
99 // AAUDIO_API is used to explicitly export a function or a variable as a visible symbol.
100 "-DAAUDIO_API=__attribute__((visibility(\"default\")))",
101 ],
102
103 shared_libs: [
104 "libaaudio_internal",
105 "libaudioclient",
106 "libaudioutils",
Phil Burka9876702020-04-20 18:16:15 -0700107 "libmedia_helper",
108 "libmediametrics",
109 "libmediautils",
dimitryd81a84a2019-07-17 13:55:16 +0200110 "liblog",
111 "libcutils",
112 "libutils",
113 "libbinder",
Svet Ganov3e5f14f2021-05-13 22:51:08 +0000114 "framework-permission-aidl-cpp",
dimitryd81a84a2019-07-17 13:55:16 +0200115 ],
Cindy Zhou30ed5942019-10-30 13:24:37 -0700116
117 sanitize: {
118 integer_overflow: true,
119 misc_undefined: ["bounds"],
Cindy Zhou30ed5942019-10-30 13:24:37 -0700120 },
121
Zach Johnson99c47ff2019-12-02 15:28:34 -0800122 stubs: {
123 symbol_file: "libaaudio.map.txt",
124 versions: ["28"],
125 },
jiabind5bd06a2021-04-27 22:04:08 +0000126
127 tidy: true,
128 tidy_checks: tidy_errors,
129 tidy_checks_as_errors: tidy_errors,
130 tidy_flags: [
131 "-format-style=file",
132 ]
dimitryd81a84a2019-07-17 13:55:16 +0200133}
134
135cc_library {
136 name: "libaaudio_internal",
137
138 local_include_dirs: [
139 "binding",
140 "client",
141 "core",
142 "fifo",
143 "legacy",
144 "utility",
145 ],
146
147 export_include_dirs: ["."],
Marco Nelissen6b285942019-10-21 14:52:30 -0700148 header_libs: [
149 "libaaudio_headers",
Cindy Zhou30ed5942019-10-30 13:24:37 -0700150 "libmedia_headers",
Marco Nelissen7c96ea72020-01-10 15:46:22 -0800151 "libmediametrics_headers",
Marco Nelissen6b285942019-10-21 14:52:30 -0700152 ],
dimitryd81a84a2019-07-17 13:55:16 +0200153 export_header_lib_headers: ["libaaudio_headers"],
154
Philip P. Moltmannbda45752020-07-17 16:41:18 -0700155 export_shared_lib_headers: [
Svet Ganov3e5f14f2021-05-13 22:51:08 +0000156 "framework-permission-aidl-cpp",
Philip P. Moltmannbda45752020-07-17 16:41:18 -0700157 ],
158
dimitryd81a84a2019-07-17 13:55:16 +0200159 shared_libs: [
160 "libaudioclient",
161 "libaudioutils",
Phil Burka9876702020-04-20 18:16:15 -0700162 "libmedia_helper",
163 "libmediametrics",
164 "libmediautils",
dimitryd81a84a2019-07-17 13:55:16 +0200165 "liblog",
166 "libcutils",
167 "libutils",
168 "libbinder",
Svet Ganov3e5f14f2021-05-13 22:51:08 +0000169 "framework-permission-aidl-cpp",
Ytai Ben-Tsvi0412f732020-08-17 14:43:36 -0700170 "aaudio-aidl-cpp",
Mikhail Naganov57bd06f2021-08-10 16:41:54 -0700171 "android.media.audio.common.types-V1-cpp",
Mikhail Naganovb60bd1b2021-07-15 17:31:43 -0700172 "audioclient-types-aidl-cpp",
Philip P. Moltmannbda45752020-07-17 16:41:18 -0700173 "libaudioclient_aidl_conversion",
174 ],
175
dimitryd81a84a2019-07-17 13:55:16 +0200176 cflags: [
177 "-Wno-unused-parameter",
178 "-Wall",
179 "-Werror",
180 ],
181
182 srcs: [
183 "core/AudioGlobal.cpp",
Dan Willemsenb44c69e2017-10-23 17:15:03 -0700184 "core/AudioStream.cpp",
185 "core/AudioStreamBuilder.cpp",
Dan Willemsenb44c69e2017-10-23 17:15:03 -0700186 "core/AAudioStreamParameters.cpp",
187 "legacy/AudioStreamLegacy.cpp",
188 "legacy/AudioStreamRecord.cpp",
189 "legacy/AudioStreamTrack.cpp",
190 "utility/AAudioUtilities.cpp",
191 "utility/FixedBlockAdapter.cpp",
192 "utility/FixedBlockReader.cpp",
193 "utility/FixedBlockWriter.cpp",
Dan Willemsenb44c69e2017-10-23 17:15:03 -0700194 "fifo/FifoBuffer.cpp",
195 "fifo/FifoControllerBase.cpp",
Phil Burk0127c1b2018-03-29 13:48:06 -0700196 "client/AAudioFlowGraph.cpp",
Dan Willemsenb44c69e2017-10-23 17:15:03 -0700197 "client/AudioEndpoint.cpp",
198 "client/AudioStreamInternal.cpp",
199 "client/AudioStreamInternalCapture.cpp",
200 "client/AudioStreamInternalPlay.cpp",
201 "client/IsochronousClockModel.cpp",
202 "binding/AudioEndpointParcelable.cpp",
Ytai Ben-Tsvi734e3502020-08-24 14:57:36 -0700203 "binding/AAudioBinderAdapter.cpp",
Dan Willemsenb44c69e2017-10-23 17:15:03 -0700204 "binding/AAudioBinderClient.cpp",
205 "binding/AAudioStreamRequest.cpp",
206 "binding/AAudioStreamConfiguration.cpp",
Dan Willemsenb44c69e2017-10-23 17:15:03 -0700207 "binding/RingBufferParcelable.cpp",
208 "binding/SharedMemoryParcelable.cpp",
209 "binding/SharedRegionParcelable.cpp",
Robert Wu057f0832021-12-03 20:41:07 +0000210 "flowgraph/ChannelCountConverter.cpp",
Phil Burk64dce362018-03-28 15:30:39 -0700211 "flowgraph/ClipToRange.cpp",
Robert Wu057f0832021-12-03 20:41:07 +0000212 "flowgraph/FlowGraphNode.cpp",
213 "flowgraph/ManyToMultiConverter.cpp",
Robert Wud7400832021-12-04 01:11:19 +0000214 "flowgraph/MonoBlend.cpp",
Phil Burk64dce362018-03-28 15:30:39 -0700215 "flowgraph/MonoToMultiConverter.cpp",
Robert Wu057f0832021-12-03 20:41:07 +0000216 "flowgraph/MultiToMonoConverter.cpp",
Robert Wu8393bed2021-12-08 02:08:48 +0000217 "flowgraph/MultiToManyConverter.cpp",
Phil Burk64dce362018-03-28 15:30:39 -0700218 "flowgraph/RampLinear.cpp",
Robert Wu057f0832021-12-03 20:41:07 +0000219 "flowgraph/SampleRateConverter.cpp",
Phil Burk64dce362018-03-28 15:30:39 -0700220 "flowgraph/SinkFloat.cpp",
221 "flowgraph/SinkI16.cpp",
222 "flowgraph/SinkI24.cpp",
Phil Burk04e805b2018-03-27 09:13:53 -0700223 "flowgraph/SinkI32.cpp",
Phil Burk64dce362018-03-28 15:30:39 -0700224 "flowgraph/SourceFloat.cpp",
225 "flowgraph/SourceI16.cpp",
226 "flowgraph/SourceI24.cpp",
Phil Burk04e805b2018-03-27 09:13:53 -0700227 "flowgraph/SourceI32.cpp",
Robert Wu057f0832021-12-03 20:41:07 +0000228 "flowgraph/resampler/IntegerRatio.cpp",
229 "flowgraph/resampler/LinearResampler.cpp",
230 "flowgraph/resampler/MultiChannelResampler.cpp",
231 "flowgraph/resampler/PolyphaseResampler.cpp",
232 "flowgraph/resampler/PolyphaseResamplerMono.cpp",
233 "flowgraph/resampler/PolyphaseResamplerStereo.cpp",
234 "flowgraph/resampler/SincResampler.cpp",
235 "flowgraph/resampler/SincResamplerStereo.cpp",
Dan Willemsenb44c69e2017-10-23 17:15:03 -0700236 ],
Cindy Zhou30ed5942019-10-30 13:24:37 -0700237 sanitize: {
238 integer_overflow: true,
239 misc_undefined: ["bounds"],
Cindy Zhou30ed5942019-10-30 13:24:37 -0700240 },
jiabind5bd06a2021-04-27 22:04:08 +0000241
242 tidy: true,
243 tidy_checks: tidy_errors,
244 tidy_checks_as_errors: tidy_errors,
245 tidy_flags: [
246 "-format-style=file",
247 ]
Dan Willemsenb44c69e2017-10-23 17:15:03 -0700248}
Ytai Ben-Tsvi0412f732020-08-17 14:43:36 -0700249
250aidl_interface {
251 name: "aaudio-aidl",
252 unstable: true,
253 local_include_dir: "binding/aidl",
254 srcs: [
Ytai Ben-Tsvic5f45872020-08-18 10:39:44 -0700255 "binding/aidl/aaudio/Endpoint.aidl",
256 "binding/aidl/aaudio/RingBuffer.aidl",
257 "binding/aidl/aaudio/SharedRegion.aidl",
258 "binding/aidl/aaudio/StreamParameters.aidl",
259 "binding/aidl/aaudio/StreamRequest.aidl",
Ytai Ben-Tsvi0412f732020-08-17 14:43:36 -0700260 "binding/aidl/aaudio/IAAudioClient.aidl",
Ytai Ben-Tsvic5f45872020-08-18 10:39:44 -0700261 "binding/aidl/aaudio/IAAudioService.aidl",
Ytai Ben-Tsvi0412f732020-08-17 14:43:36 -0700262 ],
Ytai Ben-Tsvic5f45872020-08-18 10:39:44 -0700263 imports: [
Mikhail Naganov57bd06f2021-08-10 16:41:54 -0700264 "android.media.audio.common.types",
Mikhail Naganovc10572e2021-05-21 17:42:02 -0700265 "audioclient-types-aidl",
Ytai Ben-Tsvic5f45872020-08-18 10:39:44 -0700266 "shared-file-region-aidl",
Svet Ganov3e5f14f2021-05-13 22:51:08 +0000267 "framework-permission-aidl",
Ytai Ben-Tsvic5f45872020-08-18 10:39:44 -0700268 ],
269 backend:
270 {
Ytai Ben-Tsvic5f45872020-08-18 10:39:44 -0700271 java: {
Ytai Ben-Tsvi71151352021-03-10 16:29:01 -0800272 sdk_version: "module_current",
Ytai Ben-Tsvic5f45872020-08-18 10:39:44 -0700273 },
274 },
Ytai Ben-Tsvi0412f732020-08-17 14:43:36 -0700275}