• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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: 53
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  // !!!WARNING!!!
190  // Keep synchronized with MediaCodecReported in atoms.proto
191  // Also keep AStatsEvent serialization synchronized in statsd_codec.cpp
192  // !!!WARNING!!!
193}
194
195/**
196 * Track Media Extractor (pulling video/audio streams out of containers) usage
197 * Logged from:
198 *   frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
199 *   frameworks/av/services/mediaanalytics/statsd_extractor.cpp
200 * Next Tag: 6
201 */
202message ExtractorData {
203  optional string format = 1;
204  optional string mime = 2;
205  optional int32 tracks = 3;
206
207  enum EntryPoint {
208    UNSET = 0; // For backwards compatibility with clients that don't
209               // collect the entry point.
210    SDK = 1;
211    NDK_WITH_JVM = 2;
212    NDK_NO_JVM = 3;
213    OTHER = 4; // For extractor users that don't make use of the APIs.
214  }
215
216  optional EntryPoint entry_point = 4 [default = UNSET];
217  optional string log_session_id = 5;
218}
219
220/**
221 * Track Media Player usage
222 * this handles both nuplayer and nuplayer2
223 * Logged from:
224 *   frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
225 *   frameworks/av/media/libmediaplayer2/nuplayer2/NuPlayer2Driver.cpp
226 *   frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
227 * Next Tag: 21
228 */
229message NuPlayerData {
230  optional string whichPlayer = 1;
231
232  optional string video_mime = 2;
233  optional string video_codec = 3;
234  optional int32 width = 4;
235  optional int32 height = 5;
236  optional int64 frames = 6;
237  optional int64 frames_dropped = 7;
238  optional double framerate = 8;
239  optional string audio_mime = 9;
240  optional string audio_codec = 10;
241  optional int64 duration_millis = 11;
242  optional int64 playing_millis = 12;
243  optional int32 error = 13;
244  optional int32 error_code = 14;
245  optional string error_state = 15;
246  optional string data_source_type = 16;
247  optional int64 rebuffering_millis = 17;
248  optional int32 rebuffers = 18;
249  optional int32 rebuffer_at_exit = 19;
250  optional int64 frames_dropped_startup = 20;
251}
252
253/**
254 * Track information about recordings (e.g. camcorder)
255 * Logged from
256 *   frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
257 *   frameworks/av/services/mediaanalytics/if_statsd.cpp
258 * Next Tag: 23
259 */
260message RecorderData {
261  optional string audio_mime = 1;
262  optional string video_mime = 2;
263  optional int32 video_profile = 3;
264  optional int32 video_level = 4;
265  optional int32 width = 5;
266  optional int32 height = 6;
267  optional int32 rotation = 7;
268  optional int32 framerate = 8;
269  optional int32 capture_fps = 9;
270  optional double capture_fps_enable = 10;
271  optional int64 duration_millis = 11;
272  optional int64 paused_millis = 12;
273  optional int32 paused_count = 13;
274  optional int32 audio_bitrate = 14;
275  optional int32 audio_channels = 15;
276  optional int32 audio_samplerate = 16;
277  optional int32 movie_timescale = 17;
278  optional int32 audio_timescale = 18;
279  optional int32 video_timescale = 19;
280  optional int32 video_bitrate = 20;
281  optional int32 iframe_interval = 21;
282  optional string log_session_id = 22;
283}
284
285