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