Bob Badour | 56786ac | 2021-02-25 15:24:36 -0800 | [diff] [blame] | 1 | package { |
Ronish Kalia | b5dd44b | 2024-02-14 14:32:32 +0000 | [diff] [blame^] | 2 | default_team: "trendy_team_media_framework_audio", |
Bob Badour | 56786ac | 2021-02-25 15:24:36 -0800 | [diff] [blame] | 3 | // 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 | |
jiabin | d5bd06a | 2021-04-27 22:04:08 +0000 | [diff] [blame] | 11 | tidy_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", |
jiabin | 8ecf633 | 2023-12-05 18:51:29 +0000 | [diff] [blame] | 45 | "modernize-use-nodiscard", |
jiabin | d5bd06a | 2021-04-27 22:04:08 +0000 | [diff] [blame] | 46 | "modernize-use-noexcept", |
| 47 | "modernize-use-nullptr", |
jiabin | 8ecf633 | 2023-12-05 18:51:29 +0000 | [diff] [blame] | 48 | "modernize-use-override", |
jiabin | d5bd06a | 2021-04-27 22:04:08 +0000 | [diff] [blame] | 49 | // "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 | |
| 60 | "-google-readability-casting", // C++ casts not always necessary and may be verbose |
| 61 | "-google-readability-todo", // do not require TODO(info) |
| 62 | "-google-build-using-namespace", // Reenable and fix later. |
| 63 | "-google-global-names-in-headers", // found in several files |
| 64 | |
| 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 Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 70 | cc_library { |
| 71 | name: "libaaudio", |
| 72 | |
| 73 | local_include_dirs: [ |
| 74 | "binding", |
| 75 | "client", |
| 76 | "core", |
| 77 | "fifo", |
Phil Burk | 64dce36 | 2018-03-28 15:30:39 -0700 | [diff] [blame] | 78 | "flowgraph", |
Dan Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 79 | "legacy", |
| 80 | "utility", |
| 81 | ], |
Marco Nelissen | 6b28594 | 2019-10-21 14:52:30 -0700 | [diff] [blame] | 82 | header_libs: [ |
| 83 | "libaaudio_headers", |
| 84 | ], |
Dan Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 85 | export_header_lib_headers: ["libaaudio_headers"], |
dimitry | 8e8a968 | 2019-06-04 15:14:02 +0200 | [diff] [blame] | 86 | version_script: "libaaudio.map.txt", |
Dan Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 87 | |
| 88 | srcs: [ |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 89 | "core/AAudioAudio.cpp", |
| 90 | ], |
| 91 | |
| 92 | cflags: [ |
Phil Burk | 0bd745e | 2020-10-17 18:20:01 +0000 | [diff] [blame] | 93 | "-Wthread-safety", |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 94 | "-Wno-unused-parameter", |
| 95 | "-Wall", |
| 96 | "-Werror", |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 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", |
Ronish Kalia | b5dd44b | 2024-02-14 14:32:32 +0000 | [diff] [blame^] | 132 | ], |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 133 | } |
| 134 | |
| 135 | cc_library { |
| 136 | name: "libaaudio_internal", |
| 137 | |
Lorena Torres-Huerta | 03112f6 | 2022-08-12 23:08:12 +0000 | [diff] [blame] | 138 | defaults: [ |
| 139 | "latest_android_media_audio_common_types_cpp_shared", |
| 140 | ], |
| 141 | |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 142 | local_include_dirs: [ |
| 143 | "binding", |
| 144 | "client", |
| 145 | "core", |
| 146 | "fifo", |
| 147 | "legacy", |
| 148 | "utility", |
| 149 | ], |
| 150 | |
| 151 | export_include_dirs: ["."], |
Marco Nelissen | 6b28594 | 2019-10-21 14:52:30 -0700 | [diff] [blame] | 152 | header_libs: [ |
| 153 | "libaaudio_headers", |
Cindy Zhou | 30ed594 | 2019-10-30 13:24:37 -0700 | [diff] [blame] | 154 | "libmedia_headers", |
Marco Nelissen | 7c96ea7 | 2020-01-10 15:46:22 -0800 | [diff] [blame] | 155 | "libmediametrics_headers", |
Marco Nelissen | 6b28594 | 2019-10-21 14:52:30 -0700 | [diff] [blame] | 156 | ], |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 157 | export_header_lib_headers: ["libaaudio_headers"], |
| 158 | |
Philip P. Moltmann | bda4575 | 2020-07-17 16:41:18 -0700 | [diff] [blame] | 159 | export_shared_lib_headers: [ |
Svet Ganov | 3e5f14f | 2021-05-13 22:51:08 +0000 | [diff] [blame] | 160 | "framework-permission-aidl-cpp", |
Philip P. Moltmann | bda4575 | 2020-07-17 16:41:18 -0700 | [diff] [blame] | 161 | ], |
| 162 | |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 163 | shared_libs: [ |
| 164 | "libaudioclient", |
| 165 | "libaudioutils", |
Phil Burk | a987670 | 2020-04-20 18:16:15 -0700 | [diff] [blame] | 166 | "libmedia_helper", |
| 167 | "libmediametrics", |
| 168 | "libmediautils", |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 169 | "liblog", |
| 170 | "libcutils", |
| 171 | "libutils", |
| 172 | "libbinder", |
Svet Ganov | 3e5f14f | 2021-05-13 22:51:08 +0000 | [diff] [blame] | 173 | "framework-permission-aidl-cpp", |
Ytai Ben-Tsvi | 0412f73 | 2020-08-17 14:43:36 -0700 | [diff] [blame] | 174 | "aaudio-aidl-cpp", |
Mikhail Naganov | b60bd1b | 2021-07-15 17:31:43 -0700 | [diff] [blame] | 175 | "audioclient-types-aidl-cpp", |
Philip P. Moltmann | bda4575 | 2020-07-17 16:41:18 -0700 | [diff] [blame] | 176 | "libaudioclient_aidl_conversion", |
Robert Wu | 101ad25 | 2023-11-28 20:29:29 +0000 | [diff] [blame] | 177 | "com.android.media.aaudio-aconfig-cc", |
Philip P. Moltmann | bda4575 | 2020-07-17 16:41:18 -0700 | [diff] [blame] | 178 | ], |
| 179 | |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 180 | cflags: [ |
| 181 | "-Wno-unused-parameter", |
| 182 | "-Wall", |
| 183 | "-Werror", |
| 184 | ], |
| 185 | |
| 186 | srcs: [ |
| 187 | "core/AudioGlobal.cpp", |
Dan Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 188 | "core/AudioStream.cpp", |
| 189 | "core/AudioStreamBuilder.cpp", |
Dan Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 190 | "core/AAudioStreamParameters.cpp", |
| 191 | "legacy/AudioStreamLegacy.cpp", |
| 192 | "legacy/AudioStreamRecord.cpp", |
| 193 | "legacy/AudioStreamTrack.cpp", |
| 194 | "utility/AAudioUtilities.cpp", |
| 195 | "utility/FixedBlockAdapter.cpp", |
| 196 | "utility/FixedBlockReader.cpp", |
| 197 | "utility/FixedBlockWriter.cpp", |
Dan Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 198 | "fifo/FifoBuffer.cpp", |
| 199 | "fifo/FifoControllerBase.cpp", |
Phil Burk | 0127c1b | 2018-03-29 13:48:06 -0700 | [diff] [blame] | 200 | "client/AAudioFlowGraph.cpp", |
Dan Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 201 | "client/AudioEndpoint.cpp", |
| 202 | "client/AudioStreamInternal.cpp", |
| 203 | "client/AudioStreamInternalCapture.cpp", |
| 204 | "client/AudioStreamInternalPlay.cpp", |
| 205 | "client/IsochronousClockModel.cpp", |
| 206 | "binding/AudioEndpointParcelable.cpp", |
Ytai Ben-Tsvi | 734e350 | 2020-08-24 14:57:36 -0700 | [diff] [blame] | 207 | "binding/AAudioBinderAdapter.cpp", |
Dan Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 208 | "binding/AAudioBinderClient.cpp", |
| 209 | "binding/AAudioStreamRequest.cpp", |
| 210 | "binding/AAudioStreamConfiguration.cpp", |
Dan Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 211 | "binding/RingBufferParcelable.cpp", |
| 212 | "binding/SharedMemoryParcelable.cpp", |
| 213 | "binding/SharedRegionParcelable.cpp", |
Robert Wu | 057f083 | 2021-12-03 20:41:07 +0000 | [diff] [blame] | 214 | "flowgraph/ChannelCountConverter.cpp", |
Phil Burk | 64dce36 | 2018-03-28 15:30:39 -0700 | [diff] [blame] | 215 | "flowgraph/ClipToRange.cpp", |
Robert Wu | 057f083 | 2021-12-03 20:41:07 +0000 | [diff] [blame] | 216 | "flowgraph/FlowGraphNode.cpp", |
Robert Wu | 67375a1 | 2022-08-25 22:04:29 +0000 | [diff] [blame] | 217 | "flowgraph/Limiter.cpp", |
Robert Wu | 057f083 | 2021-12-03 20:41:07 +0000 | [diff] [blame] | 218 | "flowgraph/ManyToMultiConverter.cpp", |
Robert Wu | d740083 | 2021-12-04 01:11:19 +0000 | [diff] [blame] | 219 | "flowgraph/MonoBlend.cpp", |
Phil Burk | 64dce36 | 2018-03-28 15:30:39 -0700 | [diff] [blame] | 220 | "flowgraph/MonoToMultiConverter.cpp", |
Robert Wu | 057f083 | 2021-12-03 20:41:07 +0000 | [diff] [blame] | 221 | "flowgraph/MultiToMonoConverter.cpp", |
Robert Wu | 8393bed | 2021-12-08 02:08:48 +0000 | [diff] [blame] | 222 | "flowgraph/MultiToManyConverter.cpp", |
Phil Burk | 64dce36 | 2018-03-28 15:30:39 -0700 | [diff] [blame] | 223 | "flowgraph/RampLinear.cpp", |
Robert Wu | 057f083 | 2021-12-03 20:41:07 +0000 | [diff] [blame] | 224 | "flowgraph/SampleRateConverter.cpp", |
Phil Burk | 64dce36 | 2018-03-28 15:30:39 -0700 | [diff] [blame] | 225 | "flowgraph/SinkFloat.cpp", |
| 226 | "flowgraph/SinkI16.cpp", |
| 227 | "flowgraph/SinkI24.cpp", |
Phil Burk | 04e805b | 2018-03-27 09:13:53 -0700 | [diff] [blame] | 228 | "flowgraph/SinkI32.cpp", |
Robert Wu | c59b4c9 | 2023-11-30 02:10:29 +0000 | [diff] [blame] | 229 | "flowgraph/SinkI8_24.cpp", |
Phil Burk | 64dce36 | 2018-03-28 15:30:39 -0700 | [diff] [blame] | 230 | "flowgraph/SourceFloat.cpp", |
| 231 | "flowgraph/SourceI16.cpp", |
| 232 | "flowgraph/SourceI24.cpp", |
Phil Burk | 04e805b | 2018-03-27 09:13:53 -0700 | [diff] [blame] | 233 | "flowgraph/SourceI32.cpp", |
Robert Wu | c59b4c9 | 2023-11-30 02:10:29 +0000 | [diff] [blame] | 234 | "flowgraph/SourceI8_24.cpp", |
Robert Wu | 057f083 | 2021-12-03 20:41:07 +0000 | [diff] [blame] | 235 | "flowgraph/resampler/IntegerRatio.cpp", |
| 236 | "flowgraph/resampler/LinearResampler.cpp", |
| 237 | "flowgraph/resampler/MultiChannelResampler.cpp", |
| 238 | "flowgraph/resampler/PolyphaseResampler.cpp", |
| 239 | "flowgraph/resampler/PolyphaseResamplerMono.cpp", |
| 240 | "flowgraph/resampler/PolyphaseResamplerStereo.cpp", |
| 241 | "flowgraph/resampler/SincResampler.cpp", |
| 242 | "flowgraph/resampler/SincResamplerStereo.cpp", |
Dan Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 243 | ], |
Cindy Zhou | 30ed594 | 2019-10-30 13:24:37 -0700 | [diff] [blame] | 244 | sanitize: { |
| 245 | integer_overflow: true, |
| 246 | misc_undefined: ["bounds"], |
Cindy Zhou | 30ed594 | 2019-10-30 13:24:37 -0700 | [diff] [blame] | 247 | }, |
jiabin | d5bd06a | 2021-04-27 22:04:08 +0000 | [diff] [blame] | 248 | |
| 249 | tidy: true, |
| 250 | tidy_checks: tidy_errors, |
| 251 | tidy_checks_as_errors: tidy_errors, |
| 252 | tidy_flags: [ |
| 253 | "-format-style=file", |
Ronish Kalia | b5dd44b | 2024-02-14 14:32:32 +0000 | [diff] [blame^] | 254 | ], |
Dan Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 255 | } |
Ytai Ben-Tsvi | 0412f73 | 2020-08-17 14:43:36 -0700 | [diff] [blame] | 256 | |
| 257 | aidl_interface { |
| 258 | name: "aaudio-aidl", |
| 259 | unstable: true, |
| 260 | local_include_dir: "binding/aidl", |
Shunkai Yao | 49bc61f | 2023-10-10 19:31:10 +0000 | [diff] [blame] | 261 | defaults: [ |
| 262 | "latest_android_media_audio_common_types_import_interface", |
| 263 | ], |
Ytai Ben-Tsvi | 0412f73 | 2020-08-17 14:43:36 -0700 | [diff] [blame] | 264 | srcs: [ |
Ytai Ben-Tsvi | c5f4587 | 2020-08-18 10:39:44 -0700 | [diff] [blame] | 265 | "binding/aidl/aaudio/Endpoint.aidl", |
| 266 | "binding/aidl/aaudio/RingBuffer.aidl", |
| 267 | "binding/aidl/aaudio/SharedRegion.aidl", |
| 268 | "binding/aidl/aaudio/StreamParameters.aidl", |
| 269 | "binding/aidl/aaudio/StreamRequest.aidl", |
Ytai Ben-Tsvi | 0412f73 | 2020-08-17 14:43:36 -0700 | [diff] [blame] | 270 | "binding/aidl/aaudio/IAAudioClient.aidl", |
Ytai Ben-Tsvi | c5f4587 | 2020-08-18 10:39:44 -0700 | [diff] [blame] | 271 | "binding/aidl/aaudio/IAAudioService.aidl", |
Ytai Ben-Tsvi | 0412f73 | 2020-08-17 14:43:36 -0700 | [diff] [blame] | 272 | ], |
Ytai Ben-Tsvi | c5f4587 | 2020-08-18 10:39:44 -0700 | [diff] [blame] | 273 | imports: [ |
Mikhail Naganov | c10572e | 2021-05-21 17:42:02 -0700 | [diff] [blame] | 274 | "audioclient-types-aidl", |
Ytai Ben-Tsvi | c5f4587 | 2020-08-18 10:39:44 -0700 | [diff] [blame] | 275 | "shared-file-region-aidl", |
Svet Ganov | 3e5f14f | 2021-05-13 22:51:08 +0000 | [diff] [blame] | 276 | "framework-permission-aidl", |
Ytai Ben-Tsvi | c5f4587 | 2020-08-18 10:39:44 -0700 | [diff] [blame] | 277 | ], |
Ronish Kalia | b5dd44b | 2024-02-14 14:32:32 +0000 | [diff] [blame^] | 278 | backend: { |
Ytai Ben-Tsvi | c5f4587 | 2020-08-18 10:39:44 -0700 | [diff] [blame] | 279 | java: { |
Ytai Ben-Tsvi | 7115135 | 2021-03-10 16:29:01 -0800 | [diff] [blame] | 280 | sdk_version: "module_current", |
Ytai Ben-Tsvi | c5f4587 | 2020-08-18 10:39:44 -0700 | [diff] [blame] | 281 | }, |
| 282 | }, |
Ytai Ben-Tsvi | 0412f73 | 2020-08-17 14:43:36 -0700 | [diff] [blame] | 283 | } |