Roll src/third_party/WebKit ebb1ba5:b65f743 (svn 202609:202610)
[chromium-blink-merge.git] / ppapi / api / pp_codecs.idl
blob8699ec9853d9f9bf55555e16f6c3827493405801
1 /* Copyright (c) 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.
4 */
6 /**
7 * Video profiles.
8 */
9 enum PP_VideoProfile {
10 PP_VIDEOPROFILE_H264BASELINE = 0,
11 PP_VIDEOPROFILE_H264MAIN = 1,
12 PP_VIDEOPROFILE_H264EXTENDED = 2,
13 PP_VIDEOPROFILE_H264HIGH = 3,
14 PP_VIDEOPROFILE_H264HIGH10PROFILE = 4,
15 PP_VIDEOPROFILE_H264HIGH422PROFILE = 5,
16 PP_VIDEOPROFILE_H264HIGH444PREDICTIVEPROFILE = 6,
17 PP_VIDEOPROFILE_H264SCALABLEBASELINE = 7,
18 PP_VIDEOPROFILE_H264SCALABLEHIGH = 8,
19 PP_VIDEOPROFILE_H264STEREOHIGH = 9,
20 PP_VIDEOPROFILE_H264MULTIVIEWHIGH = 10,
21 PP_VIDEOPROFILE_VP8_ANY = 11,
22 PP_VIDEOPROFILE_VP9_ANY = 12,
23 PP_VIDEOPROFILE_MAX = PP_VIDEOPROFILE_VP9_ANY
26 /**
27 * Audio profiles.
29 enum PP_AudioProfile {
30 PP_AUDIOPROFILE_OPUS = 0,
31 PP_AUDIOPROFILE_MAX = PP_AUDIOPROFILE_OPUS
34 /**
35 * Hardware acceleration options.
37 enum PP_HardwareAcceleration {
38 /** Create a hardware accelerated resource only. */
39 PP_HARDWAREACCELERATION_ONLY = 0,
41 /**
42 * Create a hardware accelerated resource if possible. Otherwise, fall back
43 * to the software implementation.
45 PP_HARDWAREACCELERATION_WITHFALLBACK = 1,
47 /** Create the software implementation only. */
48 PP_HARDWAREACCELERATION_NONE = 2,
50 PP_HARDWAREACCELERATION_LAST = PP_HARDWAREACCELERATION_NONE
53 /**
54 * Struct describing a decoded video picture. The decoded picture data is stored
55 * in the GL texture corresponding to |texture_id|. The plugin can determine
56 * which Decode call generated the picture using |decode_id|.
58 struct PP_VideoPicture {
59 /**
60 * |decode_id| parameter of the Decode call which generated this picture.
61 * See the PPB_VideoDecoder function Decode() for more details.
63 uint32_t decode_id;
65 /**
66 * Texture ID in the plugin's GL context. The plugin can use this to render
67 * the decoded picture.
69 uint32_t texture_id;
71 /**
72 * The GL texture target for the decoded picture. Possible values are:
73 * GL_TEXTURE_2D
74 * GL_TEXTURE_RECTANGLE_ARB
75 * GL_TEXTURE_EXTERNAL_OES
77 * The pixel format of the texture is GL_RGBA.
79 uint32_t texture_target;
81 /**
82 * Dimensions of the texture holding the decoded picture.
84 PP_Size texture_size;
86 /**
87 * The visible subrectangle of the picture. The plugin should display only
88 * this part of the picture.
90 PP_Rect visible_rect;
93 /**
94 * Struct describing a decoded video picture. The decoded picture data is stored
95 * in the GL texture corresponding to |texture_id|. The plugin can determine
96 * which Decode call generated the picture using |decode_id|.
98 struct PP_VideoPicture_0_1 {
99 /**
100 * |decode_id| parameter of the Decode call which generated this picture.
101 * See the PPB_VideoDecoder function Decode() for more details.
103 uint32_t decode_id;
106 * Texture ID in the plugin's GL context. The plugin can use this to render
107 * the decoded picture.
109 uint32_t texture_id;
112 * The GL texture target for the decoded picture. Possible values are:
113 * GL_TEXTURE_2D
114 * GL_TEXTURE_RECTANGLE_ARB
115 * GL_TEXTURE_EXTERNAL_OES
117 * The pixel format of the texture is GL_RGBA.
119 uint32_t texture_target;
122 * Dimensions of the texture holding the decoded picture.
124 PP_Size texture_size;
128 * Supported video profile information. See the PPB_VideoEncoder function
129 * GetSupportedProfiles() for more details.
131 struct PP_VideoProfileDescription {
133 * The codec profile.
135 PP_VideoProfile profile;
138 * Dimensions of the maximum resolution of video frames, in pixels.
140 PP_Size max_resolution;
143 * The numerator of the maximum frame rate.
145 uint32_t max_framerate_numerator;
148 * The denominator of the maximum frame rate.
150 uint32_t max_framerate_denominator;
153 * Whether the profile is hardware accelerated.
155 PP_Bool hardware_accelerated;
159 * Supported video profile information. See the PPB_VideoEncoder function
160 * GetSupportedProfiles() for more details.
162 struct PP_VideoProfileDescription_0_1 {
164 * The codec profile.
166 PP_VideoProfile profile;
169 * Dimensions of the maximum resolution of video frames, in pixels.
171 PP_Size max_resolution;
174 * The numerator of the maximum frame rate.
176 uint32_t max_framerate_numerator;
179 * The denominator of the maximum frame rate.
181 uint32_t max_framerate_denominator;
184 * A value indicating if the profile is available in hardware, software, or
185 * both.
187 PP_HardwareAcceleration acceleration;
191 * Supported audio profile information. See the PPB_AudioEncoder function
192 * GetSupportedProfiles() for more details.
194 struct PP_AudioProfileDescription {
196 * The codec profile.
198 PP_AudioProfile profile;
201 * Maximum number of channels that can be encoded.
203 uint32_t max_channels;
206 * Sample size.
208 uint32_t sample_size;
211 * Sampling rate that can be encoded
213 uint32_t sample_rate;
216 * Whether the profile is hardware accelerated.
218 PP_Bool hardware_accelerated;
222 * Struct describing a bitstream buffer.
224 struct PP_BitstreamBuffer {
226 * The size, in bytes, of the bitstream data.
228 uint32_t size;
231 * The base address of the bitstream data.
233 mem_t buffer;
236 * Whether the buffer represents a key frame.
238 PP_Bool key_frame;
242 * Struct describing an audio bitstream buffer.
244 struct PP_AudioBitstreamBuffer {
246 * The size, in bytes, of the bitstream data.
248 uint32_t size;
251 * The base address of the bitstream data.
253 mem_t buffer;