Bob Badour | 56786ac | 2021-02-25 15:24:36 -0800 | [diff] [blame] | 1 | package { |
| 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 | |
jiabin | d5bd06a | 2021-04-27 22:04:08 +0000 | [diff] [blame] | 10 | tidy_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 Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 69 | cc_library { |
| 70 | name: "libaaudio", |
| 71 | |
| 72 | local_include_dirs: [ |
| 73 | "binding", |
| 74 | "client", |
| 75 | "core", |
| 76 | "fifo", |
Phil Burk | 64dce36 | 2018-03-28 15:30:39 -0700 | [diff] [blame] | 77 | "flowgraph", |
Dan Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 78 | "legacy", |
| 79 | "utility", |
| 80 | ], |
Marco Nelissen | 6b28594 | 2019-10-21 14:52:30 -0700 | [diff] [blame] | 81 | header_libs: [ |
| 82 | "libaaudio_headers", |
| 83 | ], |
Dan Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 84 | export_header_lib_headers: ["libaaudio_headers"], |
dimitry | 8e8a968 | 2019-06-04 15:14:02 +0200 | [diff] [blame] | 85 | version_script: "libaaudio.map.txt", |
Dan Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 86 | |
| 87 | srcs: [ |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 88 | "core/AAudioAudio.cpp", |
| 89 | ], |
| 90 | |
| 91 | cflags: [ |
Phil Burk | 0bd745e | 2020-10-17 18:20:01 +0000 | [diff] [blame] | 92 | "-Wthread-safety", |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 93 | "-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 Burk | a987670 | 2020-04-20 18:16:15 -0700 | [diff] [blame] | 107 | "libmedia_helper", |
| 108 | "libmediametrics", |
| 109 | "libmediautils", |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 110 | "liblog", |
| 111 | "libcutils", |
| 112 | "libutils", |
| 113 | "libbinder", |
Svet Ganov | 3e5f14f | 2021-05-13 22:51:08 +0000 | [diff] [blame] | 114 | "framework-permission-aidl-cpp", |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 115 | ], |
Cindy Zhou | 30ed594 | 2019-10-30 13:24:37 -0700 | [diff] [blame] | 116 | |
| 117 | sanitize: { |
| 118 | integer_overflow: true, |
| 119 | misc_undefined: ["bounds"], |
Cindy Zhou | 30ed594 | 2019-10-30 13:24:37 -0700 | [diff] [blame] | 120 | }, |
| 121 | |
Zach Johnson | 99c47ff | 2019-12-02 15:28:34 -0800 | [diff] [blame] | 122 | stubs: { |
| 123 | symbol_file: "libaaudio.map.txt", |
| 124 | versions: ["28"], |
| 125 | }, |
jiabin | d5bd06a | 2021-04-27 22:04:08 +0000 | [diff] [blame] | 126 | |
| 127 | tidy: true, |
| 128 | tidy_checks: tidy_errors, |
| 129 | tidy_checks_as_errors: tidy_errors, |
| 130 | tidy_flags: [ |
| 131 | "-format-style=file", |
| 132 | ] |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 133 | } |
| 134 | |
| 135 | cc_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 Nelissen | 6b28594 | 2019-10-21 14:52:30 -0700 | [diff] [blame] | 148 | header_libs: [ |
| 149 | "libaaudio_headers", |
Cindy Zhou | 30ed594 | 2019-10-30 13:24:37 -0700 | [diff] [blame] | 150 | "libmedia_headers", |
Marco Nelissen | 7c96ea7 | 2020-01-10 15:46:22 -0800 | [diff] [blame] | 151 | "libmediametrics_headers", |
Marco Nelissen | 6b28594 | 2019-10-21 14:52:30 -0700 | [diff] [blame] | 152 | ], |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 153 | export_header_lib_headers: ["libaaudio_headers"], |
| 154 | |
Philip P. Moltmann | bda4575 | 2020-07-17 16:41:18 -0700 | [diff] [blame] | 155 | export_shared_lib_headers: [ |
Svet Ganov | 3e5f14f | 2021-05-13 22:51:08 +0000 | [diff] [blame] | 156 | "framework-permission-aidl-cpp", |
Philip P. Moltmann | bda4575 | 2020-07-17 16:41:18 -0700 | [diff] [blame] | 157 | ], |
| 158 | |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 159 | shared_libs: [ |
| 160 | "libaudioclient", |
| 161 | "libaudioutils", |
Phil Burk | a987670 | 2020-04-20 18:16:15 -0700 | [diff] [blame] | 162 | "libmedia_helper", |
| 163 | "libmediametrics", |
| 164 | "libmediautils", |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 165 | "liblog", |
| 166 | "libcutils", |
| 167 | "libutils", |
| 168 | "libbinder", |
Svet Ganov | 3e5f14f | 2021-05-13 22:51:08 +0000 | [diff] [blame] | 169 | "framework-permission-aidl-cpp", |
Ytai Ben-Tsvi | 0412f73 | 2020-08-17 14:43:36 -0700 | [diff] [blame] | 170 | "aaudio-aidl-cpp", |
Mikhail Naganov | 57bd06f | 2021-08-10 16:41:54 -0700 | [diff] [blame] | 171 | "android.media.audio.common.types-V1-cpp", |
Mikhail Naganov | b60bd1b | 2021-07-15 17:31:43 -0700 | [diff] [blame] | 172 | "audioclient-types-aidl-cpp", |
Philip P. Moltmann | bda4575 | 2020-07-17 16:41:18 -0700 | [diff] [blame] | 173 | "libaudioclient_aidl_conversion", |
| 174 | ], |
| 175 | |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 176 | cflags: [ |
| 177 | "-Wno-unused-parameter", |
| 178 | "-Wall", |
| 179 | "-Werror", |
| 180 | ], |
| 181 | |
| 182 | srcs: [ |
| 183 | "core/AudioGlobal.cpp", |
Dan Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 184 | "core/AudioStream.cpp", |
| 185 | "core/AudioStreamBuilder.cpp", |
Dan Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 186 | "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 Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 194 | "fifo/FifoBuffer.cpp", |
| 195 | "fifo/FifoControllerBase.cpp", |
Phil Burk | 0127c1b | 2018-03-29 13:48:06 -0700 | [diff] [blame] | 196 | "client/AAudioFlowGraph.cpp", |
Dan Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 197 | "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-Tsvi | 734e350 | 2020-08-24 14:57:36 -0700 | [diff] [blame] | 203 | "binding/AAudioBinderAdapter.cpp", |
Dan Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 204 | "binding/AAudioBinderClient.cpp", |
| 205 | "binding/AAudioStreamRequest.cpp", |
| 206 | "binding/AAudioStreamConfiguration.cpp", |
Dan Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 207 | "binding/RingBufferParcelable.cpp", |
| 208 | "binding/SharedMemoryParcelable.cpp", |
| 209 | "binding/SharedRegionParcelable.cpp", |
Robert Wu | 057f083 | 2021-12-03 20:41:07 +0000 | [diff] [blame] | 210 | "flowgraph/ChannelCountConverter.cpp", |
Phil Burk | 64dce36 | 2018-03-28 15:30:39 -0700 | [diff] [blame] | 211 | "flowgraph/ClipToRange.cpp", |
Robert Wu | 057f083 | 2021-12-03 20:41:07 +0000 | [diff] [blame] | 212 | "flowgraph/FlowGraphNode.cpp", |
| 213 | "flowgraph/ManyToMultiConverter.cpp", |
Robert Wu | d740083 | 2021-12-04 01:11:19 +0000 | [diff] [blame] | 214 | "flowgraph/MonoBlend.cpp", |
Phil Burk | 64dce36 | 2018-03-28 15:30:39 -0700 | [diff] [blame] | 215 | "flowgraph/MonoToMultiConverter.cpp", |
Robert Wu | 057f083 | 2021-12-03 20:41:07 +0000 | [diff] [blame] | 216 | "flowgraph/MultiToMonoConverter.cpp", |
Robert Wu | 8393bed | 2021-12-08 02:08:48 +0000 | [diff] [blame^] | 217 | "flowgraph/MultiToManyConverter.cpp", |
Phil Burk | 64dce36 | 2018-03-28 15:30:39 -0700 | [diff] [blame] | 218 | "flowgraph/RampLinear.cpp", |
Robert Wu | 057f083 | 2021-12-03 20:41:07 +0000 | [diff] [blame] | 219 | "flowgraph/SampleRateConverter.cpp", |
Phil Burk | 64dce36 | 2018-03-28 15:30:39 -0700 | [diff] [blame] | 220 | "flowgraph/SinkFloat.cpp", |
| 221 | "flowgraph/SinkI16.cpp", |
| 222 | "flowgraph/SinkI24.cpp", |
Phil Burk | 04e805b | 2018-03-27 09:13:53 -0700 | [diff] [blame] | 223 | "flowgraph/SinkI32.cpp", |
Phil Burk | 64dce36 | 2018-03-28 15:30:39 -0700 | [diff] [blame] | 224 | "flowgraph/SourceFloat.cpp", |
| 225 | "flowgraph/SourceI16.cpp", |
| 226 | "flowgraph/SourceI24.cpp", |
Phil Burk | 04e805b | 2018-03-27 09:13:53 -0700 | [diff] [blame] | 227 | "flowgraph/SourceI32.cpp", |
Robert Wu | 057f083 | 2021-12-03 20:41:07 +0000 | [diff] [blame] | 228 | "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 Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 236 | ], |
Cindy Zhou | 30ed594 | 2019-10-30 13:24:37 -0700 | [diff] [blame] | 237 | sanitize: { |
| 238 | integer_overflow: true, |
| 239 | misc_undefined: ["bounds"], |
Cindy Zhou | 30ed594 | 2019-10-30 13:24:37 -0700 | [diff] [blame] | 240 | }, |
jiabin | d5bd06a | 2021-04-27 22:04:08 +0000 | [diff] [blame] | 241 | |
| 242 | tidy: true, |
| 243 | tidy_checks: tidy_errors, |
| 244 | tidy_checks_as_errors: tidy_errors, |
| 245 | tidy_flags: [ |
| 246 | "-format-style=file", |
| 247 | ] |
Dan Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 248 | } |
Ytai Ben-Tsvi | 0412f73 | 2020-08-17 14:43:36 -0700 | [diff] [blame] | 249 | |
| 250 | aidl_interface { |
| 251 | name: "aaudio-aidl", |
| 252 | unstable: true, |
| 253 | local_include_dir: "binding/aidl", |
| 254 | srcs: [ |
Ytai Ben-Tsvi | c5f4587 | 2020-08-18 10:39:44 -0700 | [diff] [blame] | 255 | "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-Tsvi | 0412f73 | 2020-08-17 14:43:36 -0700 | [diff] [blame] | 260 | "binding/aidl/aaudio/IAAudioClient.aidl", |
Ytai Ben-Tsvi | c5f4587 | 2020-08-18 10:39:44 -0700 | [diff] [blame] | 261 | "binding/aidl/aaudio/IAAudioService.aidl", |
Ytai Ben-Tsvi | 0412f73 | 2020-08-17 14:43:36 -0700 | [diff] [blame] | 262 | ], |
Ytai Ben-Tsvi | c5f4587 | 2020-08-18 10:39:44 -0700 | [diff] [blame] | 263 | imports: [ |
Mikhail Naganov | 57bd06f | 2021-08-10 16:41:54 -0700 | [diff] [blame] | 264 | "android.media.audio.common.types", |
Mikhail Naganov | c10572e | 2021-05-21 17:42:02 -0700 | [diff] [blame] | 265 | "audioclient-types-aidl", |
Ytai Ben-Tsvi | c5f4587 | 2020-08-18 10:39:44 -0700 | [diff] [blame] | 266 | "shared-file-region-aidl", |
Svet Ganov | 3e5f14f | 2021-05-13 22:51:08 +0000 | [diff] [blame] | 267 | "framework-permission-aidl", |
Ytai Ben-Tsvi | c5f4587 | 2020-08-18 10:39:44 -0700 | [diff] [blame] | 268 | ], |
| 269 | backend: |
| 270 | { |
Ytai Ben-Tsvi | c5f4587 | 2020-08-18 10:39:44 -0700 | [diff] [blame] | 271 | java: { |
Ytai Ben-Tsvi | 7115135 | 2021-03-10 16:29:01 -0800 | [diff] [blame] | 272 | sdk_version: "module_current", |
Ytai Ben-Tsvi | c5f4587 | 2020-08-18 10:39:44 -0700 | [diff] [blame] | 273 | }, |
| 274 | }, |
Ytai Ben-Tsvi | 0412f73 | 2020-08-17 14:43:36 -0700 | [diff] [blame] | 275 | } |