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.
7 import "mojo/services/public/interfaces/geometry/geometry.mojom";
9 // See media/base/buffering_state.h for descriptions.
10 // Kept in sync with media::BufferingState via COMPILE_ASSERTs.
16 // See media/base/audio_decoder_config.h for descriptions.
17 // Kept in sync with media::AudioCodec via COMPILE_ASSERTs.
37 // See media/base/channel_layout.h for descriptions.
38 // Kept in sync with media::ChannelLayout via COMPILE_ASSERTs.
39 // TODO(tim): The bindings generators will always prepend the enum name, should
40 // mojom therefore allow enum values starting with numbers?
58 k_STEREO_DOWNMIX = 16,
72 k_STEREO_AND_KEYBOARD_MIC = 30,
74 k_MAX = k_4_1_QUAD_SIDE,
77 // See media/base/sample_format.h for descriptions.
78 // Kept in sync with media::SampleFormat via COMPILE_ASSERTs.
90 // See media/base/video_frame.h for descriptions.
91 // Kept in sync with media::VideoFrame::Format via COMPILE_ASSERTs.
106 // See media/base/video_decoder_config.h for descriptions.
107 // Kept in sync with media::VideoCodec via COMPILE_ASSERTs.
120 // See media/base/video_decoder_config.h for descriptions.
121 // Kept in sync with media::VideoCodecProfile via COMPILE_ASSERTs.
122 enum VideoCodecProfile {
123 VIDEO_CODEC_PROFILE_UNKNOWN = -1,
124 VIDEO_CODEC_PROFILE_MIN = VIDEO_CODEC_PROFILE_UNKNOWN,
126 H264PROFILE_BASELINE = H264PROFILE_MIN,
127 H264PROFILE_MAIN = 1,
128 H264PROFILE_EXTENDED = 2,
129 H264PROFILE_HIGH = 3,
130 H264PROFILE_HIGH10PROFILE = 4,
131 H264PROFILE_HIGH422PROFILE = 5,
132 H264PROFILE_HIGH444PREDICTIVEPROFILE = 6,
133 H264PROFILE_SCALABLEBASELINE = 7,
134 H264PROFILE_SCALABLEHIGH = 8,
135 H264PROFILE_STEREOHIGH = 9,
136 H264PROFILE_MULTIVIEWHIGH = 10,
137 H264PROFILE_MAX = H264PROFILE_MULTIVIEWHIGH,
139 VP8PROFILE_ANY = VP8PROFILE_MIN,
140 VP8PROFILE_MAX = VP8PROFILE_ANY,
142 VP9PROFILE_ANY = VP9PROFILE_MIN,
143 VP9PROFILE_MAX = VP9PROFILE_ANY,
144 VIDEO_CODEC_PROFILE_MAX = VP9PROFILE_MAX,
147 // This defines a mojo transport format for media::AudioDecoderConfig.
148 // See media/base/audio_decoder_config.h for descriptions.
149 struct AudioDecoderConfig {
151 SampleFormat sample_format;
152 ChannelLayout channel_layout;
153 int32 samples_per_second;
154 array<uint8>? extra_data;
155 int64 seek_preroll_usec;
159 // This defines a mojo transport format for media::VideoDecoderConfig.
160 // See media/base/video_decoder_config.h for descriptions.
161 struct VideoDecoderConfig {
163 VideoCodecProfile profile;
168 array<uint8>? extra_data;
172 // This defines a mojo transport format for media::DecoderBuffer.
173 struct MediaDecoderBuffer {
174 // See media/base/buffers.h for details.
175 int64 timestamp_usec;
178 // The number of bytes in |data|.
181 // This is backed by an std::vector and results in a few copies.
182 // Into the vector, onto and off the MessagePipe, back into a vector.
183 array<uint8>? side_data;
184 uint32 side_data_size;
186 // These fields indicate the amount of data to discard after decoding.
187 int64 front_discard_usec;
188 int64 back_discard_usec;
190 // Indicates this buffer is part of a splice around |splice_timestamp_usec|.
191 int64 splice_timestamp_usec;
193 // The payload. Invalid handle indicates an end-of-stream (EOS) buffer.
194 // TODO(tim): This currently results in allocating a new, largeish DataPipe
195 // for each buffer. Remove this once framed data pipes exist, but using this
196 // for now for prototyping audio.
197 handle<data_pipe_consumer>? data;