Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Side by Side Diff: ppapi/c/dev/pp_video_dev.h

Issue 7021020: Clean up video frame sizes, types in Video Decode API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: responses to CR Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/video/video_decode_accelerator.h ('k') | ppapi/c/dev/ppb_video_decoder_dev.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 */ 4 */
5 #ifndef PPAPI_C_DEV_PP_VIDEO_DEV_H_ 5 #ifndef PPAPI_C_DEV_PP_VIDEO_DEV_H_
6 #define PPAPI_C_DEV_PP_VIDEO_DEV_H_ 6 #define PPAPI_C_DEV_PP_VIDEO_DEV_H_
7 7
8 #include "ppapi/c/dev/ppb_opengles_dev.h" 8 #include "ppapi/c/dev/ppb_opengles_dev.h"
9 #include "ppapi/c/pp_bool.h" 9 #include "ppapi/c/pp_bool.h"
10 #include "ppapi/c/pp_instance.h" 10 #include "ppapi/c/pp_instance.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 158
159 // Enumeration for various color formats. 159 // Enumeration for various color formats.
160 enum PP_ColorFormat_Dev { 160 enum PP_ColorFormat_Dev {
161 // Value represents 32-bit RGBA format where each component is 8-bit in order 161 // Value represents 32-bit RGBA format where each component is 8-bit in order
162 // R-G-B-A. Regardless of endianness of the architecture color components are 162 // R-G-B-A. Regardless of endianness of the architecture color components are
163 // stored in this order in the memory. 163 // stored in this order in the memory.
164 PP_VIDEOATTR_COLORFORMAT_RGBA = 0 164 PP_VIDEOATTR_COLORFORMAT_RGBA = 0
165 }; 165 };
166 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_ColorFormat_Dev, 4); 166 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_ColorFormat_Dev, 4);
167 167
168 // Enumeration to determine which type of memory for buffer is used.
169 enum PP_PictureBufferType_Dev {
170 PP_PICTUREBUFFERTYPE_NONE = 0,
171 // System memory a.k.a. RAM.
172 PP_PICTUREBUFFERTYPE_SYSTEM = 1,
173 // GLES texture allocated using OpenGL ES APIs.
174 PP_PICTUREBUFFERTYPE_GLESTEXTURE = 1 << 1
175 };
176 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_PictureBufferType_Dev, 4);
177
178 // The data structure for video bitstream buffer. 168 // The data structure for video bitstream buffer.
179 struct PP_VideoBitstreamBuffer_Dev { 169 struct PP_VideoBitstreamBuffer_Dev {
180 // Client-specified identifier for the bitstream buffer. 170 // Client-specified identifier for the bitstream buffer.
181 int32_t id; 171 int32_t id;
182 172
183 // Buffer to hold the bitstream data. Should be allocated using the PPB_Buffer 173 // Buffer to hold the bitstream data. Should be allocated using the PPB_Buffer
184 // interface for consistent interprocess behaviour. 174 // interface for consistent interprocess behaviour.
185 PP_Resource data; 175 PP_Resource data;
186 176
187 // Size of the bitstream contained in buffer (in bytes). 177 // Size of the bitstream contained in buffer (in bytes).
188 int32_t size; 178 int32_t size;
189 }; 179 };
190 180
191 // Struct for specifying data about buffer. 181 // Struct for specifying texture-backed picture data.
192 struct PP_BufferInfo_Dev { 182 struct PP_PictureBuffer_Dev {
193 // Client-specified id for the picture buffer. By using this value client can 183 // Client-specified id for the picture buffer. By using this value client can
194 // keep track of the buffers it has assigned to the video decoder and how they 184 // keep track of the buffers it has assigned to the video decoder and how they
195 // are passed back to it. 185 // are passed back to it.
196 int32_t id; 186 int32_t id;
197 187
198 // Dimensions of the buffer. 188 // Dimensions of the buffer.
199 struct PP_Size size; 189 struct PP_Size size;
200 };
201 190
202 // Struct for specifying texture-backed picture data.
203 struct PP_GLESBuffer_Dev {
204 // Texture ID in the given context where picture is stored. 191 // Texture ID in the given context where picture is stored.
205 GLuint texture_id; 192 GLuint texture_id;
206
207 // Information about the buffer.
208 struct PP_BufferInfo_Dev info;
209 };
210
211 // Struct for specifying sysmem-backed picture data.
212 struct PP_SysmemBuffer_Dev {
213 // Resource representing system memory from shared memory address space.
214 // Use PPB_Buffer_Dev interface to handle this resource.
215 PP_Resource data;
216
217 // Information about the buffer.
218 struct PP_BufferInfo_Dev info;
219 }; 193 };
220 194
221 // Structure to describe a decoded output frame. 195 // Structure to describe a decoded output frame.
222 // The decoded pixels will always begin flush with the upper left-hand corner
223 // of the buffer (0, 0).
224 struct PP_Picture_Dev { 196 struct PP_Picture_Dev {
225 // ID of the picture buffer where the picture is stored. 197 // ID of the picture buffer where the picture is stored.
226 int32_t picture_buffer_id; 198 int32_t picture_buffer_id;
227 199
228 // ID of the bitstream from which this data was decoded. 200 // ID of the bitstream from which this data was decoded.
229 int32_t bitstream_buffer_id; 201 int32_t bitstream_buffer_id;
230
231 // Visible size of the picture.
232 // This describes the dimensions of the picture that is intended to be
233 // displayed from the decoded output.
234 struct PP_Size visible_size;
235
236 // Decoded size of the picture.
237 // This describes the dimensions of the decoded output. This may be slightly
238 // larger than the visible size because the stride is sometimes larger than
239 // the width of the output. The plugin should handle rendering the frame
240 // appropriately with respect to the sizes.
241 struct PP_Size decoded_size;
242 }; 202 };
243 203
244 // Enumeration for error events that may be reported through 204 // Enumeration for error events that may be reported through
245 // PP_VideoDecodeErrorHandler_Func_Dev callback function to the plugin. Default 205 // PP_VideoDecodeErrorHandler_Func_Dev callback function to the plugin. Default
246 // error handling functionality expected from the plugin is to Flush and Destroy 206 // error handling functionality expected from the plugin is to Flush and Destroy
247 // the decoder. 207 // the decoder.
248 enum PP_VideoDecodeError_Dev { 208 enum PP_VideoDecodeError_Dev {
249 PP_VIDEODECODEERROR_NONE = 0, 209 PP_VIDEODECODEERROR_NONE = 0,
250 // Decoder has not been initialized and configured properly. 210 // Decoder has not been initialized and configured properly.
251 PP_VIDEODECODEERROR_UNINITIALIZED, 211 PP_VIDEODECODEERROR_UNINITIALIZED,
252 // Decoder does not support feature of configuration or bitstream. 212 // Decoder does not support feature of configuration or bitstream.
253 PP_VIDEODECODEERROR_UNSUPPORTED, 213 PP_VIDEODECODEERROR_UNSUPPORTED,
254 // Decoder did not get valid input. 214 // Decoder did not get valid input.
255 PP_VIDEODECODERERROR_INVALIDINPUT, 215 PP_VIDEODECODERERROR_INVALIDINPUT,
256 // Failure in memory allocation or mapping. 216 // Failure in memory allocation or mapping.
257 PP_VIDEODECODERERROR_MEMFAILURE, 217 PP_VIDEODECODERERROR_MEMFAILURE,
258 // Decoder was given bitstream that would result in output pictures but it 218 // Decoder was given bitstream that would result in output pictures but it
259 // has not been provided buffers to do all this. 219 // has not been provided buffers to do all this.
260 PP_VIDEODECODEERROR_INSUFFICIENT_BUFFERS, 220 PP_VIDEODECODEERROR_INSUFFICIENT_BUFFERS,
261 // Decoder cannot continue operation due to insufficient resources for the 221 // Decoder cannot continue operation due to insufficient resources for the
262 // current configuration. 222 // current configuration.
263 PP_VIDEODECODEERROR_INSUFFICIENTRESOURCES, 223 PP_VIDEODECODEERROR_INSUFFICIENTRESOURCES,
264 // Decoder hardware has reported hardware error. 224 // Decoder hardware has reported hardware error.
265 PP_VIDEODECODEERROR_HARDWARE 225 PP_VIDEODECODEERROR_HARDWARE
266 }; 226 };
267 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_VideoDecodeError_Dev, 4); 227 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_VideoDecodeError_Dev, 4);
268 228
269 #endif /* PPAPI_C_DEV_PP_VIDEO_DEV_H_ */ 229 #endif /* PPAPI_C_DEV_PP_VIDEO_DEV_H_ */
OLDNEW
« no previous file with comments | « media/video/video_decode_accelerator.h ('k') | ppapi/c/dev/ppb_video_decoder_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698