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