Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2019 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | //#define LOG_NDEBUG 0 |
| 18 | #define LOG_TAG "statsd_codec" |
| 19 | #include <utils/Log.h> |
| 20 | |
| 21 | #include <dirent.h> |
| 22 | #include <inttypes.h> |
| 23 | #include <pthread.h> |
| 24 | #include <pwd.h> |
| 25 | #include <stdint.h> |
| 26 | #include <string.h> |
| 27 | #include <sys/stat.h> |
| 28 | #include <sys/time.h> |
| 29 | #include <sys/types.h> |
| 30 | #include <unistd.h> |
| 31 | |
| 32 | #include <statslog.h> |
| 33 | |
Ray Essick | 5a55729 | 2020-06-10 21:31:33 -0700 | [diff] [blame] | 34 | #include "cleaner.h" |
Ray Essick | 40e8e5e | 2019-12-05 20:19:40 -0800 | [diff] [blame] | 35 | #include "MediaMetricsService.h" |
Dichen Zhang | b8f23c5 | 2021-03-22 00:56:29 -0700 | [diff] [blame] | 36 | #include "frameworks/proto_logging/stats/message/mediametrics_message.pb.h" |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 37 | #include "iface_statsd.h" |
| 38 | |
| 39 | namespace android { |
| 40 | |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 41 | bool statsd_codec(const std::shared_ptr<const mediametrics::Item>& item, |
| 42 | const std::shared_ptr<mediametrics::StatsdLog>& statsdLog) |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 43 | { |
Andy Hung | 3ab1b32 | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 44 | if (item == nullptr) return false; |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 45 | |
| 46 | // these go into the statsd wrapper |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 47 | const nsecs_t timestamp_nanos = MediaMetricsService::roundTime(item->getTimestamp()); |
| 48 | const std::string package_name = item->getPkgName(); |
| 49 | const int64_t package_version_code = item->getPkgVersionCode(); |
| 50 | const int64_t media_apex_version = 0; |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 51 | |
| 52 | // the rest into our own proto |
| 53 | // |
Dichen Zhang | b8f23c5 | 2021-03-22 00:56:29 -0700 | [diff] [blame] | 54 | ::android::stats::mediametrics_message::CodecData metrics_proto; |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 55 | |
| 56 | // flesh out the protobuf we'll hand off with our data |
| 57 | // |
| 58 | // android.media.mediacodec.codec string |
George Burgess IV | 0d81443 | 2019-10-23 11:32:26 -0700 | [diff] [blame] | 59 | std::string codec; |
| 60 | if (item->getString("android.media.mediacodec.codec", &codec)) { |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 61 | metrics_proto.set_codec(codec); |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 62 | } |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 63 | |
George Burgess IV | 0d81443 | 2019-10-23 11:32:26 -0700 | [diff] [blame] | 64 | std::string mime; |
| 65 | if (item->getString("android.media.mediacodec.mime", &mime)) { |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 66 | metrics_proto.set_mime(mime); |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 67 | } |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 68 | |
George Burgess IV | 0d81443 | 2019-10-23 11:32:26 -0700 | [diff] [blame] | 69 | std::string mode; |
| 70 | if ( item->getString("android.media.mediacodec.mode", &mode)) { |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 71 | metrics_proto.set_mode(mode); |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 72 | } |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 73 | |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 74 | int32_t encoder = -1; |
| 75 | if ( item->getInt32("android.media.mediacodec.encoder", &encoder)) { |
| 76 | metrics_proto.set_encoder(encoder); |
| 77 | } |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 78 | |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 79 | int32_t secure = -1; |
| 80 | if ( item->getInt32("android.media.mediacodec.secure", &secure)) { |
| 81 | metrics_proto.set_secure(secure); |
| 82 | } |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 83 | |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 84 | int32_t width = -1; |
| 85 | if ( item->getInt32("android.media.mediacodec.width", &width)) { |
| 86 | metrics_proto.set_width(width); |
| 87 | } |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 88 | |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 89 | int32_t height = -1; |
| 90 | if ( item->getInt32("android.media.mediacodec.height", &height)) { |
| 91 | metrics_proto.set_height(height); |
| 92 | } |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 93 | |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 94 | int32_t rotation = -1; |
| 95 | if ( item->getInt32("android.media.mediacodec.rotation-degrees", &rotation)) { |
| 96 | metrics_proto.set_rotation(rotation); |
| 97 | } |
Dichen Zhang | 0de0575 | 2021-04-21 19:47:07 -0700 | [diff] [blame] | 98 | // android.media.mediacodec.crypto int32 (although missing if not needed) |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 99 | int32_t crypto = -1; |
| 100 | if ( item->getInt32("android.media.mediacodec.crypto", &crypto)) { |
| 101 | metrics_proto.set_crypto(crypto); |
| 102 | } |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 103 | |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 104 | int32_t profile = -1; |
| 105 | if ( item->getInt32("android.media.mediacodec.profile", &profile)) { |
| 106 | metrics_proto.set_profile(profile); |
| 107 | } |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 108 | |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 109 | int32_t level = -1; |
| 110 | if ( item->getInt32("android.media.mediacodec.level", &level)) { |
| 111 | metrics_proto.set_level(level); |
| 112 | } |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 113 | |
| 114 | int32_t max_width = -1; |
| 115 | if ( item->getInt32("android.media.mediacodec.maxwidth", &max_width)) { |
| 116 | metrics_proto.set_max_width(max_width); |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 117 | } |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 118 | |
| 119 | int32_t max_height = -1; |
| 120 | if ( item->getInt32("android.media.mediacodec.maxheight", &max_height)) { |
| 121 | metrics_proto.set_max_height(max_height); |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 122 | } |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 123 | |
| 124 | int32_t error_code = -1; |
| 125 | if ( item->getInt32("android.media.mediacodec.errcode", &error_code)) { |
| 126 | metrics_proto.set_error_code(error_code); |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 127 | } |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 128 | |
| 129 | std::string error_state; |
| 130 | if ( item->getString("android.media.mediacodec.errstate", &error_state)) { |
| 131 | metrics_proto.set_error_state(error_state); |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 132 | } |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 133 | |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 134 | int64_t latency_max = -1; |
| 135 | if ( item->getInt64("android.media.mediacodec.latency.max", &latency_max)) { |
| 136 | metrics_proto.set_latency_max(latency_max); |
| 137 | } |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 138 | |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 139 | int64_t latency_min = -1; |
| 140 | if ( item->getInt64("android.media.mediacodec.latency.min", &latency_min)) { |
| 141 | metrics_proto.set_latency_min(latency_min); |
| 142 | } |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 143 | |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 144 | int64_t latency_avg = -1; |
| 145 | if ( item->getInt64("android.media.mediacodec.latency.avg", &latency_avg)) { |
| 146 | metrics_proto.set_latency_avg(latency_avg); |
| 147 | } |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 148 | |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 149 | int64_t latency_count = -1; |
| 150 | if ( item->getInt64("android.media.mediacodec.latency.n", &latency_count)) { |
| 151 | metrics_proto.set_latency_count(latency_count); |
| 152 | } |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 153 | |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 154 | int64_t latency_unknown = -1; |
| 155 | if ( item->getInt64("android.media.mediacodec.latency.unknown", &latency_unknown)) { |
| 156 | metrics_proto.set_latency_unknown(latency_unknown); |
| 157 | } |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 158 | |
| 159 | int32_t queue_secure_input_buffer_error = -1; |
| 160 | if (item->getInt32("android.media.mediacodec.queueSecureInputBufferError", |
| 161 | &queue_secure_input_buffer_error)) { |
| 162 | metrics_proto.set_queue_secure_input_buffer_error(queue_secure_input_buffer_error); |
Edwin Wong | 4f10539 | 2020-02-12 14:55:00 -0800 | [diff] [blame] | 163 | } |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 164 | |
| 165 | int32_t queue_input_buffer_error = -1; |
| 166 | if (item->getInt32("android.media.mediacodec.queueInputBufferError", |
| 167 | &queue_input_buffer_error)) { |
| 168 | metrics_proto.set_queue_input_buffer_error(queue_input_buffer_error); |
Edwin Wong | 4f10539 | 2020-02-12 14:55:00 -0800 | [diff] [blame] | 169 | } |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 170 | // android.media.mediacodec.latency.hist NOT EMITTED |
| 171 | |
Ray Essick | a21a3d3 | 2020-05-10 21:08:10 -0700 | [diff] [blame] | 172 | std::string bitrate_mode; |
| 173 | if (item->getString("android.media.mediacodec.bitrate_mode", &bitrate_mode)) { |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 174 | metrics_proto.set_bitrate_mode(bitrate_mode); |
Ray Essick | a21a3d3 | 2020-05-10 21:08:10 -0700 | [diff] [blame] | 175 | } |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 176 | |
Ray Essick | a21a3d3 | 2020-05-10 21:08:10 -0700 | [diff] [blame] | 177 | int32_t bitrate = -1; |
| 178 | if (item->getInt32("android.media.mediacodec.bitrate", &bitrate)) { |
| 179 | metrics_proto.set_bitrate(bitrate); |
| 180 | } |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 181 | |
| 182 | int64_t lifetime_millis = -1; |
| 183 | if (item->getInt64("android.media.mediacodec.lifetimeMs", &lifetime_millis)) { |
| 184 | lifetime_millis = mediametrics::bucket_time_minutes(lifetime_millis); |
| 185 | metrics_proto.set_lifetime_millis(lifetime_millis); |
Ray Essick | a21a3d3 | 2020-05-10 21:08:10 -0700 | [diff] [blame] | 186 | } |
Ray Essick | a21a3d3 | 2020-05-10 21:08:10 -0700 | [diff] [blame] | 187 | |
Dichen Zhang | 0de0575 | 2021-04-21 19:47:07 -0700 | [diff] [blame] | 188 | // android.media.mediacodec.channelCount |
| 189 | int32_t channelCount = -1; |
| 190 | if ( item->getInt32("android.media.mediacodec.channelCount", &channelCount)) { |
| 191 | metrics_proto.set_channel_count(channelCount); |
| 192 | } |
Ray Essick | 8791331 | 2021-03-02 10:45:54 -0800 | [diff] [blame] | 193 | |
Dichen Zhang | 0de0575 | 2021-04-21 19:47:07 -0700 | [diff] [blame] | 194 | // android.media.mediacodec.sampleRate |
| 195 | int32_t sampleRate = -1; |
| 196 | if ( item->getInt32("android.media.mediacodec.sampleRate", &sampleRate)) { |
| 197 | metrics_proto.set_sample_rate(sampleRate); |
| 198 | } |
| 199 | |
Ray Essick | 8791331 | 2021-03-02 10:45:54 -0800 | [diff] [blame] | 200 | // TODO PWG may want these fuzzed up a bit to obscure some precision |
Dichen Zhang | 0de0575 | 2021-04-21 19:47:07 -0700 | [diff] [blame] | 201 | // android.media.mediacodec.vencode.bytes |
| 202 | int64_t bytes = -1; |
| 203 | if ( item->getInt64("android.media.mediacodec.vencode.bytes", &bytes)) { |
| 204 | metrics_proto.set_video_encode_bytes(bytes); |
| 205 | } |
| 206 | |
| 207 | // android.media.mediacodec.vencode.frames |
| 208 | int64_t frames = -1; |
| 209 | if ( item->getInt64("android.media.mediacodec.vencode.frames", &frames)) { |
| 210 | metrics_proto.set_video_encode_frames(frames); |
| 211 | } |
| 212 | |
| 213 | // android.media.mediacodec.vencode.durationUs |
| 214 | int64_t durationUs = -1; |
| 215 | if ( item->getInt64("android.media.mediacodec.vencode.durationUs", &durationUs)) { |
| 216 | metrics_proto.set_video_encode_duration_us(durationUs); |
| 217 | } |
| 218 | |
| 219 | // android.media.mediacodec.color-format |
| 220 | int32_t colorFormat = -1; |
| 221 | if ( item->getInt32("android.media.mediacodec.color-format", &colorFormat)) { |
| 222 | metrics_proto.set_color_format(colorFormat); |
| 223 | } |
| 224 | |
| 225 | // android.media.mediacodec.frame-rate |
| 226 | double frameRate = -1.0; |
| 227 | if ( item->getDouble("android.media.mediacodec.frame-rate", &frameRate)) { |
| 228 | metrics_proto.set_frame_rate(frameRate); |
| 229 | } |
| 230 | |
| 231 | // android.media.mediacodec.capture-rate |
| 232 | double captureRate = -1.0; |
| 233 | if ( item->getDouble("android.media.mediacodec.capture-rate", &captureRate)) { |
| 234 | metrics_proto.set_capture_rate(captureRate); |
| 235 | } |
| 236 | |
| 237 | // android.media.mediacodec.operating-rate |
| 238 | double operatingRate = -1.0; |
| 239 | if ( item->getDouble("android.media.mediacodec.operating-rate", &operatingRate)) { |
| 240 | metrics_proto.set_operating_rate(operatingRate); |
| 241 | } |
| 242 | |
| 243 | // android.media.mediacodec.priority |
| 244 | int32_t priority = -1; |
| 245 | if ( item->getInt32("android.media.mediacodec.priority", &priority)) { |
| 246 | metrics_proto.set_priority(priority); |
| 247 | } |
| 248 | |
| 249 | // android.media.mediacodec.video-qp-i-min |
| 250 | int32_t qpIMin = -1; |
| 251 | if ( item->getInt32("android.media.mediacodec.video-qp-i-min", &qpIMin)) { |
| 252 | metrics_proto.set_video_qp_i_min(qpIMin); |
| 253 | } |
| 254 | |
| 255 | // android.media.mediacodec.video-qp-i-max |
| 256 | int32_t qpIMax = -1; |
| 257 | if ( item->getInt32("android.media.mediacodec.video-qp-i-max", &qpIMax)) { |
| 258 | metrics_proto.set_video_qp_i_max(qpIMax); |
| 259 | } |
| 260 | |
| 261 | // android.media.mediacodec.video-qp-p-min |
| 262 | int32_t qpPMin = -1; |
| 263 | if ( item->getInt32("android.media.mediacodec.video-qp-p-min", &qpPMin)) { |
| 264 | metrics_proto.set_video_qp_p_min(qpPMin); |
| 265 | } |
| 266 | |
| 267 | // android.media.mediacodec.video-qp-p-max |
| 268 | int32_t qpPMax = -1; |
| 269 | if ( item->getInt32("android.media.mediacodec.video-qp-p-max", &qpPMax)) { |
| 270 | metrics_proto.set_video_qp_p_max(qpPMax); |
| 271 | } |
| 272 | |
| 273 | // android.media.mediacodec.video-qp-b-min |
| 274 | int32_t qpBMin = -1; |
| 275 | if ( item->getInt32("android.media.mediacodec.video-qp-b-min", &qpBMin)) { |
| 276 | metrics_proto.set_video_qp_b_min(qpIMin); |
| 277 | } |
| 278 | |
| 279 | // android.media.mediacodec.video-qp-b-max |
| 280 | int32_t qpBMax = -1; |
| 281 | if ( item->getInt32("android.media.mediacodec.video-qp-b-max", &qpBMax)) { |
| 282 | metrics_proto.set_video_qp_b_max(qpBMax); |
| 283 | } |
| 284 | |
| 285 | // android.media.mediacodec.video.input.bytes |
| 286 | int64_t inputBytes = -1; |
| 287 | if ( item->getInt64("android.media.mediacodec.video.input.bytes", &inputBytes)) { |
| 288 | metrics_proto.set_video_input_bytes(inputBytes); |
| 289 | } |
| 290 | |
| 291 | // android.media.mediacodec.video.input.frames |
| 292 | int64_t inputFrames = -1; |
| 293 | if ( item->getInt64("android.media.mediacodec.video.input.frames", &inputFrames)) { |
| 294 | metrics_proto.set_video_input_frames(inputFrames); |
| 295 | } |
Ray Essick | 8791331 | 2021-03-02 10:45:54 -0800 | [diff] [blame] | 296 | |
Dichen Zhang | e5bad78 | 2021-04-28 12:11:35 -0700 | [diff] [blame] | 297 | // android.media.mediacodec.original.bitrate |
| 298 | int32_t originalBitrate = -1; |
| 299 | if ( item->getInt32("android.media.mediacodec.original.bitrate", &originalBitrate)) { |
| 300 | metrics_proto.set_original_bitrate(originalBitrate); |
| 301 | } |
| 302 | |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 303 | std::string serialized; |
| 304 | if (!metrics_proto.SerializeToString(&serialized)) { |
| 305 | ALOGE("Failed to serialize codec metrics"); |
| 306 | return false; |
| 307 | } |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 308 | android::util::BytesField bf_serialized( serialized.c_str(), serialized.size()); |
| 309 | int result = android::util::stats_write(android::util::MEDIAMETRICS_CODEC_REPORTED, |
| 310 | timestamp_nanos, package_name.c_str(), package_version_code, |
| 311 | media_apex_version, |
| 312 | bf_serialized); |
| 313 | std::stringstream log; |
| 314 | log << "result:" << result << " {" |
| 315 | << " mediametrics_codec_reported:" |
| 316 | << android::util::MEDIAMETRICS_CODEC_REPORTED |
| 317 | << " timestamp_nanos:" << timestamp_nanos |
| 318 | << " package_name:" << package_name |
| 319 | << " package_version_code:" << package_version_code |
| 320 | << " media_apex_version:" << media_apex_version |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 321 | |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 322 | << " codec:" << codec |
| 323 | << " mime:" << mime |
| 324 | << " mode:" << mode |
| 325 | << " encoder:" << encoder |
| 326 | << " secure:" << secure |
| 327 | << " width:" << width |
| 328 | << " height:" << height |
| 329 | << " rotation:" << rotation |
| 330 | << " crypto:" << crypto |
| 331 | << " profile:" << profile |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 332 | |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 333 | << " level:" << level |
| 334 | << " max_width:" << max_width |
| 335 | << " max_height:" << max_height |
| 336 | << " error_code:" << error_code |
| 337 | << " error_state:" << error_state |
| 338 | << " latency_max:" << latency_max |
| 339 | << " latency_min:" << latency_min |
| 340 | << " latency_avg:" << latency_avg |
| 341 | << " latency_count:" << latency_count |
| 342 | << " latency_unknown:" << latency_unknown |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 343 | |
Andy Hung | 5be90c8 | 2021-03-30 14:30:20 -0700 | [diff] [blame] | 344 | << " queue_input_buffer_error:" << queue_input_buffer_error |
| 345 | << " queue_secure_input_buffer_error:" << queue_secure_input_buffer_error |
| 346 | << " bitrate_mode:" << bitrate_mode |
| 347 | << " bitrate:" << bitrate |
| 348 | << " lifetime_millis:" << lifetime_millis |
| 349 | // TODO: add when log_session_id is merged. |
| 350 | // << " log_session_id:" << log_session_id |
| 351 | << " }"; |
| 352 | statsdLog->log(android::util::MEDIAMETRICS_CODEC_REPORTED, log.str()); |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 353 | return true; |
| 354 | } |
| 355 | |
Andy Hung | 3ab1b32 | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 356 | } // namespace android |