| Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 1 | // Media Statistics service |
| 2 | // |
| 3 | |
| Bob Badour | 948e6aa | 2021-02-12 21:02:31 -0800 | [diff] [blame] | 4 | package { |
| 5 | // See: http://go/android-license-faq |
| 6 | // A large-scale-change added 'default_applicable_licenses' to import |
| 7 | // all of the 'license_kinds' from "frameworks_av_license" |
| 8 | // to get the below license kinds: |
| 9 | // SPDX-license-identifier-Apache-2.0 |
| 10 | default_applicable_licenses: ["frameworks_av_license"], |
| 11 | } |
| 12 | |
| Andy Hung | 3ab1b32 | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 13 | tidy_errors = [ |
| 14 | // https://clang.llvm.org/extra/clang-tidy/checks/list.html |
| 15 | // For many categories, the checks are too many to specify individually. |
| 16 | // Feel free to disable as needed - as warnings are generally ignored, |
| 17 | // we treat warnings as errors. |
| 18 | "android-*", |
| 19 | "bugprone-*", |
| 20 | "cert-*", |
| 21 | "clang-analyzer-security*", |
| 22 | "google-*", |
| 23 | "misc-*", |
| 24 | //"modernize-*", // explicitly list the modernize as they can be subjective. |
| 25 | "modernize-avoid-bind", |
| 26 | //"modernize-avoid-c-arrays", // std::array<> can be verbose |
| 27 | "modernize-concat-nested-namespaces", |
| 28 | //"modernize-deprecated-headers", // C headers still ok even if there is C++ equivalent. |
| 29 | "modernize-deprecated-ios-base-aliases", |
| 30 | "modernize-loop-convert", |
| 31 | "modernize-make-shared", |
| 32 | "modernize-make-unique", |
| 33 | "modernize-pass-by-value", |
| 34 | "modernize-raw-string-literal", |
| 35 | "modernize-redundant-void-arg", |
| 36 | "modernize-replace-auto-ptr", |
| 37 | "modernize-replace-random-shuffle", |
| 38 | "modernize-return-braced-init-list", |
| 39 | "modernize-shrink-to-fit", |
| 40 | "modernize-unary-static-assert", |
| 41 | "modernize-use-auto", // debatable - auto can obscure type |
| 42 | "modernize-use-bool-literals", |
| 43 | "modernize-use-default-member-init", |
| 44 | "modernize-use-emplace", |
| 45 | "modernize-use-equals-default", |
| 46 | "modernize-use-equals-delete", |
| 47 | "modernize-use-nodiscard", |
| 48 | "modernize-use-noexcept", |
| 49 | "modernize-use-nullptr", |
| 50 | "modernize-use-override", |
| 51 | //"modernize-use-trailing-return-type", // not necessarily more readable |
| 52 | "modernize-use-transparent-functors", |
| 53 | "modernize-use-uncaught-exceptions", |
| 54 | "modernize-use-using", |
| 55 | "performance-*", |
| 56 | |
| 57 | // Remove some pedantic stylistic requirements. |
| 58 | "-google-readability-casting", // C++ casts not always necessary and may be verbose |
| 59 | "-google-readability-todo", // do not require TODO(info) |
| 60 | ] |
| 61 | |
| 62 | cc_defaults { |
| 63 | name: "mediametrics_flags_defaults", |
| 64 | // https://clang.llvm.org/docs/UsersManual.html#command-line-options |
| 65 | // https://clang.llvm.org/docs/DiagnosticsReference.html |
| 66 | cflags: [ |
| 67 | "-Wall", |
| 68 | "-Wdeprecated", |
| 69 | "-Werror", |
| 70 | "-Werror=implicit-fallthrough", |
| 71 | "-Werror=sometimes-uninitialized", |
| 72 | "-Werror=conditional-uninitialized", |
| 73 | "-Wextra", |
| 74 | "-Wredundant-decls", |
| 75 | "-Wshadow", |
| 76 | "-Wstrict-aliasing", |
| 77 | "-fstrict-aliasing", |
| 78 | "-Wthread-safety", |
| 79 | //"-Wthread-safety-negative", // experimental - looks broken in R. |
| 80 | "-Wunreachable-code", |
| 81 | "-Wunreachable-code-break", |
| 82 | "-Wunreachable-code-return", |
| 83 | "-Wunused", |
| 84 | "-Wused-but-marked-unused", |
| 85 | ], |
| 86 | // https://clang.llvm.org/extra/clang-tidy/ |
| 87 | tidy: true, |
| 88 | tidy_checks: tidy_errors, |
| 89 | tidy_checks_as_errors: tidy_errors, |
| 90 | tidy_flags: [ |
| 91 | "-format-style='file'", |
| 92 | "--header-filter='frameworks/av/services/mediametrics/'", |
| 93 | ], |
| 94 | } |
| 95 | |
| Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 96 | cc_binary { |
| 97 | name: "mediametrics", |
| Andy Hung | 3ab1b32 | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 98 | defaults: [ |
| 99 | "mediametrics_flags_defaults", |
| 100 | ], |
| Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 101 | |
| 102 | srcs: [ |
| 103 | "main_mediametrics.cpp", |
| Andy Hung | c89c8dc | 2019-10-16 17:48:21 -0700 | [diff] [blame] | 104 | ], |
| 105 | |
| 106 | shared_libs: [ |
| 107 | "libbinder", |
| 108 | "liblog", |
| Ray Essick | 40e8e5e | 2019-12-05 20:19:40 -0800 | [diff] [blame] | 109 | "libmediametricsservice", |
| Andy Hung | a85efab | 2019-12-23 11:41:29 -0800 | [diff] [blame] | 110 | "libmediautils", |
| Andy Hung | c89c8dc | 2019-10-16 17:48:21 -0700 | [diff] [blame] | 111 | "libutils", |
| 112 | ], |
| Marco Nelissen | 7c96ea7 | 2020-01-10 15:46:22 -0800 | [diff] [blame] | 113 | header_libs: [ |
| Andy Hung | a629bd1 | 2020-06-05 16:03:53 -0700 | [diff] [blame] | 114 | "libaudioutils_headers", |
| Marco Nelissen | 7c96ea7 | 2020-01-10 15:46:22 -0800 | [diff] [blame] | 115 | "libmediametrics_headers", |
| 116 | ], |
| Andy Hung | c89c8dc | 2019-10-16 17:48:21 -0700 | [diff] [blame] | 117 | |
| 118 | init_rc: [ |
| 119 | "mediametrics.rc", |
| 120 | ], |
| Andy Hung | c89c8dc | 2019-10-16 17:48:21 -0700 | [diff] [blame] | 121 | } |
| 122 | |
| Mufaddal Chakera | 1d5f7ed | 2020-10-13 14:09:26 +0530 | [diff] [blame] | 123 | cc_library { |
| Ray Essick | 40e8e5e | 2019-12-05 20:19:40 -0800 | [diff] [blame] | 124 | name: "libmediametricsservice", |
| Andy Hung | 3ab1b32 | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 125 | defaults: [ |
| 126 | "mediametrics_flags_defaults", |
| 127 | ], |
| Andy Hung | c89c8dc | 2019-10-16 17:48:21 -0700 | [diff] [blame] | 128 | |
| 129 | srcs: [ |
| Andy Hung | 06f3aba | 2019-12-03 16:36:42 -0800 | [diff] [blame] | 130 | "AudioAnalytics.cpp", |
| Joey Poomarin | 5298998 | 2020-03-05 17:40:49 +0800 | [diff] [blame] | 131 | "AudioPowerUsage.cpp", |
| Andy Hung | 1ea842e | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 132 | "AudioTypes.cpp", |
| Ray Essick | 5a55729 | 2020-06-10 21:31:33 -0700 | [diff] [blame] | 133 | "cleaner.cpp", |
| Andy Hung | c89c8dc | 2019-10-16 17:48:21 -0700 | [diff] [blame] | 134 | "iface_statsd.cpp", |
| Ray Essick | 40e8e5e | 2019-12-05 20:19:40 -0800 | [diff] [blame] | 135 | "MediaMetricsService.cpp", |
| Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 136 | "statsd_audiopolicy.cpp", |
| 137 | "statsd_audiorecord.cpp", |
| 138 | "statsd_audiothread.cpp", |
| 139 | "statsd_audiotrack.cpp", |
| 140 | "statsd_codec.cpp", |
| 141 | "statsd_drm.cpp", |
| 142 | "statsd_extractor.cpp", |
| Santiago Seifert | 149f058 | 2020-08-11 17:58:41 +0100 | [diff] [blame] | 143 | "statsd_mediaparser.cpp", |
| Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 144 | "statsd_nuplayer.cpp", |
| 145 | "statsd_recorder.cpp", |
| Andy Hung | 1ea842e | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 146 | "StringUtils.cpp" |
| Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 147 | ], |
| 148 | |
| Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 149 | proto: { |
| 150 | type: "lite", |
| 151 | }, |
| 152 | |
| Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 153 | shared_libs: [ |
| Andy Hung | 1ea842e | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 154 | "libbase", // android logging |
| Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 155 | "libbinder", |
| Joey Poomarin | 5298998 | 2020-03-05 17:40:49 +0800 | [diff] [blame] | 156 | "libcutils", |
| Andy Hung | 17dbaf2 | 2019-10-11 14:06:31 -0700 | [diff] [blame] | 157 | "liblog", |
| Andy Hung | 1ea842e | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 158 | "libmedia_helper", |
| Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 159 | "libmediametrics", |
| Andy Hung | a85efab | 2019-12-23 11:41:29 -0800 | [diff] [blame] | 160 | "libmediautils", |
| Andy Hung | 9099a1a | 2020-04-04 14:23:36 -0700 | [diff] [blame] | 161 | "libmemunreachable", |
| Andy Hung | 17dbaf2 | 2019-10-11 14:06:31 -0700 | [diff] [blame] | 162 | "libprotobuf-cpp-lite", |
| Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 163 | "libstatslog", |
| Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 164 | "libutils", |
| 165 | ], |
| 166 | |
| Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 167 | static_libs: [ |
| 168 | "libplatformprotos", |
| Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 169 | ], |
| Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 170 | |
| 171 | include_dirs: [ |
| Andy Hung | c89c8dc | 2019-10-16 17:48:21 -0700 | [diff] [blame] | 172 | "system/media/audio_utils/include", |
| Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 173 | ], |
| Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 174 | } |