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.
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"
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
49 PP_AUDIOPROFILE_OPUS
= 0,
50 PP_AUDIOPROFILE_SPEEX
= 1,
51 PP_AUDIOPROFILE_MAX
= PP_AUDIOPROFILE_SPEEX
55 * Hardware acceleration options.
58 /** Create a hardware accelerated resource only. */
59 PP_HARDWAREACCELERATION_ONLY
= 0,
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
;
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
{
84 * |decode_id| parameter of the Decode call which generated this picture.
85 * See the PPB_VideoDecoder function Decode() for more details.
89 * Texture ID in the plugin's GL context. The plugin can use this to render
90 * the decoded picture.
94 * The GL texture target for the decoded picture. Possible values are:
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.
125 * Texture ID in the plugin's GL context. The plugin can use this to render
126 * the decoded picture.
130 * The GL texture target for the decoded picture. Possible values are:
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
{
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
{
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
196 PP_HardwareAcceleration acceleration
;
200 * Supported audio profile information. See the PPB_AudioEncoder function
201 * GetSupportedProfiles() for more details.
203 struct PP_AudioProfileDescription
{
207 PP_AudioProfile profile
;
209 * Maximum number of channels that can be encoded.
211 uint32_t max_channels
;
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.
235 * The base address of the bitstream data.
239 * Whether the buffer represents a key frame.
245 * Struct describing an audio bitstream buffer.
247 struct PP_AudioBitstreamBuffer
{
249 * The size, in bytes, of the bitstream data.
253 * The base address of the bitstream data.
261 #endif /* PPAPI_C_PP_CODECS_H_ */