OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/pp_bool.h" |
8 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
9 #include "ppapi/c/pp_resource.h" | 10 #include "ppapi/c/pp_resource.h" |
10 #include "ppapi/c/pp_stdint.h" | 11 #include "ppapi/c/pp_stdint.h" |
11 | 12 |
12 enum PP_VideoKey_Dev { | 13 enum PP_VideoKey_Dev { |
13 PP_VIDEOKEY_NONE = 0, | 14 PP_VIDEOKEY_NONE = 0, |
14 // Value is type of PP_VideoCodecId. | 15 // Value is type of PP_VideoCodecId. |
15 PP_VIDEOKEY_CODECID, | 16 PP_VIDEOKEY_CODECID, |
16 // Value is type of PP_VideoOperation. | 17 // Value is type of PP_VideoOperation. |
17 PP_VIDEOKEY_OPERATION, | 18 PP_VIDEOKEY_OPERATION, |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 struct PP_VideoFrameBuffer_Dev buffer; | 239 struct PP_VideoFrameBuffer_Dev buffer; |
239 | 240 |
240 // Time stamp of the frame in microsecond. | 241 // Time stamp of the frame in microsecond. |
241 uint64_t time_stamp_us; | 242 uint64_t time_stamp_us; |
242 | 243 |
243 // Bit mask of PP_VideoFrameInfoFlag. | 244 // Bit mask of PP_VideoFrameInfoFlag. |
244 uint32_t flags; | 245 uint32_t flags; |
245 | 246 |
246 // Output from decoder, indicating the decoded frame has error pixels. This | 247 // Output from decoder, indicating the decoded frame has error pixels. This |
247 // could be resulted from corrupted input bit stream and error concealment | 248 // could be resulted from corrupted input bit stream and error concealment |
248 // in decoding. | 249 // in decoding. PP_TRUE indicates error. |
249 // TODO(wjia): add more info about error pixels, such as error MB map, etc. | 250 // TODO(wjia): add more info about error pixels, such as error MB map, etc. |
250 bool has_error; | 251 PP_Bool error; |
251 }; | 252 }; |
252 | 253 |
253 // Plugin callback for decoder to deliver decoded frame buffers. | 254 // Plugin callback for decoder to deliver decoded frame buffers. |
254 // |format| in |buffer| specifies the format of decoded frame, with | 255 // |format| in |buffer| specifies the format of decoded frame, with |
255 // PP_VIDEOKEY_COLORTYPE and PP_VIDEOKEY_SURFACETYPE required. | 256 // PP_VIDEOKEY_COLORTYPE and PP_VIDEOKEY_SURFACETYPE required. |
256 typedef void (*PP_VideoDecodeOutputCallback_Func_Dev)( | 257 typedef void (*PP_VideoDecodeOutputCallback_Func_Dev)( |
257 PP_Instance instance, | 258 PP_Instance instance, |
258 struct PP_VideoUncompressedDataBuffer_Dev* buffer); | 259 struct PP_VideoUncompressedDataBuffer_Dev* buffer); |
259 | 260 |
260 // Plugin callback for decoder to return input data buffers. | 261 // Plugin callback for decoder to return input data buffers. |
261 // Plugin can optionally provide this callback only when it wants to recycle | 262 // Plugin can optionally provide this callback only when it wants to recycle |
262 // input data buffers. | 263 // input data buffers. |
263 typedef void (*PP_VideoDecodeInputCallback_Func_Dev)( | 264 typedef void (*PP_VideoDecodeInputCallback_Func_Dev)( |
264 PP_Instance instance, | 265 PP_Instance instance, |
265 struct PP_VideoCompressedDataBuffer_Dev* buffer); | 266 struct PP_VideoCompressedDataBuffer_Dev* buffer); |
266 | 267 |
267 // Event handling Function for decoder to deliver events to plugin. | 268 // Event handling Function for decoder to deliver events to plugin. |
268 // The correspondence between event and data1, data2: | 269 // The correspondence between event and data1, data2: |
269 // When event == PP_VIDEODECODEREVENT_ERROR, | 270 // When event == PP_VIDEODECODEREVENT_ERROR, |
270 // data1 is type of PP_VideoDecodeError id and data2 is ignored; | 271 // data1 is type of PP_VideoDecodeError id and data2 is ignored; |
271 // When event == PP_VIDEODECODEREVENT_NEWDIMENSION, | 272 // When event == PP_VIDEODECODEREVENT_NEWDIMENSION, |
272 // data1 is type of PP_Size*, data2 is ignored; | 273 // data1 is type of PP_Size*, data2 is ignored; |
273 // When event == PP_VIDEODECODEREVENT_NEWCROP, | 274 // When event == PP_VIDEODECODEREVENT_NEWCROP, |
274 // data1 is type of PP_Rect*, data2 is ignored; | 275 // data1 is type of PP_Rect*, data2 is ignored; |
275 typedef void (*PP_VideoDecodeEventHandler_Func_Dev)( | 276 typedef void (*PP_VideoDecodeEventHandler_Func_Dev)( |
276 PP_Instance instance, | 277 PP_Instance instance, |
277 PP_VideoDecoderEvent_Dev event, | 278 enum PP_VideoDecoderEvent_Dev event, |
278 PP_VideoDecodeData_Dev data1, | 279 PP_VideoDecodeData_Dev data1, |
279 PP_VideoDecodeData_Dev data2); | 280 PP_VideoDecodeData_Dev data2); |
280 | 281 |
281 // Requested decoder configuration and callback from plugin. | 282 // Requested decoder configuration and callback from plugin. |
282 struct PP_VideoDecoderConfig_Dev { | 283 struct PP_VideoDecoderConfig_Dev { |
283 PP_VideoConfig_Dev input_format; | 284 PP_VideoConfig_Dev input_format; |
284 PP_VideoConfig_Dev output_format; | 285 PP_VideoConfig_Dev output_format; |
285 PP_VideoDecodeOutputCallback_Func_Dev output_callback; | 286 PP_VideoDecodeOutputCallback_Func_Dev output_callback; |
286 PP_VideoDecodeInputCallback_Func_Dev input_callback; | 287 PP_VideoDecodeInputCallback_Func_Dev input_callback; |
287 PP_VideoDecodeEventHandler_Func_Dev event_handler; | 288 PP_VideoDecodeEventHandler_Func_Dev event_handler; |
288 }; | 289 }; |
289 | 290 |
290 #endif // PPAPI_C_DEV_PP_VIDEO_DEV_H_ | 291 #endif // PPAPI_C_DEV_PP_VIDEO_DEV_H_ |
OLD | NEW |