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 Mon Sep 8 16:40:15 2014. */ | 6 /* From ppb_video_decoder.idl modified Tue Nov 4 13:25:47 2014. */ |
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" |
| 17 #include "ppapi/c/pp_rect.h" |
16 #include "ppapi/c/pp_resource.h" | 18 #include "ppapi/c/pp_resource.h" |
17 #include "ppapi/c/pp_size.h" | 19 #include "ppapi/c/pp_size.h" |
18 #include "ppapi/c/pp_stdint.h" | 20 #include "ppapi/c/pp_stdint.h" |
19 | 21 |
20 #define PPB_VIDEODECODER_INTERFACE_0_1 "PPB_VideoDecoder;0.1" | 22 #define PPB_VIDEODECODER_INTERFACE_0_1 "PPB_VideoDecoder;0.1" |
21 #define PPB_VIDEODECODER_INTERFACE_0_2 "PPB_VideoDecoder;0.2" | 23 #define PPB_VIDEODECODER_INTERFACE_0_2 "PPB_VideoDecoder;0.2" |
22 #define PPB_VIDEODECODER_INTERFACE PPB_VIDEODECODER_INTERFACE_0_2 | 24 #define PPB_VIDEODECODER_INTERFACE_0_3 "PPB_VideoDecoder;0.3" |
| 25 #define PPB_VIDEODECODER_INTERFACE PPB_VIDEODECODER_INTERFACE_0_3 |
23 | 26 |
24 /** | 27 /** |
25 * @file | 28 * @file |
26 * This file defines the <code>PPB_VideoDecoder</code> interface. | 29 * This file defines the <code>PPB_VideoDecoder</code> interface. |
27 */ | 30 */ |
28 | 31 |
29 | 32 |
30 /** | 33 /** |
31 * @addtogroup Interfaces | 34 * @addtogroup Interfaces |
32 * @{ | 35 * @{ |
(...skipping 14 matching lines...) Expand all Loading... |
47 * - Call Reset() to quickly stop the decoder (e.g. to implement Seek) and wait | 50 * - Call Reset() to quickly stop the decoder (e.g. to implement Seek) and wait |
48 * for the callback before restarting decoding at another point. | 51 * for the callback before restarting decoding at another point. |
49 * - To destroy the decoder, the plugin should release all of its references to | 52 * - To destroy the decoder, the plugin should release all of its references to |
50 * it. Any pending callbacks will abort before the decoder is destroyed. | 53 * it. Any pending callbacks will abort before the decoder is destroyed. |
51 * | 54 * |
52 * Available video codecs vary by platform. | 55 * Available video codecs vary by platform. |
53 * All: theora, vorbis, vp8. | 56 * All: theora, vorbis, vp8. |
54 * Chrome and ChromeOS: aac, h264. | 57 * Chrome and ChromeOS: aac, h264. |
55 * ChromeOS: mpeg4. | 58 * ChromeOS: mpeg4. |
56 */ | 59 */ |
57 struct PPB_VideoDecoder_0_2 { | 60 struct PPB_VideoDecoder_0_3 { |
58 /** | 61 /** |
59 * Creates a new video decoder resource. | 62 * Creates a new video decoder resource. |
60 * | 63 * |
61 * @param[in] instance A <code>PP_Instance</code> identifying the instance | 64 * @param[in] instance A <code>PP_Instance</code> identifying the instance |
62 * with the video decoder. | 65 * with the video decoder. |
63 * | 66 * |
64 * @return A <code>PP_Resource</code> corresponding to a video decoder if | 67 * @return A <code>PP_Resource</code> corresponding to a video decoder if |
65 * successful or 0 otherwise. | 68 * successful or 0 otherwise. |
66 */ | 69 */ |
67 PP_Resource (*Create)(PP_Instance instance); | 70 PP_Resource (*Create)(PP_Instance instance); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 * Gets the next picture from the decoder. The picture is valid after the | 145 * Gets the next picture from the decoder. The picture is valid after the |
143 * decoder signals completion by returning PP_OK or running |callback|. The | 146 * decoder signals completion by returning PP_OK or running |callback|. The |
144 * plugin can call GetPicture() again after the decoder signals completion. | 147 * plugin can call GetPicture() again after the decoder signals completion. |
145 * When the plugin is finished using the picture, it should return it to the | 148 * When the plugin is finished using the picture, it should return it to the |
146 * system by calling RecyclePicture(). | 149 * system by calling RecyclePicture(). |
147 * | 150 * |
148 * @param[in] video_decoder A <code>PP_Resource</code> identifying the video | 151 * @param[in] video_decoder A <code>PP_Resource</code> identifying the video |
149 * decoder. | 152 * decoder. |
150 * @param[out] picture A <code>PP_VideoPicture</code> to hold the decoded | 153 * @param[out] picture A <code>PP_VideoPicture</code> to hold the decoded |
151 * picture. | 154 * picture. |
| 155 * @param[out] visible_rect A <code>PP_Rect</code> to hold the visible |
| 156 * subrectangle of the picture. The plugin should only display the visible |
| 157 * area of the picture. |
152 * @param[in] callback A <code>PP_CompletionCallback</code> to be called on | 158 * @param[in] callback A <code>PP_CompletionCallback</code> to be called on |
153 * completion. | 159 * completion. |
154 * | 160 * |
155 * @return An int32_t containing an error code from <code>pp_errors.h</code>. | 161 * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
156 * Returns PP_ERROR_FAILED if the decoder isn't initialized or if a Reset() | 162 * Returns PP_ERROR_FAILED if the decoder isn't initialized or if a Reset() |
157 * call is pending. | 163 * call is pending. |
158 * Returns PP_ERROR_INPROGRESS if there is another GetPicture() call pending. | 164 * Returns PP_ERROR_INPROGRESS if there is another GetPicture() call pending. |
159 * Returns PP_ERROR_ABORTED when Reset() is called, or if a call to Flush() | 165 * Returns PP_ERROR_ABORTED when Reset() is called, or if a call to Flush() |
160 * completes while GetPicture() is pending. | 166 * completes while GetPicture() is pending. |
161 */ | 167 */ |
162 int32_t (*GetPicture)(PP_Resource video_decoder, | 168 int32_t (*GetPicture)(PP_Resource video_decoder, |
163 struct PP_VideoPicture* picture, | 169 struct PP_VideoPicture* picture, |
| 170 struct PP_Rect* visible_rect, |
164 struct PP_CompletionCallback callback); | 171 struct PP_CompletionCallback callback); |
165 /** | 172 /** |
166 * Recycles a picture that the plugin has received from the decoder. | 173 * Recycles a picture that the plugin has received from the decoder. |
167 * The plugin should call this as soon as it has finished using the texture so | 174 * The plugin should call this as soon as it has finished using the texture so |
168 * the decoder can decode more pictures. | 175 * the decoder can decode more pictures. |
169 * | 176 * |
170 * @param[in] video_decoder A <code>PP_Resource</code> identifying the video | 177 * @param[in] video_decoder A <code>PP_Resource</code> identifying the video |
171 * decoder. | 178 * decoder. |
172 * @param[in] picture A <code>PP_VideoPicture</code> to return to | 179 * @param[in] picture A <code>PP_VideoPicture</code> to return to |
173 * the decoder. | 180 * the decoder. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 * @param[in] callback A <code>PP_CompletionCallback</code> to be called on | 217 * @param[in] callback A <code>PP_CompletionCallback</code> to be called on |
211 * completion. | 218 * completion. |
212 * | 219 * |
213 * @return An int32_t containing an error code from <code>pp_errors.h</code>. | 220 * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
214 * Returns PP_ERROR_FAILED if the decoder isn't initialized. | 221 * Returns PP_ERROR_FAILED if the decoder isn't initialized. |
215 */ | 222 */ |
216 int32_t (*Reset)(PP_Resource video_decoder, | 223 int32_t (*Reset)(PP_Resource video_decoder, |
217 struct PP_CompletionCallback callback); | 224 struct PP_CompletionCallback callback); |
218 }; | 225 }; |
219 | 226 |
220 typedef struct PPB_VideoDecoder_0_2 PPB_VideoDecoder; | 227 typedef struct PPB_VideoDecoder_0_3 PPB_VideoDecoder; |
221 | 228 |
222 struct PPB_VideoDecoder_0_1 { | 229 struct PPB_VideoDecoder_0_1 { |
223 PP_Resource (*Create)(PP_Instance instance); | 230 PP_Resource (*Create)(PP_Instance instance); |
224 PP_Bool (*IsVideoDecoder)(PP_Resource resource); | 231 PP_Bool (*IsVideoDecoder)(PP_Resource resource); |
225 int32_t (*Initialize)(PP_Resource video_decoder, | 232 int32_t (*Initialize)(PP_Resource video_decoder, |
226 PP_Resource graphics3d_context, | 233 PP_Resource graphics3d_context, |
227 PP_VideoProfile profile, | 234 PP_VideoProfile profile, |
228 PP_Bool allow_software_fallback, | 235 PP_Bool allow_software_fallback, |
229 struct PP_CompletionCallback callback); | 236 struct PP_CompletionCallback callback); |
230 int32_t (*Decode)(PP_Resource video_decoder, | 237 int32_t (*Decode)(PP_Resource video_decoder, |
231 uint32_t decode_id, | 238 uint32_t decode_id, |
232 uint32_t size, | 239 uint32_t size, |
233 const void* buffer, | 240 const void* buffer, |
234 struct PP_CompletionCallback callback); | 241 struct PP_CompletionCallback callback); |
235 int32_t (*GetPicture)(PP_Resource video_decoder, | 242 int32_t (*GetPicture)(PP_Resource video_decoder, |
236 struct PP_VideoPicture* picture, | 243 struct PP_VideoPicture* picture, |
237 struct PP_CompletionCallback callback); | 244 struct PP_CompletionCallback callback); |
238 void (*RecyclePicture)(PP_Resource video_decoder, | 245 void (*RecyclePicture)(PP_Resource video_decoder, |
239 const struct PP_VideoPicture* picture); | 246 const struct PP_VideoPicture* picture); |
240 int32_t (*Flush)(PP_Resource video_decoder, | 247 int32_t (*Flush)(PP_Resource video_decoder, |
241 struct PP_CompletionCallback callback); | 248 struct PP_CompletionCallback callback); |
242 int32_t (*Reset)(PP_Resource video_decoder, | 249 int32_t (*Reset)(PP_Resource video_decoder, |
243 struct PP_CompletionCallback callback); | 250 struct PP_CompletionCallback callback); |
244 }; | 251 }; |
| 252 |
| 253 struct PPB_VideoDecoder_0_2 { |
| 254 PP_Resource (*Create)(PP_Instance instance); |
| 255 PP_Bool (*IsVideoDecoder)(PP_Resource resource); |
| 256 int32_t (*Initialize)(PP_Resource video_decoder, |
| 257 PP_Resource graphics3d_context, |
| 258 PP_VideoProfile profile, |
| 259 PP_HardwareAcceleration acceleration, |
| 260 struct PP_CompletionCallback callback); |
| 261 int32_t (*Decode)(PP_Resource video_decoder, |
| 262 uint32_t decode_id, |
| 263 uint32_t size, |
| 264 const void* buffer, |
| 265 struct PP_CompletionCallback callback); |
| 266 int32_t (*GetPicture)(PP_Resource video_decoder, |
| 267 struct PP_VideoPicture* picture, |
| 268 struct PP_CompletionCallback callback); |
| 269 void (*RecyclePicture)(PP_Resource video_decoder, |
| 270 const struct PP_VideoPicture* picture); |
| 271 int32_t (*Flush)(PP_Resource video_decoder, |
| 272 struct PP_CompletionCallback callback); |
| 273 int32_t (*Reset)(PP_Resource video_decoder, |
| 274 struct PP_CompletionCallback callback); |
| 275 }; |
245 /** | 276 /** |
246 * @} | 277 * @} |
247 */ | 278 */ |
248 | 279 |
249 #endif /* PPAPI_C_PPB_VIDEO_DECODER_H_ */ | 280 #endif /* PPAPI_C_PPB_VIDEO_DECODER_H_ */ |
250 | 281 |
OLD | NEW |