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 | |
jiabin | d5bd06a | 2021-04-27 22:04:08 +0000 | [diff] [blame] | 60 | "-google-build-using-namespace", // Reenable and fix later. |
| 61 | "-google-global-names-in-headers", // found in several files |
Andy Hung | a159e4b | 2024-03-15 11:48:57 -0700 | [diff] [blame^] | 62 | "-google-readability-casting", // C++ casts not always necessary and may be verbose |
| 63 | "-google-readability-todo", // do not require TODO(info) |
jiabin | d5bd06a | 2021-04-27 22:04:08 +0000 | [diff] [blame] | 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: [ |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 93 | "-Wall", |
| 94 | "-Werror", |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 95 | // By default, all symbols are hidden. |
Andy Hung | a159e4b | 2024-03-15 11:48:57 -0700 | [diff] [blame^] | 96 | |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 97 | // "-fvisibility=hidden", |
| 98 | // AAUDIO_API is used to explicitly export a function or a variable as a visible symbol. |
Andy Hung | a159e4b | 2024-03-15 11:48:57 -0700 | [diff] [blame^] | 99 | "-Wno-unused-parameter", |
| 100 | "-Wthread-safety", |
| 101 | |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 102 | "-DAAUDIO_API=__attribute__((visibility(\"default\")))", |
| 103 | ], |
| 104 | |
| 105 | shared_libs: [ |
Andy Hung | a159e4b | 2024-03-15 11:48:57 -0700 | [diff] [blame^] | 106 | "framework-permission-aidl-cpp", |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 107 | "libaaudio_internal", |
| 108 | "libaudioclient", |
| 109 | "libaudioutils", |
Andy Hung | a159e4b | 2024-03-15 11:48:57 -0700 | [diff] [blame^] | 110 | "libbinder", |
| 111 | "libcutils", |
| 112 | "liblog", |
Phil Burk | a987670 | 2020-04-20 18:16:15 -0700 | [diff] [blame] | 113 | "libmedia_helper", |
| 114 | "libmediametrics", |
| 115 | "libmediautils", |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 116 | "libutils", |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 117 | ], |
Cindy Zhou | 30ed594 | 2019-10-30 13:24:37 -0700 | [diff] [blame] | 118 | |
| 119 | sanitize: { |
| 120 | integer_overflow: true, |
| 121 | misc_undefined: ["bounds"], |
Cindy Zhou | 30ed594 | 2019-10-30 13:24:37 -0700 | [diff] [blame] | 122 | }, |
| 123 | |
Zach Johnson | 99c47ff | 2019-12-02 15:28:34 -0800 | [diff] [blame] | 124 | stubs: { |
| 125 | symbol_file: "libaaudio.map.txt", |
| 126 | versions: ["28"], |
| 127 | }, |
jiabin | d5bd06a | 2021-04-27 22:04:08 +0000 | [diff] [blame] | 128 | |
| 129 | tidy: true, |
| 130 | tidy_checks: tidy_errors, |
| 131 | tidy_checks_as_errors: tidy_errors, |
| 132 | tidy_flags: [ |
| 133 | "-format-style=file", |
Ronish Kalia | b5dd44b | 2024-02-14 14:32:32 +0000 | [diff] [blame] | 134 | ], |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 135 | } |
| 136 | |
| 137 | cc_library { |
| 138 | name: "libaaudio_internal", |
| 139 | |
Lorena Torres-Huerta | 03112f6 | 2022-08-12 23:08:12 +0000 | [diff] [blame] | 140 | defaults: [ |
| 141 | "latest_android_media_audio_common_types_cpp_shared", |
| 142 | ], |
| 143 | |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 144 | local_include_dirs: [ |
| 145 | "binding", |
| 146 | "client", |
| 147 | "core", |
| 148 | "fifo", |
| 149 | "legacy", |
| 150 | "utility", |
| 151 | ], |
| 152 | |
| 153 | export_include_dirs: ["."], |
Marco Nelissen | 6b28594 | 2019-10-21 14:52:30 -0700 | [diff] [blame] | 154 | header_libs: [ |
| 155 | "libaaudio_headers", |
Cindy Zhou | 30ed594 | 2019-10-30 13:24:37 -0700 | [diff] [blame] | 156 | "libmedia_headers", |
Marco Nelissen | 7c96ea7 | 2020-01-10 15:46:22 -0800 | [diff] [blame] | 157 | "libmediametrics_headers", |
Marco Nelissen | 6b28594 | 2019-10-21 14:52:30 -0700 | [diff] [blame] | 158 | ], |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 159 | export_header_lib_headers: ["libaaudio_headers"], |
| 160 | |
Philip P. Moltmann | bda4575 | 2020-07-17 16:41:18 -0700 | [diff] [blame] | 161 | export_shared_lib_headers: [ |
Svet Ganov | 3e5f14f | 2021-05-13 22:51:08 +0000 | [diff] [blame] | 162 | "framework-permission-aidl-cpp", |
Philip P. Moltmann | bda4575 | 2020-07-17 16:41:18 -0700 | [diff] [blame] | 163 | ], |
| 164 | |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 165 | shared_libs: [ |
Andy Hung | a159e4b | 2024-03-15 11:48:57 -0700 | [diff] [blame^] | 166 | "aaudio-aidl-cpp", |
| 167 | "audioclient-types-aidl-cpp", |
| 168 | "com.android.media.aaudio-aconfig-cc", |
| 169 | "framework-permission-aidl-cpp", |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 170 | "libaudioclient", |
Andy Hung | a159e4b | 2024-03-15 11:48:57 -0700 | [diff] [blame^] | 171 | "libaudioclient_aidl_conversion", |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 172 | "libaudioutils", |
Andy Hung | a159e4b | 2024-03-15 11:48:57 -0700 | [diff] [blame^] | 173 | "libbinder", |
| 174 | "libcutils", |
| 175 | "liblog", |
Phil Burk | a987670 | 2020-04-20 18:16:15 -0700 | [diff] [blame] | 176 | "libmedia_helper", |
| 177 | "libmediametrics", |
| 178 | "libmediautils", |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 179 | "libutils", |
Philip P. Moltmann | bda4575 | 2020-07-17 16:41:18 -0700 | [diff] [blame] | 180 | ], |
| 181 | |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 182 | cflags: [ |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 183 | "-Wall", |
| 184 | "-Werror", |
Andy Hung | a159e4b | 2024-03-15 11:48:57 -0700 | [diff] [blame^] | 185 | "-Wno-unused-parameter", |
dimitry | d81a84a | 2019-07-17 13:55:16 +0200 | [diff] [blame] | 186 | ], |
| 187 | |
| 188 | srcs: [ |
Andy Hung | a159e4b | 2024-03-15 11:48:57 -0700 | [diff] [blame^] | 189 | "binding/AAudioBinderAdapter.cpp", |
| 190 | "binding/AAudioBinderClient.cpp", |
| 191 | "binding/AAudioStreamConfiguration.cpp", |
| 192 | "binding/AAudioStreamRequest.cpp", |
| 193 | "binding/AudioEndpointParcelable.cpp", |
| 194 | "binding/RingBufferParcelable.cpp", |
| 195 | "binding/SharedMemoryParcelable.cpp", |
| 196 | "binding/SharedRegionParcelable.cpp", |
Phil Burk | 0127c1b | 2018-03-29 13:48:06 -0700 | [diff] [blame] | 197 | "client/AAudioFlowGraph.cpp", |
Dan Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 198 | "client/AudioEndpoint.cpp", |
| 199 | "client/AudioStreamInternal.cpp", |
| 200 | "client/AudioStreamInternalCapture.cpp", |
| 201 | "client/AudioStreamInternalPlay.cpp", |
| 202 | "client/IsochronousClockModel.cpp", |
Andy Hung | a159e4b | 2024-03-15 11:48:57 -0700 | [diff] [blame^] | 203 | "core/AAudioStreamParameters.cpp", |
| 204 | "core/AudioGlobal.cpp", |
| 205 | "core/AudioStream.cpp", |
| 206 | "core/AudioStreamBuilder.cpp", |
| 207 | "fifo/FifoBuffer.cpp", |
| 208 | "fifo/FifoControllerBase.cpp", |
Robert Wu | 057f083 | 2021-12-03 20:41:07 +0000 | [diff] [blame] | 209 | "flowgraph/ChannelCountConverter.cpp", |
Phil Burk | 64dce36 | 2018-03-28 15:30:39 -0700 | [diff] [blame] | 210 | "flowgraph/ClipToRange.cpp", |
Robert Wu | 057f083 | 2021-12-03 20:41:07 +0000 | [diff] [blame] | 211 | "flowgraph/FlowGraphNode.cpp", |
Robert Wu | 67375a1 | 2022-08-25 22:04:29 +0000 | [diff] [blame] | 212 | "flowgraph/Limiter.cpp", |
Robert Wu | 057f083 | 2021-12-03 20:41:07 +0000 | [diff] [blame] | 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 | 8393bed | 2021-12-08 02:08:48 +0000 | [diff] [blame] | 216 | "flowgraph/MultiToManyConverter.cpp", |
Andy Hung | a159e4b | 2024-03-15 11:48:57 -0700 | [diff] [blame^] | 217 | "flowgraph/MultiToMonoConverter.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", |
Andy Hung | a159e4b | 2024-03-15 11:48:57 -0700 | [diff] [blame^] | 221 | "flowgraph/SinkI8_24.cpp", |
Phil Burk | 64dce36 | 2018-03-28 15:30:39 -0700 | [diff] [blame] | 222 | "flowgraph/SinkI16.cpp", |
| 223 | "flowgraph/SinkI24.cpp", |
Phil Burk | 04e805b | 2018-03-27 09:13:53 -0700 | [diff] [blame] | 224 | "flowgraph/SinkI32.cpp", |
Phil Burk | 64dce36 | 2018-03-28 15:30:39 -0700 | [diff] [blame] | 225 | "flowgraph/SourceFloat.cpp", |
Andy Hung | a159e4b | 2024-03-15 11:48:57 -0700 | [diff] [blame^] | 226 | "flowgraph/SourceI8_24.cpp", |
Phil Burk | 64dce36 | 2018-03-28 15:30:39 -0700 | [diff] [blame] | 227 | "flowgraph/SourceI16.cpp", |
| 228 | "flowgraph/SourceI24.cpp", |
Phil Burk | 04e805b | 2018-03-27 09:13:53 -0700 | [diff] [blame] | 229 | "flowgraph/SourceI32.cpp", |
Robert Wu | 057f083 | 2021-12-03 20:41:07 +0000 | [diff] [blame] | 230 | "flowgraph/resampler/IntegerRatio.cpp", |
| 231 | "flowgraph/resampler/LinearResampler.cpp", |
| 232 | "flowgraph/resampler/MultiChannelResampler.cpp", |
| 233 | "flowgraph/resampler/PolyphaseResampler.cpp", |
| 234 | "flowgraph/resampler/PolyphaseResamplerMono.cpp", |
| 235 | "flowgraph/resampler/PolyphaseResamplerStereo.cpp", |
| 236 | "flowgraph/resampler/SincResampler.cpp", |
| 237 | "flowgraph/resampler/SincResamplerStereo.cpp", |
Andy Hung | a159e4b | 2024-03-15 11:48:57 -0700 | [diff] [blame^] | 238 | "legacy/AudioStreamLegacy.cpp", |
| 239 | "legacy/AudioStreamRecord.cpp", |
| 240 | "legacy/AudioStreamTrack.cpp", |
| 241 | "utility/AAudioUtilities.cpp", |
| 242 | "utility/FixedBlockAdapter.cpp", |
| 243 | "utility/FixedBlockReader.cpp", |
| 244 | "utility/FixedBlockWriter.cpp", |
Dan Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 245 | ], |
Cindy Zhou | 30ed594 | 2019-10-30 13:24:37 -0700 | [diff] [blame] | 246 | sanitize: { |
| 247 | integer_overflow: true, |
| 248 | misc_undefined: ["bounds"], |
Cindy Zhou | 30ed594 | 2019-10-30 13:24:37 -0700 | [diff] [blame] | 249 | }, |
jiabin | d5bd06a | 2021-04-27 22:04:08 +0000 | [diff] [blame] | 250 | |
| 251 | tidy: true, |
| 252 | tidy_checks: tidy_errors, |
| 253 | tidy_checks_as_errors: tidy_errors, |
| 254 | tidy_flags: [ |
| 255 | "-format-style=file", |
Ronish Kalia | b5dd44b | 2024-02-14 14:32:32 +0000 | [diff] [blame] | 256 | ], |
Dan Willemsen | b44c69e | 2017-10-23 17:15:03 -0700 | [diff] [blame] | 257 | } |
Ytai Ben-Tsvi | 0412f73 | 2020-08-17 14:43:36 -0700 | [diff] [blame] | 258 | |
| 259 | aidl_interface { |
| 260 | name: "aaudio-aidl", |
| 261 | unstable: true, |
| 262 | local_include_dir: "binding/aidl", |
Shunkai Yao | 49bc61f | 2023-10-10 19:31:10 +0000 | [diff] [blame] | 263 | defaults: [ |
| 264 | "latest_android_media_audio_common_types_import_interface", |
| 265 | ], |
Ytai Ben-Tsvi | 0412f73 | 2020-08-17 14:43:36 -0700 | [diff] [blame] | 266 | srcs: [ |
Ytai Ben-Tsvi | c5f4587 | 2020-08-18 10:39:44 -0700 | [diff] [blame] | 267 | "binding/aidl/aaudio/Endpoint.aidl", |
Andy Hung | a159e4b | 2024-03-15 11:48:57 -0700 | [diff] [blame^] | 268 | "binding/aidl/aaudio/IAAudioClient.aidl", |
| 269 | "binding/aidl/aaudio/IAAudioService.aidl", |
Ytai Ben-Tsvi | c5f4587 | 2020-08-18 10:39:44 -0700 | [diff] [blame] | 270 | "binding/aidl/aaudio/RingBuffer.aidl", |
| 271 | "binding/aidl/aaudio/SharedRegion.aidl", |
| 272 | "binding/aidl/aaudio/StreamParameters.aidl", |
| 273 | "binding/aidl/aaudio/StreamRequest.aidl", |
Ytai Ben-Tsvi | 0412f73 | 2020-08-17 14:43:36 -0700 | [diff] [blame] | 274 | ], |
Ytai Ben-Tsvi | c5f4587 | 2020-08-18 10:39:44 -0700 | [diff] [blame] | 275 | imports: [ |
Mikhail Naganov | c10572e | 2021-05-21 17:42:02 -0700 | [diff] [blame] | 276 | "audioclient-types-aidl", |
Svet Ganov | 3e5f14f | 2021-05-13 22:51:08 +0000 | [diff] [blame] | 277 | "framework-permission-aidl", |
Andy Hung | a159e4b | 2024-03-15 11:48:57 -0700 | [diff] [blame^] | 278 | "shared-file-region-aidl", |
Ytai Ben-Tsvi | c5f4587 | 2020-08-18 10:39:44 -0700 | [diff] [blame] | 279 | ], |
Ronish Kalia | b5dd44b | 2024-02-14 14:32:32 +0000 | [diff] [blame] | 280 | backend: { |
Ytai Ben-Tsvi | c5f4587 | 2020-08-18 10:39:44 -0700 | [diff] [blame] | 281 | java: { |
Ytai Ben-Tsvi | 7115135 | 2021-03-10 16:29:01 -0800 | [diff] [blame] | 282 | sdk_version: "module_current", |
Ytai Ben-Tsvi | c5f4587 | 2020-08-18 10:39:44 -0700 | [diff] [blame] | 283 | }, |
| 284 | }, |
Ytai Ben-Tsvi | 0412f73 | 2020-08-17 14:43:36 -0700 | [diff] [blame] | 285 | } |