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.
113 // Kept in sync with media::ColorSpace via static_asserts.
122 // See media/base/video_decoder_config.h for descriptions.
123 // Kept in sync with media::VideoCodec via static_asserts.
137 // See media/base/video_decoder_config.h for descriptions.
138 // Kept in sync with media::VideoCodecProfile via static_asserts.
139 enum VideoCodecProfile {
140 VIDEO_CODEC_PROFILE_UNKNOWN = -1,
141 VIDEO_CODEC_PROFILE_MIN = VIDEO_CODEC_PROFILE_UNKNOWN,
143 H264PROFILE_BASELINE = H264PROFILE_MIN,
144 H264PROFILE_MAIN = 1,
145 H264PROFILE_EXTENDED = 2,
146 H264PROFILE_HIGH = 3,
147 H264PROFILE_HIGH10PROFILE = 4,
148 H264PROFILE_HIGH422PROFILE = 5,
149 H264PROFILE_HIGH444PREDICTIVEPROFILE = 6,
150 H264PROFILE_SCALABLEBASELINE = 7,
151 H264PROFILE_SCALABLEHIGH = 8,
152 H264PROFILE_STEREOHIGH = 9,
153 H264PROFILE_MULTIVIEWHIGH = 10,
154 H264PROFILE_MAX = H264PROFILE_MULTIVIEWHIGH,
156 VP8PROFILE_ANY = VP8PROFILE_MIN,
157 VP8PROFILE_MAX = VP8PROFILE_ANY,
159 VP9PROFILE_ANY = VP9PROFILE_MIN,
160 VP9PROFILE_MAX = VP9PROFILE_ANY,
161 VIDEO_CODEC_PROFILE_MAX = VP9PROFILE_MAX,
164 // This defines a mojo transport format for media::AudioDecoderConfig.
165 // See media/base/audio_decoder_config.h for descriptions.
166 struct AudioDecoderConfig {
168 SampleFormat sample_format;
169 ChannelLayout channel_layout;
170 int32 samples_per_second;
171 array<uint8>? extra_data;
172 int64 seek_preroll_usec;
177 // This defines a mojo transport format for media::VideoDecoderConfig.
178 // See media/base/video_decoder_config.h for descriptions.
179 struct VideoDecoderConfig {
181 VideoCodecProfile profile;
183 ColorSpace color_space;
184 mojo.Size coded_size;
185 mojo.Rect visible_rect;
186 mojo.Size natural_size;
187 array<uint8>? extra_data;
191 // This defines a mojo transport format for media::SubsampleEntry.
192 // See media/base/decrypt_config.h for descriptions.
193 struct SubsampleEntry {
198 // This defines a mojo transport format for media::DecryptConfig.
199 // See media/base/decrypt_config.h for descriptions.
200 struct DecryptConfig {
203 array<SubsampleEntry> subsamples;
206 // This defines a mojo transport format for media::DecoderBuffer.
207 struct DecoderBuffer {
208 int64 timestamp_usec;
211 // The number of bytes present in this buffer. The data is not serialized
212 // along with this structure and must be read from a separate DataPipe.
215 // Indicates whether or not this buffer is a random access point.
218 // This is backed by an std::vector and results in a few copies.
219 // Into the vector, onto and off the MessagePipe, back into a vector.
220 array<uint8>? side_data;
221 uint32 side_data_size;
223 // DecryptConfig for a encrypted buffer. NULL if the buffer is not encrypted.
224 DecryptConfig? decrypt_config;
226 // These fields indicate the amount of data to discard after decoding.
227 int64 front_discard_usec;
228 int64 back_discard_usec;
230 // Indicates this buffer is part of a splice around |splice_timestamp_usec|.
231 int64 splice_timestamp_usec;