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 media.interfaces;
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.
16 // See media/base/audio_decoder_config.h for descriptions.
17 // Kept in sync with media::AudioCodec via static_asserts.
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?
59 k_STEREO_DOWNMIX = 16,
73 k_STEREO_AND_KEYBOARD_MIC = 30,
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.
92 // See media/base/video_types.h for descriptions.
93 // Kept in sync with media::VideoPixelFormat via static_asserts.
114 // Kept in sync with media::ColorSpace via static_asserts.
123 // See media/base/video_decoder_config.h for descriptions.
124 // Kept in sync with media::VideoCodec via static_asserts.
138 // See media/base/video_decoder_config.h for descriptions.
139 // Kept in sync with media::VideoCodecProfile via static_asserts.
140 enum VideoCodecProfile {
141 VIDEO_CODEC_PROFILE_UNKNOWN = -1,
142 VIDEO_CODEC_PROFILE_MIN = VIDEO_CODEC_PROFILE_UNKNOWN,
144 H264PROFILE_BASELINE = H264PROFILE_MIN,
145 H264PROFILE_MAIN = 1,
146 H264PROFILE_EXTENDED = 2,
147 H264PROFILE_HIGH = 3,
148 H264PROFILE_HIGH10PROFILE = 4,
149 H264PROFILE_HIGH422PROFILE = 5,
150 H264PROFILE_HIGH444PREDICTIVEPROFILE = 6,
151 H264PROFILE_SCALABLEBASELINE = 7,
152 H264PROFILE_SCALABLEHIGH = 8,
153 H264PROFILE_STEREOHIGH = 9,
154 H264PROFILE_MULTIVIEWHIGH = 10,
155 H264PROFILE_MAX = H264PROFILE_MULTIVIEWHIGH,
157 VP8PROFILE_ANY = VP8PROFILE_MIN,
158 VP8PROFILE_MAX = VP8PROFILE_ANY,
160 VP9PROFILE_ANY = VP9PROFILE_MIN,
161 VP9PROFILE_MAX = VP9PROFILE_ANY,
162 VIDEO_CODEC_PROFILE_MAX = VP9PROFILE_MAX,
165 // This defines a mojo transport format for media::AudioDecoderConfig.
166 // See media/base/audio_decoder_config.h for descriptions.
167 struct AudioDecoderConfig {
169 SampleFormat sample_format;
170 ChannelLayout channel_layout;
171 int32 samples_per_second;
172 array<uint8>? extra_data;
173 int64 seek_preroll_usec;
178 // This defines a mojo transport format for media::VideoDecoderConfig.
179 // See media/base/video_decoder_config.h for descriptions.
180 struct VideoDecoderConfig {
182 VideoCodecProfile profile;
184 ColorSpace color_space;
185 mojo.Size coded_size;
186 mojo.Rect visible_rect;
187 mojo.Size natural_size;
188 array<uint8>? extra_data;
192 // This defines a mojo transport format for media::SubsampleEntry.
193 // See media/base/decrypt_config.h for descriptions.
194 struct SubsampleEntry {
199 // This defines a mojo transport format for media::DecryptConfig.
200 // See media/base/decrypt_config.h for descriptions.
201 struct DecryptConfig {
204 array<SubsampleEntry> subsamples;
207 // This defines a mojo transport format for media::DecoderBuffer.
208 struct DecoderBuffer {
209 int64 timestamp_usec;
212 // The number of bytes present in this buffer. The data is not serialized
213 // along with this structure and must be read from a separate DataPipe.
216 // Indicates whether or not this buffer is a random access point.
219 // This is backed by an std::vector and results in a few copies.
220 // Into the vector, onto and off the MessagePipe, back into a vector.
221 array<uint8>? side_data;
222 uint32 side_data_size;
224 // DecryptConfig for a encrypted buffer. NULL if the buffer is not encrypted.
225 DecryptConfig? decrypt_config;
227 // These fields indicate the amount of data to discard after decoding.
228 int64 front_discard_usec;
229 int64 back_discard_usec;
231 // Indicates this buffer is part of a splice around |splice_timestamp_usec|.
232 int64 splice_timestamp_usec;