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

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: . 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
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 {
Ami GONE FROM CHROMIUM 2011/07/18 18:33:00 Technically requires bumping the PPB_ version numb
vrk (LEFT CHROMIUM) 2011/07/19 01:26:08 Makes sense; done.
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).
(...skipping 24 matching lines...) Expand all
212 struct PP_SysmemBuffer_Dev { 202 struct PP_SysmemBuffer_Dev {
213 // Resource representing system memory from shared memory address space. 203 // Resource representing system memory from shared memory address space.
214 // Use PPB_Buffer_Dev interface to handle this resource. 204 // Use PPB_Buffer_Dev interface to handle this resource.
215 PP_Resource data; 205 PP_Resource data;
216 206
217 // Information about the buffer. 207 // Information about the buffer.
218 struct PP_BufferInfo_Dev info; 208 struct PP_BufferInfo_Dev info;
219 }; 209 };
220 210
221 // Structure to describe a decoded output frame. 211 // 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 { 212 struct PP_Picture_Dev {
225 // ID of the picture buffer where the picture is stored. 213 // ID of the picture buffer where the picture is stored.
226 int32_t picture_buffer_id; 214 int32_t picture_buffer_id;
227 215
228 // ID of the bitstream from which this data was decoded. 216 // ID of the bitstream from which this data was decoded.
229 int32_t bitstream_buffer_id; 217 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 }; 218 };
243 219
244 // Enumeration for error events that may be reported through 220 // Enumeration for error events that may be reported through
245 // PP_VideoDecodeErrorHandler_Func_Dev callback function to the plugin. Default 221 // PP_VideoDecodeErrorHandler_Func_Dev callback function to the plugin. Default
246 // error handling functionality expected from the plugin is to Flush and Destroy 222 // error handling functionality expected from the plugin is to Flush and Destroy
247 // the decoder. 223 // the decoder.
248 enum PP_VideoDecodeError_Dev { 224 enum PP_VideoDecodeError_Dev {
249 PP_VIDEODECODEERROR_NONE = 0, 225 PP_VIDEODECODEERROR_NONE = 0,
250 // Decoder has not been initialized and configured properly. 226 // Decoder has not been initialized and configured properly.
251 PP_VIDEODECODEERROR_UNINITIALIZED, 227 PP_VIDEODECODEERROR_UNINITIALIZED,
252 // Decoder does not support feature of configuration or bitstream. 228 // Decoder does not support feature of configuration or bitstream.
253 PP_VIDEODECODEERROR_UNSUPPORTED, 229 PP_VIDEODECODEERROR_UNSUPPORTED,
254 // Decoder did not get valid input. 230 // Decoder did not get valid input.
255 PP_VIDEODECODERERROR_INVALIDINPUT, 231 PP_VIDEODECODERERROR_INVALIDINPUT,
256 // Failure in memory allocation or mapping. 232 // Failure in memory allocation or mapping.
257 PP_VIDEODECODERERROR_MEMFAILURE, 233 PP_VIDEODECODERERROR_MEMFAILURE,
258 // Decoder was given bitstream that would result in output pictures but it 234 // Decoder was given bitstream that would result in output pictures but it
259 // has not been provided buffers to do all this. 235 // has not been provided buffers to do all this.
260 PP_VIDEODECODEERROR_INSUFFICIENT_BUFFERS, 236 PP_VIDEODECODEERROR_INSUFFICIENT_BUFFERS,
261 // Decoder cannot continue operation due to insufficient resources for the 237 // Decoder cannot continue operation due to insufficient resources for the
262 // current configuration. 238 // current configuration.
263 PP_VIDEODECODEERROR_INSUFFICIENTRESOURCES, 239 PP_VIDEODECODEERROR_INSUFFICIENTRESOURCES,
264 // Decoder hardware has reported hardware error. 240 // Decoder hardware has reported hardware error.
265 PP_VIDEODECODEERROR_HARDWARE 241 PP_VIDEODECODEERROR_HARDWARE
266 }; 242 };
267 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_VideoDecodeError_Dev, 4); 243 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_VideoDecodeError_Dev, 4);
268 244
269 #endif /* PPAPI_C_DEV_PP_VIDEO_DEV_H_ */ 245 #endif /* PPAPI_C_DEV_PP_VIDEO_DEV_H_ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698