blob: cccb096b5d5cdb06967f52c653be59fffcdfc2b8 [file] [log] [blame]
Bob Badour56786ac2021-02-25 15:24:36 -08001package {
Ronish Kaliab5dd44b2024-02-14 14:32:32 +00002 default_team: "trendy_team_media_framework_audio",
Bob Badour56786ac2021-02-25 15:24:36 -08003 // See: http://go/android-license-faq
4 // A large-scale-change added 'default_applicable_licenses' to import
5 // all of the 'license_kinds' from "frameworks_av_license"
6 // to get the below license kinds:
7 // SPDX-license-identifier-Apache-2.0
8 default_applicable_licenses: ["frameworks_av_license"],
9}
10
jiabind5bd06a2021-04-27 22:04:08 +000011tidy_errors = [
12 // https://clang.llvm.org/extra/clang-tidy/checks/list.html
13 // For many categories, the checks are too many to specify individually.
14 // Feel free to disable as needed - as warnings are generally ignored,
15 // we treat warnings as errors.
16 "android-*",
17 "bugprone-*",
18 "cert-*",
19 "clang-analyzer-security*",
20 "google-*",
21 "misc-*",
22 //"modernize-*", // explicitly list the modernize as they can be subjective.
23 "modernize-avoid-bind",
24 //"modernize-avoid-c-arrays", // std::array<> can be verbose
25 "modernize-concat-nested-namespaces",
26 //"modernize-deprecated-headers", // C headers still ok even if there is C++ equivalent.
27 "modernize-deprecated-ios-base-aliases",
28 "modernize-loop-convert",
29 "modernize-make-shared",
30 "modernize-make-unique",
31 "modernize-pass-by-value",
32 "modernize-raw-string-literal",
33 "modernize-redundant-void-arg",
34 "modernize-replace-auto-ptr",
35 "modernize-replace-random-shuffle",
36 "modernize-return-braced-init-list",
37 "modernize-shrink-to-fit",
38 "modernize-unary-static-assert",
39 // "modernize-use-auto", // found in AAudioAudio.cpp
40 "modernize-use-bool-literals",
41 "modernize-use-default-member-init",
42 "modernize-use-emplace",
43 "modernize-use-equals-default",
44 "modernize-use-equals-delete",
jiabin8ecf6332023-12-05 18:51:29 +000045 "modernize-use-nodiscard",
jiabind5bd06a2021-04-27 22:04:08 +000046 "modernize-use-noexcept",
47 "modernize-use-nullptr",
jiabin8ecf6332023-12-05 18:51:29 +000048 "modernize-use-override",
jiabind5bd06a2021-04-27 22:04:08 +000049 // "modernize-use-trailing-return-type", // not necessarily more readable
50 "modernize-use-transparent-functors",
51 "modernize-use-uncaught-exceptions",
52 // "modernize-use-using", // found typedef in several files
53 "performance-*",
54
55 // Remove some pedantic stylistic requirements.
56 "-android-cloexec-dup", // found in SharedMemoryParcelable.cpp
57 "-bugprone-macro-parentheses", // found in SharedMemoryParcelable.h
58 "-bugprone-narrowing-conversions", // found in several interface from size_t to int32_t
59
jiabind5bd06a2021-04-27 22:04:08 +000060 "-google-build-using-namespace", // Reenable and fix later.
61 "-google-global-names-in-headers", // found in several files
Andy Hunga159e4b2024-03-15 11:48:57 -070062 "-google-readability-casting", // C++ casts not always necessary and may be verbose
63 "-google-readability-todo", // do not require TODO(info)
jiabind5bd06a2021-04-27 22:04:08 +000064
65 "-misc-non-private-member-variables-in-classes", // found in aidl generated files
66
67 "-performance-no-int-to-ptr", // found in SharedMemoryParcelable.h
68]
69
Dan Willemsenb44c69e2017-10-23 17:15:03 -070070cc_library {
71 name: "libaaudio",
72
73 local_include_dirs: [
74 "binding",
75 "client",
76 "core",
77 "fifo",
Phil Burk64dce362018-03-28 15:30:39 -070078 "flowgraph",
Dan Willemsenb44c69e2017-10-23 17:15:03 -070079 "legacy",
80 "utility",
81 ],
Marco Nelissen6b285942019-10-21 14:52:30 -070082 header_libs: [
83 "libaaudio_headers",
84 ],
Dan Willemsenb44c69e2017-10-23 17:15:03 -070085 export_header_lib_headers: ["libaaudio_headers"],
dimitry8e8a9682019-06-04 15:14:02 +020086 version_script: "libaaudio.map.txt",
Dan Willemsenb44c69e2017-10-23 17:15:03 -070087
88 srcs: [
dimitryd81a84a2019-07-17 13:55:16 +020089 "core/AAudioAudio.cpp",
90 ],
91
92 cflags: [
dimitryd81a84a2019-07-17 13:55:16 +020093 "-Wall",
94 "-Werror",
Andy Hunga159e4b2024-03-15 11:48:57 -070095 "-Wno-unused-parameter",
96 "-Wthread-safety",
97
Andy Hung99486a62024-03-29 19:52:54 -070098 // AAUDIO_API is used to explicitly export a function or a variable as a visible symbol.
dimitryd81a84a2019-07-17 13:55:16 +020099 "-DAAUDIO_API=__attribute__((visibility(\"default\")))",
100 ],
101
102 shared_libs: [
Andy Hunga159e4b2024-03-15 11:48:57 -0700103 "framework-permission-aidl-cpp",
dimitryd81a84a2019-07-17 13:55:16 +0200104 "libaaudio_internal",
105 "libaudioclient",
Robert Wub7f8edc2024-11-04 19:54:38 +0000106 "libaudiofoundation",
dimitryd81a84a2019-07-17 13:55:16 +0200107 "libaudioutils",
Andy Hunga159e4b2024-03-15 11:48:57 -0700108 "libbinder",
109 "libcutils",
110 "liblog",
Phil Burka9876702020-04-20 18:16:15 -0700111 "libmedia_helper",
112 "libmediametrics",
113 "libmediautils",
dimitryd81a84a2019-07-17 13:55:16 +0200114 "libutils",
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",
Ronish Kaliab5dd44b2024-02-14 14:32:32 +0000132 ],
dimitryd81a84a2019-07-17 13:55:16 +0200133}
134
135cc_library {
136 name: "libaaudio_internal",
137
Lorena Torres-Huerta03112f62022-08-12 23:08:12 +0000138 defaults: [
139 "latest_android_media_audio_common_types_cpp_shared",
140 ],
141
dimitryd81a84a2019-07-17 13:55:16 +0200142 local_include_dirs: [
143 "binding",
144 "client",
145 "core",
146 "fifo",
147 "legacy",
148 "utility",
149 ],
150
151 export_include_dirs: ["."],
Marco Nelissen6b285942019-10-21 14:52:30 -0700152 header_libs: [
153 "libaaudio_headers",
Cindy Zhou30ed5942019-10-30 13:24:37 -0700154 "libmedia_headers",
Marco Nelissen7c96ea72020-01-10 15:46:22 -0800155 "libmediametrics_headers",
Marco Nelissen6b285942019-10-21 14:52:30 -0700156 ],
dimitryd81a84a2019-07-17 13:55:16 +0200157 export_header_lib_headers: ["libaaudio_headers"],
158
Philip P. Moltmannbda45752020-07-17 16:41:18 -0700159 export_shared_lib_headers: [
Svet Ganov3e5f14f2021-05-13 22:51:08 +0000160 "framework-permission-aidl-cpp",
Philip P. Moltmannbda45752020-07-17 16:41:18 -0700161 ],
162
dimitryd81a84a2019-07-17 13:55:16 +0200163 shared_libs: [
Andy Hunga159e4b2024-03-15 11:48:57 -0700164 "aaudio-aidl-cpp",
165 "audioclient-types-aidl-cpp",
166 "com.android.media.aaudio-aconfig-cc",
167 "framework-permission-aidl-cpp",
dimitryd81a84a2019-07-17 13:55:16 +0200168 "libaudioclient",
Andy Hunga159e4b2024-03-15 11:48:57 -0700169 "libaudioclient_aidl_conversion",
Robert Wub7f8edc2024-11-04 19:54:38 +0000170 "libaudiofoundation",
dimitryd81a84a2019-07-17 13:55:16 +0200171 "libaudioutils",
Andy Hunga159e4b2024-03-15 11:48:57 -0700172 "libbinder",
173 "libcutils",
174 "liblog",
Phil Burka9876702020-04-20 18:16:15 -0700175 "libmedia_helper",
176 "libmediametrics",
177 "libmediautils",
dimitryd81a84a2019-07-17 13:55:16 +0200178 "libutils",
Philip P. Moltmannbda45752020-07-17 16:41:18 -0700179 ],
180
dimitryd81a84a2019-07-17 13:55:16 +0200181 cflags: [
dimitryd81a84a2019-07-17 13:55:16 +0200182 "-Wall",
183 "-Werror",
Andy Hunga159e4b2024-03-15 11:48:57 -0700184 "-Wno-unused-parameter",
dimitryd81a84a2019-07-17 13:55:16 +0200185 ],
186
187 srcs: [
Andy Hunga159e4b2024-03-15 11:48:57 -0700188 "binding/AAudioBinderAdapter.cpp",
189 "binding/AAudioBinderClient.cpp",
190 "binding/AAudioStreamConfiguration.cpp",
191 "binding/AAudioStreamRequest.cpp",
192 "binding/AudioEndpointParcelable.cpp",
193 "binding/RingBufferParcelable.cpp",
194 "binding/SharedMemoryParcelable.cpp",
195 "binding/SharedRegionParcelable.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",
Andy Hunga159e4b2024-03-15 11:48:57 -0700202 "core/AAudioStreamParameters.cpp",
203 "core/AudioGlobal.cpp",
204 "core/AudioStream.cpp",
205 "core/AudioStreamBuilder.cpp",
206 "fifo/FifoBuffer.cpp",
207 "fifo/FifoControllerBase.cpp",
Robert Wu057f0832021-12-03 20:41:07 +0000208 "flowgraph/ChannelCountConverter.cpp",
Phil Burk64dce362018-03-28 15:30:39 -0700209 "flowgraph/ClipToRange.cpp",
Robert Wu057f0832021-12-03 20:41:07 +0000210 "flowgraph/FlowGraphNode.cpp",
Robert Wu67375a12022-08-25 22:04:29 +0000211 "flowgraph/Limiter.cpp",
Robert Wu057f0832021-12-03 20:41:07 +0000212 "flowgraph/ManyToMultiConverter.cpp",
Robert Wud7400832021-12-04 01:11:19 +0000213 "flowgraph/MonoBlend.cpp",
Phil Burk64dce362018-03-28 15:30:39 -0700214 "flowgraph/MonoToMultiConverter.cpp",
Robert Wu8393bed2021-12-08 02:08:48 +0000215 "flowgraph/MultiToManyConverter.cpp",
Andy Hunga159e4b2024-03-15 11:48:57 -0700216 "flowgraph/MultiToMonoConverter.cpp",
Phil Burk64dce362018-03-28 15:30:39 -0700217 "flowgraph/RampLinear.cpp",
Robert Wu057f0832021-12-03 20:41:07 +0000218 "flowgraph/SampleRateConverter.cpp",
Phil Burk64dce362018-03-28 15:30:39 -0700219 "flowgraph/SinkFloat.cpp",
Andy Hunga159e4b2024-03-15 11:48:57 -0700220 "flowgraph/SinkI8_24.cpp",
Phil Burk64dce362018-03-28 15:30:39 -0700221 "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",
Andy Hunga159e4b2024-03-15 11:48:57 -0700225 "flowgraph/SourceI8_24.cpp",
Phil Burk64dce362018-03-28 15:30:39 -0700226 "flowgraph/SourceI16.cpp",
227 "flowgraph/SourceI24.cpp",
Phil Burk04e805b2018-03-27 09:13:53 -0700228 "flowgraph/SourceI32.cpp",
Robert Wu057f0832021-12-03 20:41:07 +0000229 "flowgraph/resampler/IntegerRatio.cpp",
230 "flowgraph/resampler/LinearResampler.cpp",
231 "flowgraph/resampler/MultiChannelResampler.cpp",
232 "flowgraph/resampler/PolyphaseResampler.cpp",
233 "flowgraph/resampler/PolyphaseResamplerMono.cpp",
234 "flowgraph/resampler/PolyphaseResamplerStereo.cpp",
235 "flowgraph/resampler/SincResampler.cpp",
236 "flowgraph/resampler/SincResamplerStereo.cpp",
Andy Hunga159e4b2024-03-15 11:48:57 -0700237 "legacy/AudioStreamLegacy.cpp",
238 "legacy/AudioStreamRecord.cpp",
239 "legacy/AudioStreamTrack.cpp",
240 "utility/AAudioUtilities.cpp",
241 "utility/FixedBlockAdapter.cpp",
242 "utility/FixedBlockReader.cpp",
243 "utility/FixedBlockWriter.cpp",
Dan Willemsenb44c69e2017-10-23 17:15:03 -0700244 ],
Cindy Zhou30ed5942019-10-30 13:24:37 -0700245 sanitize: {
246 integer_overflow: true,
247 misc_undefined: ["bounds"],
Cindy Zhou30ed5942019-10-30 13:24:37 -0700248 },
jiabind5bd06a2021-04-27 22:04:08 +0000249
250 tidy: true,
251 tidy_checks: tidy_errors,
252 tidy_checks_as_errors: tidy_errors,
253 tidy_flags: [
254 "-format-style=file",
Ronish Kaliab5dd44b2024-02-14 14:32:32 +0000255 ],
Dan Willemsenb44c69e2017-10-23 17:15:03 -0700256}
Ytai Ben-Tsvi0412f732020-08-17 14:43:36 -0700257
258aidl_interface {
259 name: "aaudio-aidl",
260 unstable: true,
261 local_include_dir: "binding/aidl",
Shunkai Yao49bc61f2023-10-10 19:31:10 +0000262 defaults: [
263 "latest_android_media_audio_common_types_import_interface",
264 ],
Ytai Ben-Tsvi0412f732020-08-17 14:43:36 -0700265 srcs: [
Ytai Ben-Tsvic5f45872020-08-18 10:39:44 -0700266 "binding/aidl/aaudio/Endpoint.aidl",
Andy Hunga159e4b2024-03-15 11:48:57 -0700267 "binding/aidl/aaudio/IAAudioClient.aidl",
268 "binding/aidl/aaudio/IAAudioService.aidl",
Ytai Ben-Tsvic5f45872020-08-18 10:39:44 -0700269 "binding/aidl/aaudio/RingBuffer.aidl",
270 "binding/aidl/aaudio/SharedRegion.aidl",
271 "binding/aidl/aaudio/StreamParameters.aidl",
272 "binding/aidl/aaudio/StreamRequest.aidl",
Ytai Ben-Tsvi0412f732020-08-17 14:43:36 -0700273 ],
Ytai Ben-Tsvic5f45872020-08-18 10:39:44 -0700274 imports: [
Mikhail Naganovc10572e2021-05-21 17:42:02 -0700275 "audioclient-types-aidl",
Svet Ganov3e5f14f2021-05-13 22:51:08 +0000276 "framework-permission-aidl",
Andy Hunga159e4b2024-03-15 11:48:57 -0700277 "shared-file-region-aidl",
Ytai Ben-Tsvic5f45872020-08-18 10:39:44 -0700278 ],
Ronish Kaliab5dd44b2024-02-14 14:32:32 +0000279 backend: {
Ytai Ben-Tsvic5f45872020-08-18 10:39:44 -0700280 java: {
Ytai Ben-Tsvi71151352021-03-10 16:29:01 -0800281 sdk_version: "module_current",
Ytai Ben-Tsvic5f45872020-08-18 10:39:44 -0700282 },
283 },
Ytai Ben-Tsvi0412f732020-08-17 14:43:36 -0700284}