OLD | NEW |
1 /* Copyright (c) 2014 The Chromium Authors. All rights reserved. | 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 | 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 | 5 |
6 /* From ppb_video_decoder.idl modified Wed Nov 5 14:04:14 2014. */ | 6 /* From ppb_video_decoder.idl modified Thu Aug 6 14:15:48 2015. */ |
7 | 7 |
8 #ifndef PPAPI_C_PPB_VIDEO_DECODER_H_ | 8 #ifndef PPAPI_C_PPB_VIDEO_DECODER_H_ |
9 #define PPAPI_C_PPB_VIDEO_DECODER_H_ | 9 #define PPAPI_C_PPB_VIDEO_DECODER_H_ |
10 | 10 |
11 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
12 #include "ppapi/c/pp_codecs.h" | 12 #include "ppapi/c/pp_codecs.h" |
13 #include "ppapi/c/pp_completion_callback.h" | 13 #include "ppapi/c/pp_completion_callback.h" |
14 #include "ppapi/c/pp_instance.h" | 14 #include "ppapi/c/pp_instance.h" |
15 #include "ppapi/c/pp_macros.h" | 15 #include "ppapi/c/pp_macros.h" |
16 #include "ppapi/c/pp_point.h" | 16 #include "ppapi/c/pp_point.h" |
17 #include "ppapi/c/pp_rect.h" | 17 #include "ppapi/c/pp_rect.h" |
18 #include "ppapi/c/pp_resource.h" | 18 #include "ppapi/c/pp_resource.h" |
19 #include "ppapi/c/pp_size.h" | 19 #include "ppapi/c/pp_size.h" |
20 #include "ppapi/c/pp_stdint.h" | 20 #include "ppapi/c/pp_stdint.h" |
21 | 21 |
22 #define PPB_VIDEODECODER_INTERFACE_0_1 "PPB_VideoDecoder;0.1" | 22 #define PPB_VIDEODECODER_INTERFACE_0_1 "PPB_VideoDecoder;0.1" |
23 #define PPB_VIDEODECODER_INTERFACE_0_2 "PPB_VideoDecoder;0.2" | 23 #define PPB_VIDEODECODER_INTERFACE_0_2 "PPB_VideoDecoder;0.2" |
24 #define PPB_VIDEODECODER_INTERFACE_1_0 "PPB_VideoDecoder;1.0" | 24 #define PPB_VIDEODECODER_INTERFACE_1_0 "PPB_VideoDecoder;1.0" |
| 25 #define PPB_VIDEODECODER_INTERFACE_1_1 "PPB_VideoDecoder;1.1" /* dev */ |
25 #define PPB_VIDEODECODER_INTERFACE PPB_VIDEODECODER_INTERFACE_1_0 | 26 #define PPB_VIDEODECODER_INTERFACE PPB_VIDEODECODER_INTERFACE_1_0 |
26 | 27 |
27 /** | 28 /** |
28 * @file | 29 * @file |
29 * This file defines the <code>PPB_VideoDecoder</code> interface. | 30 * This file defines the <code>PPB_VideoDecoder</code> interface. |
30 */ | 31 */ |
31 | 32 |
32 | 33 |
33 /** | 34 /** |
34 * @addtogroup Interfaces | 35 * @addtogroup Interfaces |
(...skipping 15 matching lines...) Expand all Loading... |
50 * - Call Reset() to quickly stop the decoder (e.g. to implement Seek) and wait | 51 * - Call Reset() to quickly stop the decoder (e.g. to implement Seek) and wait |
51 * for the callback before restarting decoding at another point. | 52 * for the callback before restarting decoding at another point. |
52 * - To destroy the decoder, the plugin should release all of its references to | 53 * - To destroy the decoder, the plugin should release all of its references to |
53 * it. Any pending callbacks will abort before the decoder is destroyed. | 54 * it. Any pending callbacks will abort before the decoder is destroyed. |
54 * | 55 * |
55 * Available video codecs vary by platform. | 56 * Available video codecs vary by platform. |
56 * All: theora, vorbis, vp8. | 57 * All: theora, vorbis, vp8. |
57 * Chrome and ChromeOS: aac, h264. | 58 * Chrome and ChromeOS: aac, h264. |
58 * ChromeOS: mpeg4. | 59 * ChromeOS: mpeg4. |
59 */ | 60 */ |
60 struct PPB_VideoDecoder_1_0 { | 61 struct PPB_VideoDecoder_1_1 { /* dev */ |
61 /** | 62 /** |
62 * Creates a new video decoder resource. | 63 * Creates a new video decoder resource. |
63 * | 64 * |
64 * @param[in] instance A <code>PP_Instance</code> identifying the instance | 65 * @param[in] instance A <code>PP_Instance</code> identifying the instance |
65 * with the video decoder. | 66 * with the video decoder. |
66 * | 67 * |
67 * @return A <code>PP_Resource</code> corresponding to a video decoder if | 68 * @return A <code>PP_Resource</code> corresponding to a video decoder if |
68 * successful or 0 otherwise. | 69 * successful or 0 otherwise. |
69 */ | 70 */ |
70 PP_Resource (*Create)(PP_Instance instance); | 71 PP_Resource (*Create)(PP_Instance instance); |
(...skipping 12 matching lines...) Expand all Loading... |
83 * and before any other functions. | 84 * and before any other functions. |
84 * | 85 * |
85 * @param[in] video_decoder A <code>PP_Resource</code> identifying the video | 86 * @param[in] video_decoder A <code>PP_Resource</code> identifying the video |
86 * decoder. | 87 * decoder. |
87 * @param[in] graphics3d_context A <code>PPB_Graphics3D</code> resource to use | 88 * @param[in] graphics3d_context A <code>PPB_Graphics3D</code> resource to use |
88 * during decoding. | 89 * during decoding. |
89 * @param[in] profile A <code>PP_VideoProfile</code> specifying the video | 90 * @param[in] profile A <code>PP_VideoProfile</code> specifying the video |
90 * codec profile. | 91 * codec profile. |
91 * @param[in] acceleration A <code>PP_HardwareAcceleration</code> specifying | 92 * @param[in] acceleration A <code>PP_HardwareAcceleration</code> specifying |
92 * whether to use a hardware accelerated or a software implementation. | 93 * whether to use a hardware accelerated or a software implementation. |
| 94 * @param[in] min_picture_count A count of pictures the plugin would like to |
| 95 * have in flight. This is effectively the number of times the plugin can |
| 96 * call GetPicture() and get a decoded frame without calling |
| 97 * RecyclePicture(). The decoder has its own internal minimum count, and will |
| 98 * take the larger of its internal and this value. A client that doesn't care |
| 99 * can therefore just pass in zero for this argument. |
93 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | 100 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon |
94 * completion. | 101 * completion. |
95 * | 102 * |
96 * @return An int32_t containing an error code from <code>pp_errors.h</code>. | 103 * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
97 * Returns PP_ERROR_NOTSUPPORTED if video decoding is not available, or the | 104 * Returns PP_ERROR_NOTSUPPORTED if video decoding is not available, or the |
98 * requested profile is not supported. In this case, the client may call | 105 * requested profile is not supported. In this case, the client may call |
99 * Initialize() again with different parameters to find a good configuration. | 106 * Initialize() again with different parameters to find a good configuration. |
| 107 * Returns PP_ERROR_BADARGUMENT if the requested minimum picture count is |
| 108 * unreasonably large. |
100 */ | 109 */ |
101 int32_t (*Initialize)(PP_Resource video_decoder, | 110 int32_t (*Initialize)(PP_Resource video_decoder, |
102 PP_Resource graphics3d_context, | 111 PP_Resource graphics3d_context, |
103 PP_VideoProfile profile, | 112 PP_VideoProfile profile, |
104 PP_HardwareAcceleration acceleration, | 113 PP_HardwareAcceleration acceleration, |
| 114 uint32_t min_picture_count, |
105 struct PP_CompletionCallback callback); | 115 struct PP_CompletionCallback callback); |
106 /** | 116 /** |
107 * Decodes a bitstream buffer. Copies |size| bytes of data from the plugin's | 117 * Decodes a bitstream buffer. Copies |size| bytes of data from the plugin's |
108 * |buffer|. The plugin should wait until the decoder signals completion by | 118 * |buffer|. The plugin should wait until the decoder signals completion by |
109 * returning PP_OK or by running |callback| before calling Decode() again. | 119 * returning PP_OK or by running |callback| before calling Decode() again. |
110 * | 120 * |
111 * In general, each bitstream buffer should contain a demuxed bitstream frame | 121 * In general, each bitstream buffer should contain a demuxed bitstream frame |
112 * for the selected video codec. For example, H264 decoders expect to receive | 122 * for the selected video codec. For example, H264 decoders expect to receive |
113 * one AnnexB NAL unit, including the 4 byte start code prefix, while VP8 | 123 * one AnnexB NAL unit, including the 4 byte start code prefix, while VP8 |
114 * decoders expect to receive a bitstream frame without the IVF frame header. | 124 * decoders expect to receive a bitstream frame without the IVF frame header. |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 * @param[in] callback A <code>PP_CompletionCallback</code> to be called on | 223 * @param[in] callback A <code>PP_CompletionCallback</code> to be called on |
214 * completion. | 224 * completion. |
215 * | 225 * |
216 * @return An int32_t containing an error code from <code>pp_errors.h</code>. | 226 * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
217 * Returns PP_ERROR_FAILED if the decoder isn't initialized. | 227 * Returns PP_ERROR_FAILED if the decoder isn't initialized. |
218 */ | 228 */ |
219 int32_t (*Reset)(PP_Resource video_decoder, | 229 int32_t (*Reset)(PP_Resource video_decoder, |
220 struct PP_CompletionCallback callback); | 230 struct PP_CompletionCallback callback); |
221 }; | 231 }; |
222 | 232 |
223 typedef struct PPB_VideoDecoder_1_0 PPB_VideoDecoder; | |
224 | |
225 struct PPB_VideoDecoder_0_1 { | 233 struct PPB_VideoDecoder_0_1 { |
226 PP_Resource (*Create)(PP_Instance instance); | 234 PP_Resource (*Create)(PP_Instance instance); |
227 PP_Bool (*IsVideoDecoder)(PP_Resource resource); | 235 PP_Bool (*IsVideoDecoder)(PP_Resource resource); |
228 int32_t (*Initialize)(PP_Resource video_decoder, | 236 int32_t (*Initialize)(PP_Resource video_decoder, |
229 PP_Resource graphics3d_context, | 237 PP_Resource graphics3d_context, |
230 PP_VideoProfile profile, | 238 PP_VideoProfile profile, |
231 PP_Bool allow_software_fallback, | 239 PP_Bool allow_software_fallback, |
232 struct PP_CompletionCallback callback); | 240 struct PP_CompletionCallback callback); |
233 int32_t (*Decode)(PP_Resource video_decoder, | 241 int32_t (*Decode)(PP_Resource video_decoder, |
234 uint32_t decode_id, | 242 uint32_t decode_id, |
(...skipping 27 matching lines...) Expand all Loading... |
262 int32_t (*GetPicture)(PP_Resource video_decoder, | 270 int32_t (*GetPicture)(PP_Resource video_decoder, |
263 struct PP_VideoPicture_0_1* picture, | 271 struct PP_VideoPicture_0_1* picture, |
264 struct PP_CompletionCallback callback); | 272 struct PP_CompletionCallback callback); |
265 void (*RecyclePicture)(PP_Resource video_decoder, | 273 void (*RecyclePicture)(PP_Resource video_decoder, |
266 const struct PP_VideoPicture* picture); | 274 const struct PP_VideoPicture* picture); |
267 int32_t (*Flush)(PP_Resource video_decoder, | 275 int32_t (*Flush)(PP_Resource video_decoder, |
268 struct PP_CompletionCallback callback); | 276 struct PP_CompletionCallback callback); |
269 int32_t (*Reset)(PP_Resource video_decoder, | 277 int32_t (*Reset)(PP_Resource video_decoder, |
270 struct PP_CompletionCallback callback); | 278 struct PP_CompletionCallback callback); |
271 }; | 279 }; |
| 280 |
| 281 struct PPB_VideoDecoder_1_0 { |
| 282 PP_Resource (*Create)(PP_Instance instance); |
| 283 PP_Bool (*IsVideoDecoder)(PP_Resource resource); |
| 284 int32_t (*Initialize)(PP_Resource video_decoder, |
| 285 PP_Resource graphics3d_context, |
| 286 PP_VideoProfile profile, |
| 287 PP_HardwareAcceleration acceleration, |
| 288 struct PP_CompletionCallback callback); |
| 289 int32_t (*Decode)(PP_Resource video_decoder, |
| 290 uint32_t decode_id, |
| 291 uint32_t size, |
| 292 const void* buffer, |
| 293 struct PP_CompletionCallback callback); |
| 294 int32_t (*GetPicture)(PP_Resource video_decoder, |
| 295 struct PP_VideoPicture* picture, |
| 296 struct PP_CompletionCallback callback); |
| 297 void (*RecyclePicture)(PP_Resource video_decoder, |
| 298 const struct PP_VideoPicture* picture); |
| 299 int32_t (*Flush)(PP_Resource video_decoder, |
| 300 struct PP_CompletionCallback callback); |
| 301 int32_t (*Reset)(PP_Resource video_decoder, |
| 302 struct PP_CompletionCallback callback); |
| 303 }; |
| 304 |
| 305 typedef struct PPB_VideoDecoder_1_0 PPB_VideoDecoder; |
272 /** | 306 /** |
273 * @} | 307 * @} |
274 */ | 308 */ |
275 | 309 |
276 #endif /* PPAPI_C_PPB_VIDEO_DECODER_H_ */ | 310 #endif /* PPAPI_C_PPB_VIDEO_DECODER_H_ */ |
277 | 311 |
OLD | NEW |