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

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: cleanup Created 9 years, 7 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 PP_H264PAYLOADFORMAT_ONE_NALU_PER_BUFFER = 1 << 1, 146 PP_H264PAYLOADFORMAT_ONE_NALU_PER_BUFFER = 1 << 1,
147 // NALU separated by 1-byte interleaved length field. 147 // NALU separated by 1-byte interleaved length field.
148 PP_H264PAYLOADFORMAT_ONE_BYTE_INTERLEAVED_LENGTH = 1 << 2, 148 PP_H264PAYLOADFORMAT_ONE_BYTE_INTERLEAVED_LENGTH = 1 << 2,
149 // NALU separated by 2-byte interleaved length field. 149 // NALU separated by 2-byte interleaved length field.
150 PP_H264PAYLOADFORMAT_TWO_BYTE_INTERLEAVED_LENGTH = 1 << 3, 150 PP_H264PAYLOADFORMAT_TWO_BYTE_INTERLEAVED_LENGTH = 1 << 3,
151 // NALU separated by 4-byte interleaved length field. 151 // NALU separated by 4-byte interleaved length field.
152 PP_H264PAYLOADFORMAT_FOUR_BYTE_INTERLEAVED_LENGTH = 1 << 4 152 PP_H264PAYLOADFORMAT_FOUR_BYTE_INTERLEAVED_LENGTH = 1 << 4
153 }; 153 };
154 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_H264PayloadFormat_Dev, 4); 154 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_H264PayloadFormat_Dev, 4);
155 155
156 // Enumeration to determine which type of memory for buffer is used.
157 enum PP_PictureBufferType_Dev {
158 PP_PICTUREBUFFERTYPE_NONE = 0,
159 // System memory a.k.a. RAM.
160 PP_PICTUREBUFFERTYPE_SYSTEM = 1,
161 // GLES texture allocated using OpenGL ES APIs.
162 PP_PICTUREBUFFERTYPE_GLESTEXTURE = 1 << 1
163 };
164 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_PictureBufferType_Dev, 4);
165
Ville-Mikko Rautio 2011/05/17 08:58:49 How do we signal in the configuration the case whe
vrk (LEFT CHROMIUM) 2011/05/23 18:20:29 I don't think this is a valid case. To the decoder
vmr 2011/05/24 07:11:11 Even though theoretically these differences are ju
166 // The data structure for video bitstream buffer. 156 // The data structure for video bitstream buffer.
167 struct PP_VideoBitstreamBuffer_Dev { 157 struct PP_VideoBitstreamBuffer_Dev {
168 // Client-specified identifier for the bitstream buffer. 158 // Client-specified identifier for the bitstream buffer.
169 int32_t id; 159 int32_t id;
170 160
171 // Buffer to hold the bitstream data. Should be allocated using the PPB_Buffer 161 // Buffer to hold the bitstream data. Should be allocated using the PPB_Buffer
172 // interface for consistent interprocess behaviour. 162 // interface for consistent interprocess behaviour.
173 PP_Resource data; 163 PP_Resource data;
174 164
175 // Size of the bitstream contained in buffer (in bytes). 165 // Size of the bitstream contained in buffer (in bytes).
(...skipping 27 matching lines...) Expand all
203 struct PP_SysmemBuffer_Dev { 193 struct PP_SysmemBuffer_Dev {
204 // Resource representing system memory from shared memory address space. 194 // Resource representing system memory from shared memory address space.
205 // Use PPB_Buffer_Dev interface to handle this resource. 195 // Use PPB_Buffer_Dev interface to handle this resource.
206 PP_Resource data; 196 PP_Resource data;
207 197
208 // Information about the buffer. 198 // Information about the buffer.
209 struct PP_BufferInfo_Dev info; 199 struct PP_BufferInfo_Dev info;
210 }; 200 };
211 201
212 // Structure to describe a decoded output frame. 202 // Structure to describe a decoded output frame.
213 // The decoded pixels will always begin flush with the upper left-hand corner
214 // of the buffer (0, 0).
215 struct PP_Picture_Dev { 203 struct PP_Picture_Dev {
216 // ID of the picture buffer where the picture is stored. 204 // ID of the picture buffer where the picture is stored.
217 int32_t picture_buffer_id; 205 int32_t picture_buffer_id;
218 206
219 // ID of the bitstream from which this data was decoded. 207 // ID of the bitstream from which this data was decoded.
220 int32_t bitstream_buffer_id; 208 int32_t bitstream_buffer_id;
221
222 // Visible size of the picture.
223 // This describes the dimensions of the picture that is intended to be
224 // displayed from the decoded output.
225 struct PP_Size visible_size;
226
227 // Decoded size of the picture.
228 // This describes the dimensions of the decoded output. This may be slightly
229 // larger than the visible size because the stride is sometimes larger than
230 // the width of the output. The plugin should handle rendering the frame
231 // appropriately with respect to the sizes.
232 struct PP_Size decoded_size;
233 }; 209 };
234 210
235 // Enumeration for error events that may be reported through 211 // Enumeration for error events that may be reported through
236 // PP_VideoDecodeErrorHandler_Func_Dev callback function to the plugin. Default 212 // PP_VideoDecodeErrorHandler_Func_Dev callback function to the plugin. Default
237 // error handling functionality expected from the plugin is to Flush and Destroy 213 // error handling functionality expected from the plugin is to Flush and Destroy
238 // the decoder. 214 // the decoder.
239 enum PP_VideoDecodeError_Dev { 215 enum PP_VideoDecodeError_Dev {
240 PP_VIDEODECODEERROR_NONE = 0, 216 PP_VIDEODECODEERROR_NONE = 0,
241 // Decoder has not been initialized and configured properly. 217 // Decoder has not been initialized and configured properly.
242 PP_VIDEODECODEERROR_UNINITIALIZED, 218 PP_VIDEODECODEERROR_UNINITIALIZED,
243 // Decoder does not support feature of configuration or bitstream. 219 // Decoder does not support feature of configuration or bitstream.
244 PP_VIDEODECODEERROR_UNSUPPORTED, 220 PP_VIDEODECODEERROR_UNSUPPORTED,
245 // Decoder did not get valid input. 221 // Decoder did not get valid input.
246 PP_VIDEODECODERERROR_INVALIDINPUT, 222 PP_VIDEODECODERERROR_INVALIDINPUT,
247 // Failure in memory allocation or mapping. 223 // Failure in memory allocation or mapping.
248 PP_VIDEODECODERERROR_MEMFAILURE, 224 PP_VIDEODECODERERROR_MEMFAILURE,
249 // Decoder was given bitstream that would result in output pictures but it 225 // Decoder was given bitstream that would result in output pictures but it
250 // has not been provided buffers to do all this. 226 // has not been provided buffers to do all this.
251 PP_VIDEODECODEERROR_INSUFFICIENT_BUFFERS, 227 PP_VIDEODECODEERROR_INSUFFICIENT_BUFFERS,
252 // Decoder cannot continue operation due to insufficient resources for the 228 // Decoder cannot continue operation due to insufficient resources for the
253 // current configuration. 229 // current configuration.
254 PP_VIDEODECODEERROR_INSUFFICIENTRESOURCES, 230 PP_VIDEODECODEERROR_INSUFFICIENTRESOURCES,
255 // Decoder hardware has reported hardware error. 231 // Decoder hardware has reported hardware error.
256 PP_VIDEODECODEERROR_HARDWARE 232 PP_VIDEODECODEERROR_HARDWARE
257 }; 233 };
258 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_VideoDecodeError_Dev, 4); 234 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_VideoDecodeError_Dev, 4);
259 235
260 #endif /* PPAPI_C_DEV_PP_VIDEO_DEV_H_ */ 236 #endif /* PPAPI_C_DEV_PP_VIDEO_DEV_H_ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698