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
17syntax = "proto2";
18
19package android.stats.mediametrics;
20
21enum StreamType {
22    STREAM_TYPE_UNKNOWN = 0;
23    STREAM_TYPE_OTHER = 1;
24    STREAM_TYPE_PROGRESSIVE = 2;
25    STREAM_TYPE_DASH = 3;
26    STREAM_TYPE_HLS = 4;
27    STREAM_TYPE_SS = 5;
28}
29
30enum DrmType {
31    DRM_TYPE_NONE = 0;
32    DRM_TYPE_OTHER = 1;
33    DRM_TYPE_PLAY_READY = 2;
34    DRM_TYPE_WV_L1 = 3;
35    DRM_TYPE_WV_L3 = 4;
36}
37
38enum PlaybackType {
39    PLAYBACK_TYPE_UNKNOWN = 0;
40    PLAYBACK_TYPE_VOD = 1;
41    PLAYBACK_TYPE_LIVE = 2;
42    PLAYBACK_TYPE_OTHER = 3;
43}
44
45enum ContentType {
46    CONTENT_TYPE_UNKNOWN = 0;
47    CONTENT_TYPE_MAIN = 1;
48    CONTENT_TYPE_AD = 2;
49    CONTENT_TYPE_OTHER = 3;
50}
51
52enum StreamSourceType {
53    STREAM_SOURCE_UNKNOWN = 0;
54    STREAM_SOURCE_NETWORK = 1;
55    STREAM_SOURCE_DEVICE = 2;
56    STREAM_SOURCE_MIXED = 3;
57}
58enum NetworkType {
59    NETWORK_TYPE_UNKNOWN = 0;
60    NETWORK_TYPE_OTHER = 1;
61    NETWORK_TYPE_WIFI = 2;
62    NETWORK_TYPE_ETHERNET = 3;
63    NETWORK_TYPE_2G = 4;
64    NETWORK_TYPE_3G = 5;
65    NETWORK_TYPE_4G = 6;
66    NETWORK_TYPE_5G_NSA = 7;
67    NETWORK_TYPE_5G_SA = 8;
68    NETWORK_TYPE_OFFLINE = 9;
69}
70
71enum PlaybackState {
72    // Playback has not started (initial state)
73    NOT_STARTED = 0;
74    // Playback is buffering in the background for initial playback start
75    JOINING_BACKGROUND = 1;
76    // Playback is buffering in the foreground for initial playback start
77    JOINING_FOREGROUND = 2;
78    // Playback is actively playing
79    PLAYING = 3;
80    // Playback is paused but ready to play
81    PAUSED = 4;
82    // Playback is handling a seek
83    SEEKING = 5;
84    // Playback is buffering to resume active playback
85    BUFFERING = 6;
86    // Playback is buffering while paused
87    PAUSED_BUFFERING = 7;
88    // the value 8 is not used
89    reserved 8;
90    // Playback is suppressed (e.g. due to audio focus loss)
91    SUPPRESSED = 9;
92    // Playback is suppressed (e.g. due to audio focus loss) while buffering to resume a
93    // playback
94    SUPPRESSED_BUFFERING = 10;
95    // Playback has reached the end of the media
96    ENDED = 11;
97    // Playback is stopped and can be restarted
98    STOPPED = 12;
99    // Playback is stopped due a fatal error and can be retried
100    FAILED = 13;
101    // Playback is interrupted by an ad
102    INTERRUPTED_BY_AD = 14;
103    // Playback is abandoned before reaching the end of the media
104    ABANDONED = 15;
105}
106
107enum PlaybackErrorCode {
108    ERROR_CODE_UNKNOWN = 0;
109    ERROR_CODE_OTHER = 1;
110    ERROR_CODE_RUNTIME = 2;
111    ERROR_CODE_NETWORK_OFFLINE = 3;
112    ERROR_CODE_NETWORK_CONNECT = 4;
113    ERROR_CODE_NETWORK_BAD_STATUS = 5;
114    ERROR_CODE_NETWORK_DNS = 6;
115    ERROR_CODE_NETWORK_TIMEOUT = 7;
116    ERROR_CODE_NETWORK_CLOSED = 8;
117    ERROR_CODE_NETWORK_OTHER = 9;
118    ERROR_CODE_MEDIA_MANIFET = 10;
119    ERROR_CODE_MEDIA_PARSER = 11;
120    ERROR_CODE_MEDIA_OTHER = 12;
121    ERROR_CODE_DECODER_INIT = 13;
122    ERROR_CODE_DECODER_DECODE = 14;
123    ERROR_CODE_DECODER_OOM = 15;
124    ERROR_CODE_DECODER_OTHER = 16;
125    ERROR_CODE_AUDIOTRACK_INIT = 17;
126    ERROR_CODE_AUDIOTRACK_WRITE = 18;
127    ERROR_CODE_AUDIOTRACK_OTHER = 19;
128    ERROR_CODE_PLAYER_REMOTE = 20;
129    ERROR_CODE_PLAYER_BEHIND_LIVE_WINDOW = 21;
130    ERROR_CODE_PLAYER_OTHER = 22;
131    ERROR_CODE_DRM_UNAVAILABLE = 23;
132    ERROR_CODE_DRM_PROVISIONING_FAILED = 24;
133    ERROR_CODE_DRM_LICENSE_ERROR = 25;
134    ERROR_CODE_DRM_DISALLOWED = 26;
135    ERROR_CODE_DRM_SYSTEM_ERROR = 27;
136    ERROR_CODE_DRM_CONTENT_ERROR = 28;
137    ERROR_CODE_DRM_REVOKED = 39;
138    ERROR_CODE_DRM_OTHER = 30;
139}
140
141enum TrackType {
142    AUDIO = 0;
143    VIDEO = 1;
144    TEXT = 2;
145}
146enum TrackState {
147    OFF = 0;
148    ON = 1;
149}
150enum TrackChangeReason {
151    REASON_UNKNOWN = 0;
152    REASON_OTHER = 1;
153    REASON_INITIAL = 2;
154    REASON_MANUAL = 3;
155    REASON_ADAPTIVE = 4;
156}
157// The values of the enum are in sync with the values in AudioFormat.java
158enum AudioEncoding {
159    // Invalid audio data format
160    ENCODING_INVALID = 0;
161    // Default audio data format
162    ENCODING_DEFAULT = 1;
163    // Audio data format PCM
164    ENCODING_PCM_16BIT = 2;
165    ENCODING_PCM_8BIT = 3;
166    // Audio data format: single-precision floating-point per sample
167    ENCODING_PCM_FLOAT = 4;
168    // Audio data format: AC-3 compressed, also known as Dolby Digital
169    ENCODING_AC3 = 5;
170    // Audio data format: E-AC-3 compressed, also known as Dolby Digital Plus or DD+
171    ENCODING_E_AC3 = 6;
172    // Audio data format: DTS compressed
173    ENCODING_DTS = 7;
174    // Audio data format: DTS HD compressed
175    ENCODING_DTS_HD = 8;
176    // Audio data format: MP3 compressed
177    ENCODING_MP3 = 9;
178    // Audio data format: AAC LC compressed
179    ENCODING_AAC_LC = 10;
180    // Audio data format: AAC HE V1 compressed
181    ENCODING_AAC_HE_V1 = 11;
182    // Audio data format: AAC HE V2 compressed
183    ENCODING_AAC_HE_V2 = 12;
184    // Audio data format: compressed audio wrapped in PCM for HDMI or S/PDIF passthrough.
185    ENCODING_IEC61937 = 13;
186    // Audio data format: DOLBY TRUEHD compressed
187    ENCODING_DOLBY_TRUEHD = 14;
188    // Audio data format: AAC ELD compressed
189    ENCODING_AAC_ELD = 15;
190    // Audio data format: AAC xHE compressed
191    ENCODING_AAC_XHE = 16;
192    // Audio data format: AC-4 sync frame transport format
193    ENCODING_AC4 = 17;
194    // Audio data format: E-AC-3-JOC compressed
195    ENCODING_E_AC3_JOC = 18;
196    // Audio data format: Dolby MAT (Metadata-enhanced Audio Transmission)
197    ENCODING_DOLBY_MAT = 19;
198    // Audio data format: OPUS compressed
199    ENCODING_OPUS = 20;
200    // Audio data format: PCM 24 bit per sample packed as 3 bytes.
201    ENCODING_PCM_24BIT_PACKED = 21;
202    // Audio data format: PCM 32 bit per sample.
203    ENCODING_PCM_32BIT = 22;
204    // Audio data format: MPEG-H baseline profile, level 3
205    ENCODING_MPEGH_BL_L3 = 23;
206    // Audio data format: MPEG-H baseline profile, level 4
207    ENCODING_MPEGH_BL_L4 = 24;
208    // Audio data format: MPEG-H low complexity profile, level 3
209    ENCODING_MPEGH_LC_L3 = 25;
210    // Audio data format: MPEG-H low complexity profile, level 4
211    ENCODING_MPEGH_LC_L4 = 26;
212    // Audio data format: DTS UHD compressed
213    ENCODING_DTS_UHD = 27;
214    // Audio data format: DRA compressed
215    ENCODING_DRA = 28;
216}
217enum EncodedSurroundOutputMode {
218    ENCODED_SURROUND_OUTPUT_UNKNOWN = 0;
219    ENCODED_SURROUND_OUTPUT_AUTO = 1;
220    ENCODED_SURROUND_OUTPUT_NEVER = 2;
221    ENCODED_SURROUND_OUTPUT_ALWAYS = 3;
222    ENCODED_SURROUND_OUTPUT_MANUAL = 4;
223}
224enum HdrFormat {
225    HDR_TYPE_UNKNOWN = 0;
226    HDR_TYPE_DOLBY_VISION = 1;
227    HDR_TYPE_HDR10 = 2;
228    HDR_TYPE_HLG = 3;
229    HDR_TYPE_HDR10_PLUS = 4;
230}
231enum MatchContentFrameRatePreference {
232   MATCH_CONTENT_FRAMERATE_UNKNOWN = 0;
233   MATCH_CONTENT_FRAMERATE_NEVER = 1;
234   MATCH_CONTENT_FRAMERATE_SEAMLESSS_ONLY = 2;
235   MATCH_CONTENT_FRAMERATE_ALWAYS = 3;
236};
237