mac: Let IPhotoDataProvider::GetAlbumNames() return albums in a deterministic order.
[chromium-blink-merge.git] / ppapi / c / pp_codecs.h
blob10d72d0d9020cd17d28bc92e1147c91cd885b588
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 Fri Sep 18 10:42:55 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_MAX = PP_AUDIOPROFILE_OPUS
51 } PP_AudioProfile;
53 /**
54 * Hardware acceleration options.
56 typedef enum {
57 /** Create a hardware accelerated resource only. */
58 PP_HARDWAREACCELERATION_ONLY = 0,
59 /**
60 * Create a hardware accelerated resource if possible. Otherwise, fall back
61 * to the software implementation.
63 PP_HARDWAREACCELERATION_WITHFALLBACK = 1,
64 /** Create the software implementation only. */
65 PP_HARDWAREACCELERATION_NONE = 2,
66 PP_HARDWAREACCELERATION_LAST = PP_HARDWAREACCELERATION_NONE
67 } PP_HardwareAcceleration;
68 /**
69 * @}
72 /**
73 * @addtogroup Structs
74 * @{
76 /**
77 * Struct describing a decoded video picture. The decoded picture data is stored
78 * in the GL texture corresponding to |texture_id|. The plugin can determine
79 * which Decode call generated the picture using |decode_id|.
81 struct PP_VideoPicture {
82 /**
83 * |decode_id| parameter of the Decode call which generated this picture.
84 * See the PPB_VideoDecoder function Decode() for more details.
86 uint32_t decode_id;
87 /**
88 * Texture ID in the plugin's GL context. The plugin can use this to render
89 * the decoded picture.
91 uint32_t texture_id;
92 /**
93 * The GL texture target for the decoded picture. Possible values are:
94 * GL_TEXTURE_2D
95 * GL_TEXTURE_RECTANGLE_ARB
96 * GL_TEXTURE_EXTERNAL_OES
98 * The pixel format of the texture is GL_RGBA.
100 uint32_t texture_target;
102 * Dimensions of the texture holding the decoded picture.
104 struct PP_Size texture_size;
106 * The visible subrectangle of the picture. The plugin should display only
107 * this part of the picture.
109 struct PP_Rect visible_rect;
113 * Struct describing a decoded video picture. The decoded picture data is stored
114 * in the GL texture corresponding to |texture_id|. The plugin can determine
115 * which Decode call generated the picture using |decode_id|.
117 struct PP_VideoPicture_0_1 {
119 * |decode_id| parameter of the Decode call which generated this picture.
120 * See the PPB_VideoDecoder function Decode() for more details.
122 uint32_t decode_id;
124 * Texture ID in the plugin's GL context. The plugin can use this to render
125 * the decoded picture.
127 uint32_t texture_id;
129 * The GL texture target for the decoded picture. Possible values are:
130 * GL_TEXTURE_2D
131 * GL_TEXTURE_RECTANGLE_ARB
132 * GL_TEXTURE_EXTERNAL_OES
134 * The pixel format of the texture is GL_RGBA.
136 uint32_t texture_target;
138 * Dimensions of the texture holding the decoded picture.
140 struct PP_Size texture_size;
144 * Supported video profile information. See the PPB_VideoEncoder function
145 * GetSupportedProfiles() for more details.
147 struct PP_VideoProfileDescription {
149 * The codec profile.
151 PP_VideoProfile profile;
153 * Dimensions of the maximum resolution of video frames, in pixels.
155 struct PP_Size max_resolution;
157 * The numerator of the maximum frame rate.
159 uint32_t max_framerate_numerator;
161 * The denominator of the maximum frame rate.
163 uint32_t max_framerate_denominator;
165 * Whether the profile is hardware accelerated.
167 PP_Bool hardware_accelerated;
171 * Supported video profile information. See the PPB_VideoEncoder function
172 * GetSupportedProfiles() for more details.
174 struct PP_VideoProfileDescription_0_1 {
176 * The codec profile.
178 PP_VideoProfile profile;
180 * Dimensions of the maximum resolution of video frames, in pixels.
182 struct PP_Size max_resolution;
184 * The numerator of the maximum frame rate.
186 uint32_t max_framerate_numerator;
188 * The denominator of the maximum frame rate.
190 uint32_t max_framerate_denominator;
192 * A value indicating if the profile is available in hardware, software, or
193 * both.
195 PP_HardwareAcceleration acceleration;
199 * Supported audio profile information. See the PPB_AudioEncoder function
200 * GetSupportedProfiles() for more details.
202 struct PP_AudioProfileDescription {
204 * The codec profile.
206 PP_AudioProfile profile;
208 * Maximum number of channels that can be encoded.
210 uint32_t max_channels;
212 * Sample size.
214 uint32_t sample_size;
216 * Sampling rate that can be encoded
218 uint32_t sample_rate;
220 * Whether the profile is hardware accelerated.
222 PP_Bool hardware_accelerated;
226 * Struct describing a bitstream buffer.
228 struct PP_BitstreamBuffer {
230 * The size, in bytes, of the bitstream data.
232 uint32_t size;
234 * The base address of the bitstream data.
236 void* buffer;
238 * Whether the buffer represents a key frame.
240 PP_Bool key_frame;
244 * Struct describing an audio bitstream buffer.
246 struct PP_AudioBitstreamBuffer {
248 * The size, in bytes, of the bitstream data.
250 uint32_t size;
252 * The base address of the bitstream data.
254 void* buffer;
257 * @}
260 #endif /* PPAPI_C_PP_CODECS_H_ */