Include all dupe types (event when value is zero) in scan stats.
[chromium-blink-merge.git] / media / mojo / interfaces / media_types.mojom
blobff87cec727fb8e920b50fb570c97c69afa26423d
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 module mojo;
7 import "ui/mojo/geometry/geometry.mojom";
9 // See media/base/buffering_state.h for descriptions.
10 // Kept in sync with media::BufferingState via static_asserts.
11 enum BufferingState {
12   HAVE_NOTHING,
13   HAVE_ENOUGH,
16 // See media/base/audio_decoder_config.h for descriptions.
17 // Kept in sync with media::AudioCodec via static_asserts.
18 enum AudioCodec {
19   UNKNOWN = 0,
20   AAC = 1,
21   MP3 = 2,
22   PCM = 3,
23   Vorbis = 4,
24   FLAC = 5,
25   AMR_NB = 6,
26   AMR_WB = 7,
27   PCM_MULAW = 8,
28   GSM_MS = 9,
29   PCM_S16BE = 10,
30   PCM_S24BE = 11,
31   Opus = 12,
32   // EAC3 = 13,
33   PCM_ALAW = 14,
34   ALAC = 15,
35   MAX = ALAC,
38 // See media/base/channel_layout.h for descriptions.
39 // Kept in sync with media::ChannelLayout via static_asserts.
40 // TODO(tim): The bindings generators will always prepend the enum name, should
41 // mojom therefore allow enum values starting with numbers?
42 enum ChannelLayout {
43   k_NONE = 0,
44   k_UNSUPPORTED = 1,
45   k_MONO = 2,
46   k_STEREO = 3,
47   k_2_1 = 4,
48   k_SURROUND = 5,
49   k_4_0 = 6,
50   k_2_2 = 7,
51   k_QUAD = 8,
52   k_5_0 = 9,
53   k_5_1 = 10,
54   k_5_0_BACK = 11,
55   k_5_1_BACK = 12,
56   k_7_0 = 13,
57   k_7_1 = 14,
58   k_7_1_WIDE = 15,
59   k_STEREO_DOWNMIX = 16,
60   k_2POINT1 = 17,
61   k_3_1 = 18,
62   k_4_1 = 19,
63   k_6_0 = 20,
64   k_6_0_FRONT = 21,
65   k_HEXAGONAL = 22,
66   k_6_1 = 23,
67   k_6_1_BACK = 24,
68   k_6_1_FRONT = 25,
69   k_7_0_FRONT = 26,
70   k_7_1_WIDE_BACK = 27,
71   k_OCTAGONAL = 28,
72   k_DISCRETE = 29,
73   k_STEREO_AND_KEYBOARD_MIC = 30,
74   k_4_1_QUAD_SIDE = 31,
75   k_MAX = k_4_1_QUAD_SIDE,
78 // See media/base/sample_format.h for descriptions.
79 // Kept in sync with media::SampleFormat via static_asserts.
80 enum SampleFormat {
81   UNKNOWN = 0,
82   U8,
83   S16,
84   S32,
85   F32,
86   PlanarS16,
87   PlanarF32,
88   PlanarS32,
89   Max = PlanarS32,
92 // See media/base/video_frame.h for descriptions.
93 // Kept in sync with media::VideoFrame::Format via static_asserts.
94 enum VideoFormat {
95   UNKNOWN = 0,
96   YV12,
97   I420,
98   YV16,
99   YV12A,
100   YV24,
101   NV12,
102   ARGB,
103   XRGB,
104   FORMAT_MAX = XRGB,
107 // See media/base/video_decoder_config.h for descriptions.
108 // Kept in sync with media::VideoCodec via static_asserts.
109 enum VideoCodec {
110   UNKNOWN = 0,
111   H264,
112   VC1,
113   MPEG2,
114   MPEG4,
115   Theora,
116   VP8,
117   VP9,
118   Max = VP9,
121 // See media/base/video_decoder_config.h for descriptions.
122 // Kept in sync with media::VideoCodecProfile via static_asserts.
123 enum VideoCodecProfile {
124   VIDEO_CODEC_PROFILE_UNKNOWN = -1,
125   VIDEO_CODEC_PROFILE_MIN = VIDEO_CODEC_PROFILE_UNKNOWN,
126   H264PROFILE_MIN = 0,
127   H264PROFILE_BASELINE = H264PROFILE_MIN,
128   H264PROFILE_MAIN = 1,
129   H264PROFILE_EXTENDED = 2,
130   H264PROFILE_HIGH = 3,
131   H264PROFILE_HIGH10PROFILE = 4,
132   H264PROFILE_HIGH422PROFILE = 5,
133   H264PROFILE_HIGH444PREDICTIVEPROFILE = 6,
134   H264PROFILE_SCALABLEBASELINE = 7,
135   H264PROFILE_SCALABLEHIGH = 8,
136   H264PROFILE_STEREOHIGH = 9,
137   H264PROFILE_MULTIVIEWHIGH = 10,
138   H264PROFILE_MAX = H264PROFILE_MULTIVIEWHIGH,
139   VP8PROFILE_MIN = 11,
140   VP8PROFILE_ANY = VP8PROFILE_MIN,
141   VP8PROFILE_MAX = VP8PROFILE_ANY,
142   VP9PROFILE_MIN = 12,
143   VP9PROFILE_ANY = VP9PROFILE_MIN,
144   VP9PROFILE_MAX = VP9PROFILE_ANY,
145   VIDEO_CODEC_PROFILE_MAX = VP9PROFILE_MAX,
148 // This defines a mojo transport format for media::AudioDecoderConfig.
149 // See media/base/audio_decoder_config.h for descriptions.
150 struct AudioDecoderConfig {
151   AudioCodec codec;
152   SampleFormat sample_format;
153   ChannelLayout channel_layout;
154   int32 samples_per_second;
155   array<uint8>? extra_data;
156   int64 seek_preroll_usec;
157   int32 codec_delay;
158   bool is_encrypted;
161 // This defines a mojo transport format for media::VideoDecoderConfig.
162 // See media/base/video_decoder_config.h for descriptions.
163 struct VideoDecoderConfig {
164   VideoCodec codec;
165   VideoCodecProfile profile;
166   VideoFormat format;
167   Size coded_size;
168   Rect visible_rect;
169   Size natural_size;
170   array<uint8>? extra_data;
171   bool is_encrypted;
174 // This defines a mojo transport format for media::SubsampleEntry.
175 // See media/base/decrypt_config.h for descriptions.
176 struct SubsampleEntry {
177   uint32 clear_bytes;
178   uint32 cypher_bytes;
181 // This defines a mojo transport format for media::DecryptConfig.
182 // See media/base/decrypt_config.h for descriptions.
183 struct DecryptConfig {
184   string key_id;
185   string iv;
186   array<SubsampleEntry> subsamples;
189 // This defines a mojo transport format for media::DecoderBuffer.
190 struct MediaDecoderBuffer {
191   // See media/base/buffers.h for details.
192   int64 timestamp_usec;
193   int64 duration_usec;
195   // The number of bytes present in this buffer.  The data is not serialized
196   // along with this structure and must be read from a separate DataPipe.
197   uint32 data_size;
199   // Indicates whether or not this buffer is a random access point.
200   bool is_key_frame;
202   // This is backed by an std::vector and results in a few copies.
203   // Into the vector, onto and off the MessagePipe, back into a vector.
204   array<uint8>? side_data;
205   uint32 side_data_size;
207   // DecryptConfig for a encrypted buffer. NULL if the buffer is not encrypted.
208   DecryptConfig? decrypt_config;
210   // These fields indicate the amount of data to discard after decoding.
211   int64 front_discard_usec;
212   int64 back_discard_usec;
214   // Indicates this buffer is part of a splice around |splice_timestamp_usec|.
215   int64 splice_timestamp_usec;