1/* 2 * Copyright (C) 2021 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 17syntax = "proto2"; 18 19package android.stats.mediametrics_message; 20 21/** 22 * Track how we arbitrate between microphone/input requests. 23 * Logged from 24 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp 25 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp 26 * Next Tag: 10 27 */ 28message AudioPolicyData { 29 optional int32 status = 1; 30 optional string request_source = 2; 31 optional string request_package = 3; 32 optional int32 request_session = 4; 33 optional string request_device = 5; 34 optional string active_source = 6; 35 optional string active_package = 7; 36 optional int32 active_session = 8; 37 optional string active_device = 9; 38} 39 40/** 41 * Track properties of audio recording 42 * Logged from 43 * frameworks/av/media/libaudioclient/AudioRecord.cpp 44 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp 45 * Next Tag: 16 46 */ 47message AudioRecordData { 48 optional string encoding = 1; 49 optional string source = 2; 50 optional int32 latency = 3; 51 optional int32 samplerate = 4; 52 optional int32 channels = 5; 53 optional int64 created_millis = 6; 54 optional int64 duration_millis = 7; 55 optional int32 count = 8; 56 optional int32 error_code = 9; 57 optional string error_function = 10; 58 optional int32 port_id = 11; 59 optional int32 frame_count = 12; 60 optional string attributes = 13; 61 optional int64 channel_mask = 14; 62 optional int64 start_count = 15; 63 64} 65 66/** 67 * Track audio thread performance data 68 * Logged from 69 * frameworks/av/media/libnblog/ReportPerformance.cpp 70 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp 71 * Next Tag: 28 72 */ 73message AudioThreadData { 74 optional string type = 1; 75 optional int32 framecount = 2; 76 optional int32 samplerate = 3; 77 optional string work_millis_hist = 4; 78 optional string latency_millis_hist = 5; 79 optional string warmup_millis_hist = 6; 80 optional int64 underruns = 7; 81 optional int64 overruns = 8; 82 optional int64 active_millis = 9; 83 optional int64 duration_millis = 10; 84 85 optional int32 id = 11; 86 optional int32 port_id = 12; 87 optional int32 sample_rate = 13; 88 optional int64 channel_mask = 14; 89 optional string encoding = 15; 90 optional int32 frame_count = 16; 91 optional string output_device = 17; 92 optional string input_device = 18; 93 optional double io_jitter_mean_millis = 19; 94 optional double io_jitter_stddev_millis = 20; 95 optional double process_time_mean_millis = 21; 96 optional double process_time_stddev_millis = 22; 97 optional double timestamp_jitter_mean_millis = 23; 98 optional double timestamp_jitter_stddev_millis = 24; 99 optional double latency_mean_millis = 25; 100 optional double latency_stddev_millis = 26; 101 102} 103 104/** 105 * Track audio track playback data 106 * Logged from 107 * frameworks/av/media/libaudioclient/AudioTrack.cpp 108 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp 109 * Next Tag: 12 110 */ 111message AudioTrackData { 112 optional string stream_type = 1; 113 optional string content_type = 2; 114 optional string track_usage = 3; 115 optional int32 sample_rate = 4; 116 optional int64 channel_mask = 5; 117 118 optional int32 underrun_frames = 6; 119 optional int32 startup_glitch = 7; 120 121 optional int32 port_id = 8; 122 optional string encoding = 9; 123 optional int32 frame_count = 10; 124 optional string attributes = 11; 125 126 127} 128 129/** 130 * Track Media Codec usage 131 * Logged from: 132 * frameworks/av/media/libstagefright/MediaCodec.cpp 133 * frameworks/av/services/mediaanalytics/statsd_codec.cpp 134 * Next Tag: 62 135 */ 136message CodecData { 137 optional string codec = 1; 138 optional string mime = 2; 139 optional string mode = 3; 140 optional int32 encoder = 4; 141 optional int32 secure = 5; 142 optional int32 width = 6; 143 optional int32 height = 7; 144 optional int32 rotation = 8; 145 optional int32 crypto = 9; 146 optional int32 profile = 10; 147 optional int32 level = 11; 148 optional int32 max_width = 12; 149 optional int32 max_height = 13; 150 optional int32 error_code = 14; 151 optional string error_state = 15; 152 optional int64 latency_max = 16; 153 optional int64 latency_min = 17; 154 optional int64 latency_avg = 18; 155 optional int64 latency_count = 19; 156 optional int64 latency_unknown = 20; 157 optional int32 queue_input_buffer_error = 21; 158 optional int32 queue_secure_input_buffer_error = 22; 159 optional string bitrate_mode = 23; 160 optional int32 bitrate = 24; 161 optional int64 lifetime_millis = 25; 162 optional string log_session_id = 26; 163 optional int32 channel_count = 27; 164 optional int32 sample_rate = 28; 165 optional int64 video_encode_bytes = 29; 166 optional int64 video_encode_frames = 30; 167 optional int64 video_input_bytes = 31; 168 optional int64 video_input_frames = 32; 169 optional int64 video_encode_duration_us = 33; 170 optional int32 color_format = 34; 171 optional double frame_rate = 35; 172 optional double capture_rate = 36; 173 optional double operating_rate = 37; 174 optional int32 priority = 38; 175 optional int32 video_qp_i_min = 39; 176 optional int32 video_qp_i_max = 40; 177 optional int32 video_qp_p_min = 41; 178 optional int32 video_qp_p_max = 42; 179 optional int32 video_qp_b_min = 43; 180 optional int32 video_qp_b_max = 44; 181 optional int32 original_bitrate = 45; 182 optional int32 shaping_enhanced = 46; 183 optional int32 original_video_qp_i_min = 47; 184 optional int32 original_video_qp_i_max = 48; 185 optional int32 original_video_qp_p_min = 49; 186 optional int32 original_video_qp_p_max = 50; 187 optional int32 original_video_qp_b_min = 51; 188 optional int32 original_video_qp_b_max = 52; 189 optional int32 config_color_standard = 53; 190 optional int32 config_color_range = 54; 191 optional int32 config_color_transfer = 55; 192 optional int32 parsed_color_standard = 56; 193 optional int32 parsed_color_range = 57; 194 optional int32 parsed_color_transfer = 58; 195 optional int32 hdr_static_info = 59; 196 optional int32 hdr10_plus_info = 60; 197 optional int32 hdr_format = 61; 198 // !!!WARNING!!! 199 // Keep synchronized with MediaCodecReported in atoms.proto 200 // Also keep AStatsEvent serialization synchronized in statsd_codec.cpp 201 // !!!WARNING!!! 202} 203 204/** 205 * Track Media Extractor (pulling video/audio streams out of containers) usage 206 * Logged from: 207 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp 208 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp 209 * Next Tag: 6 210 */ 211message ExtractorData { 212 optional string format = 1; 213 optional string mime = 2; 214 optional int32 tracks = 3; 215 216 enum EntryPoint { 217 UNSET = 0; // For backwards compatibility with clients that don't 218 // collect the entry point. 219 SDK = 1; 220 NDK_WITH_JVM = 2; 221 NDK_NO_JVM = 3; 222 OTHER = 4; // For extractor users that don't make use of the APIs. 223 } 224 225 optional EntryPoint entry_point = 4 [default = UNSET]; 226 optional string log_session_id = 5; 227} 228 229/** 230 * Track Media Player usage 231 * this handles both nuplayer and nuplayer2 232 * Logged from: 233 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp 234 * frameworks/av/media/libmediaplayer2/nuplayer2/NuPlayer2Driver.cpp 235 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp 236 * Next Tag: 21 237 */ 238message NuPlayerData { 239 optional string whichPlayer = 1; 240 241 optional string video_mime = 2; 242 optional string video_codec = 3; 243 optional int32 width = 4; 244 optional int32 height = 5; 245 optional int64 frames = 6; 246 optional int64 frames_dropped = 7; 247 optional double framerate = 8; 248 optional string audio_mime = 9; 249 optional string audio_codec = 10; 250 optional int64 duration_millis = 11; 251 optional int64 playing_millis = 12; 252 optional int32 error = 13; 253 optional int32 error_code = 14; 254 optional string error_state = 15; 255 optional string data_source_type = 16; 256 optional int64 rebuffering_millis = 17; 257 optional int32 rebuffers = 18; 258 optional int32 rebuffer_at_exit = 19; 259 optional int64 frames_dropped_startup = 20; 260} 261 262/** 263 * Track information about recordings (e.g. camcorder) 264 * Logged from 265 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp 266 * frameworks/av/services/mediaanalytics/if_statsd.cpp 267 * Next Tag: 23 268 */ 269message RecorderData { 270 optional string audio_mime = 1; 271 optional string video_mime = 2; 272 optional int32 video_profile = 3; 273 optional int32 video_level = 4; 274 optional int32 width = 5; 275 optional int32 height = 6; 276 optional int32 rotation = 7; 277 optional int32 framerate = 8; 278 optional int32 capture_fps = 9; 279 optional double capture_fps_enable = 10; 280 optional int64 duration_millis = 11; 281 optional int64 paused_millis = 12; 282 optional int32 paused_count = 13; 283 optional int32 audio_bitrate = 14; 284 optional int32 audio_channels = 15; 285 optional int32 audio_samplerate = 16; 286 optional int32 movie_timescale = 17; 287 optional int32 audio_timescale = 18; 288 optional int32 video_timescale = 19; 289 optional int32 video_bitrate = 20; 290 optional int32 iframe_interval = 21; 291 optional string log_session_id = 22; 292} 293 294