| 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 Wed Jun 24 11:44:18 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 PPB_VIDEODECODER_INTERFACE_1_0 | 25 #define PPB_VIDEODECODER_INTERFACE_1_1 "PPB_VideoDecoder;1.1" |
| 26 #define PPB_VIDEODECODER_INTERFACE PPB_VIDEODECODER_INTERFACE_1_1 |
| 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 |
| 35 * @{ | 36 * @{ |
| (...skipping 14 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 { |
| 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; | 233 typedef struct PPB_VideoDecoder_1_1 PPB_VideoDecoder; |
| 224 | 234 |
| 225 struct PPB_VideoDecoder_0_1 { | 235 struct PPB_VideoDecoder_0_1 { |
| 226 PP_Resource (*Create)(PP_Instance instance); | 236 PP_Resource (*Create)(PP_Instance instance); |
| 227 PP_Bool (*IsVideoDecoder)(PP_Resource resource); | 237 PP_Bool (*IsVideoDecoder)(PP_Resource resource); |
| 228 int32_t (*Initialize)(PP_Resource video_decoder, | 238 int32_t (*Initialize)(PP_Resource video_decoder, |
| 229 PP_Resource graphics3d_context, | 239 PP_Resource graphics3d_context, |
| 230 PP_VideoProfile profile, | 240 PP_VideoProfile profile, |
| 231 PP_Bool allow_software_fallback, | 241 PP_Bool allow_software_fallback, |
| 232 struct PP_CompletionCallback callback); | 242 struct PP_CompletionCallback callback); |
| 233 int32_t (*Decode)(PP_Resource video_decoder, | 243 int32_t (*Decode)(PP_Resource video_decoder, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 262 int32_t (*GetPicture)(PP_Resource video_decoder, | 272 int32_t (*GetPicture)(PP_Resource video_decoder, |
| 263 struct PP_VideoPicture_0_1* picture, | 273 struct PP_VideoPicture_0_1* picture, |
| 264 struct PP_CompletionCallback callback); | 274 struct PP_CompletionCallback callback); |
| 265 void (*RecyclePicture)(PP_Resource video_decoder, | 275 void (*RecyclePicture)(PP_Resource video_decoder, |
| 266 const struct PP_VideoPicture* picture); | 276 const struct PP_VideoPicture* picture); |
| 267 int32_t (*Flush)(PP_Resource video_decoder, | 277 int32_t (*Flush)(PP_Resource video_decoder, |
| 268 struct PP_CompletionCallback callback); | 278 struct PP_CompletionCallback callback); |
| 269 int32_t (*Reset)(PP_Resource video_decoder, | 279 int32_t (*Reset)(PP_Resource video_decoder, |
| 270 struct PP_CompletionCallback callback); | 280 struct PP_CompletionCallback callback); |
| 271 }; | 281 }; |
| 282 |
| 283 struct PPB_VideoDecoder_1_0 { |
| 284 PP_Resource (*Create)(PP_Instance instance); |
| 285 PP_Bool (*IsVideoDecoder)(PP_Resource resource); |
| 286 int32_t (*Initialize)(PP_Resource video_decoder, |
| 287 PP_Resource graphics3d_context, |
| 288 PP_VideoProfile profile, |
| 289 PP_HardwareAcceleration acceleration, |
| 290 struct PP_CompletionCallback callback); |
| 291 int32_t (*Decode)(PP_Resource video_decoder, |
| 292 uint32_t decode_id, |
| 293 uint32_t size, |
| 294 const void* buffer, |
| 295 struct PP_CompletionCallback callback); |
| 296 int32_t (*GetPicture)(PP_Resource video_decoder, |
| 297 struct PP_VideoPicture* picture, |
| 298 struct PP_CompletionCallback callback); |
| 299 void (*RecyclePicture)(PP_Resource video_decoder, |
| 300 const struct PP_VideoPicture* picture); |
| 301 int32_t (*Flush)(PP_Resource video_decoder, |
| 302 struct PP_CompletionCallback callback); |
| 303 int32_t (*Reset)(PP_Resource video_decoder, |
| 304 struct PP_CompletionCallback callback); |
| 305 }; |
| 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 |