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.
108 // Kept in sync with media::ColorSpace via static_asserts.
117 // See media/base/video_decoder_config.h for descriptions.
118 // Kept in sync with media::VideoCodec via static_asserts.
131 // See media/base/video_decoder_config.h for descriptions.
132 // Kept in sync with media::VideoCodecProfile via static_asserts.
133 enum VideoCodecProfile {
134 VIDEO_CODEC_PROFILE_UNKNOWN = -1,
135 VIDEO_CODEC_PROFILE_MIN = VIDEO_CODEC_PROFILE_UNKNOWN,
137 H264PROFILE_BASELINE = H264PROFILE_MIN,
138 H264PROFILE_MAIN = 1,
139 H264PROFILE_EXTENDED = 2,
140 H264PROFILE_HIGH = 3,
141 H264PROFILE_HIGH10PROFILE = 4,
142 H264PROFILE_HIGH422PROFILE = 5,
143 H264PROFILE_HIGH444PREDICTIVEPROFILE = 6,
144 H264PROFILE_SCALABLEBASELINE = 7,
145 H264PROFILE_SCALABLEHIGH = 8,
146 H264PROFILE_STEREOHIGH = 9,
147 H264PROFILE_MULTIVIEWHIGH = 10,
148 H264PROFILE_MAX = H264PROFILE_MULTIVIEWHIGH,
150 VP8PROFILE_ANY = VP8PROFILE_MIN,
151 VP8PROFILE_MAX = VP8PROFILE_ANY,
153 VP9PROFILE_ANY = VP9PROFILE_MIN,
154 VP9PROFILE_MAX = VP9PROFILE_ANY,
155 VIDEO_CODEC_PROFILE_MAX = VP9PROFILE_MAX,
158 // This defines a mojo transport format for media::AudioDecoderConfig.
159 // See media/base/audio_decoder_config.h for descriptions.
160 struct AudioDecoderConfig {
162 SampleFormat sample_format;
163 ChannelLayout channel_layout;
164 int32 samples_per_second;
165 array<uint8>? extra_data;
166 int64 seek_preroll_usec;
171 // This defines a mojo transport format for media::VideoDecoderConfig.
172 // See media/base/video_decoder_config.h for descriptions.
173 struct VideoDecoderConfig {
175 VideoCodecProfile profile;
177 ColorSpace color_space;
178 mojo.Size coded_size;
179 mojo.Rect visible_rect;
180 mojo.Size natural_size;
181 array<uint8>? extra_data;
185 // This defines a mojo transport format for media::SubsampleEntry.
186 // See media/base/decrypt_config.h for descriptions.
187 struct SubsampleEntry {
192 // This defines a mojo transport format for media::DecryptConfig.
193 // See media/base/decrypt_config.h for descriptions.
194 struct DecryptConfig {
197 array<SubsampleEntry> subsamples;
200 // This defines a mojo transport format for media::DecoderBuffer.
201 struct DecoderBuffer {
202 // See media/base/buffers.h for details.
203 int64 timestamp_usec;
206 // The number of bytes present in this buffer. The data is not serialized
207 // along with this structure and must be read from a separate DataPipe.
210 // Indicates whether or not this buffer is a random access point.
213 // This is backed by an std::vector and results in a few copies.
214 // Into the vector, onto and off the MessagePipe, back into a vector.
215 array<uint8>? side_data;
216 uint32 side_data_size;
218 // DecryptConfig for a encrypted buffer. NULL if the buffer is not encrypted.
219 DecryptConfig? decrypt_config;
221 // These fields indicate the amount of data to discard after decoding.
222 int64 front_discard_usec;
223 int64 back_discard_usec;
225 // Indicates this buffer is part of a splice around |splice_timestamp_usec|.
226 int64 splice_timestamp_usec;