Ensure low-memory renderers retry failed loads correctly.
[chromium-blink-merge.git] / ppapi / c / pp_codecs.h
blobe8977998d36d2b27bdf399d9cb3a3047680871fa
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 /* From pp_codecs.idl modified Thu May 21 15:11:01 2015. */
8 #ifndef PPAPI_C_PP_CODECS_H_
9 #define PPAPI_C_PP_CODECS_H_
11 #include "ppapi/c/pp_bool.h"
12 #include "ppapi/c/pp_macros.h"
13 #include "ppapi/c/pp_point.h"
14 #include "ppapi/c/pp_rect.h"
15 #include "ppapi/c/pp_size.h"
16 #include "ppapi/c/pp_stdint.h"
18 /**
19 * @file
20 * Video profiles.
24 /**
25 * @addtogroup Enums
26 * @{
28 typedef enum {
29 PP_VIDEOPROFILE_H264BASELINE = 0,
30 PP_VIDEOPROFILE_H264MAIN = 1,
31 PP_VIDEOPROFILE_H264EXTENDED = 2,
32 PP_VIDEOPROFILE_H264HIGH = 3,
33 PP_VIDEOPROFILE_H264HIGH10PROFILE = 4,
34 PP_VIDEOPROFILE_H264HIGH422PROFILE = 5,
35 PP_VIDEOPROFILE_H264HIGH444PREDICTIVEPROFILE = 6,
36 PP_VIDEOPROFILE_H264SCALABLEBASELINE = 7,
37 PP_VIDEOPROFILE_H264SCALABLEHIGH = 8,
38 PP_VIDEOPROFILE_H264STEREOHIGH = 9,
39 PP_VIDEOPROFILE_H264MULTIVIEWHIGH = 10,
40 PP_VIDEOPROFILE_VP8_ANY = 11,
41 PP_VIDEOPROFILE_VP9_ANY = 12,
42 PP_VIDEOPROFILE_MAX = PP_VIDEOPROFILE_VP9_ANY
43 } PP_VideoProfile;
45 /**
46 * Audio profiles.
48 typedef enum {
49 PP_AUDIOPROFILE_OPUS = 0,
50 PP_AUDIOPROFILE_SPEEX = 1,
51 PP_AUDIOPROFILE_MAX = PP_AUDIOPROFILE_SPEEX
52 } PP_AudioProfile;
54 /**
55 * Hardware acceleration options.
57 typedef enum {
58 /** Create a hardware accelerated resource only. */
59 PP_HARDWAREACCELERATION_ONLY = 0,
60 /**
61 * Create a hardware accelerated resource if possible. Otherwise, fall back
62 * to the software implementation.
64 PP_HARDWAREACCELERATION_WITHFALLBACK = 1,
65 /** Create the software implementation only. */
66 PP_HARDWAREACCELERATION_NONE = 2,
67 PP_HARDWAREACCELERATION_LAST = PP_HARDWAREACCELERATION_NONE
68 } PP_HardwareAcceleration;
69 /**
70 * @}
73 /**
74 * @addtogroup Structs
75 * @{
77 /**
78 * Struct describing a decoded video picture. The decoded picture data is stored
79 * in the GL texture corresponding to |texture_id|. The plugin can determine
80 * which Decode call generated the picture using |decode_id|.
82 struct PP_VideoPicture {
83 /**
84 * |decode_id| parameter of the Decode call which generated this picture.
85 * See the PPB_VideoDecoder function Decode() for more details.
87 uint32_t decode_id;
88 /**
89 * Texture ID in the plugin's GL context. The plugin can use this to render
90 * the decoded picture.
92 uint32_t texture_id;
93 /**
94 * The GL texture target for the decoded picture. Possible values are:
95 * GL_TEXTURE_2D
96 * GL_TEXTURE_RECTANGLE_ARB
97 * GL_TEXTURE_EXTERNAL_OES
99 * The pixel format of the texture is GL_RGBA.
101 uint32_t texture_target;
103 * Dimensions of the texture holding the decoded picture.
105 struct PP_Size texture_size;
107 * The visible subrectangle of the picture. The plugin should display only
108 * this part of the picture.
110 struct PP_Rect visible_rect;
114 * Struct describing a decoded video picture. The decoded picture data is stored
115 * in the GL texture corresponding to |texture_id|. The plugin can determine
116 * which Decode call generated the picture using |decode_id|.
118 struct PP_VideoPicture_0_1 {
120 * |decode_id| parameter of the Decode call which generated this picture.
121 * See the PPB_VideoDecoder function Decode() for more details.
123 uint32_t decode_id;
125 * Texture ID in the plugin's GL context. The plugin can use this to render
126 * the decoded picture.
128 uint32_t texture_id;
130 * The GL texture target for the decoded picture. Possible values are:
131 * GL_TEXTURE_2D
132 * GL_TEXTURE_RECTANGLE_ARB
133 * GL_TEXTURE_EXTERNAL_OES
135 * The pixel format of the texture is GL_RGBA.
137 uint32_t texture_target;
139 * Dimensions of the texture holding the decoded picture.
141 struct PP_Size texture_size;
145 * Supported video profile information. See the PPB_VideoEncoder function
146 * GetSupportedProfiles() for more details.
148 struct PP_VideoProfileDescription {
150 * The codec profile.
152 PP_VideoProfile profile;
154 * Dimensions of the maximum resolution of video frames, in pixels.
156 struct PP_Size max_resolution;
158 * The numerator of the maximum frame rate.
160 uint32_t max_framerate_numerator;
162 * The denominator of the maximum frame rate.
164 uint32_t max_framerate_denominator;
166 * Whether the profile is hardware accelerated.
168 PP_Bool hardware_accelerated;
172 * Supported video profile information. See the PPB_VideoEncoder function
173 * GetSupportedProfiles() for more details.
175 struct PP_VideoProfileDescription_0_1 {
177 * The codec profile.
179 PP_VideoProfile profile;
181 * Dimensions of the maximum resolution of video frames, in pixels.
183 struct PP_Size max_resolution;
185 * The numerator of the maximum frame rate.
187 uint32_t max_framerate_numerator;
189 * The denominator of the maximum frame rate.
191 uint32_t max_framerate_denominator;
193 * A value indicating if the profile is available in hardware, software, or
194 * both.
196 PP_HardwareAcceleration acceleration;
200 * Supported audio profile information. See the PPB_AudioEncoder function
201 * GetSupportedProfiles() for more details.
203 struct PP_AudioProfileDescription {
205 * The codec profile.
207 PP_AudioProfile profile;
209 * Maximum number of channels that can be encoded.
211 uint32_t max_channels;
213 * Sample size.
215 uint32_t sample_size;
217 * Sampling rate that can be encoded
219 uint32_t sample_rate;
221 * Whether the profile is hardware accelerated.
223 PP_Bool hardware_accelerated;
227 * Struct describing a bitstream buffer.
229 struct PP_BitstreamBuffer {
231 * The size, in bytes, of the bitstream data.
233 uint32_t size;
235 * The base address of the bitstream data.
237 void* buffer;
239 * Whether the buffer represents a key frame.
241 PP_Bool key_frame;
245 * Struct describing an audio bitstream buffer.
247 struct PP_AudioBitstreamBuffer {
249 * The size, in bytes, of the bitstream data.
251 uint32_t size;
253 * The base address of the bitstream data.
255 void* buffer;
258 * @}
261 #endif /* PPAPI_C_PP_CODECS_H_ */