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 Fri Jul 11 18:06:37 2014. */ | 6 /* From ppb_video_decoder.idl modified Fri Aug 22 13:42:35 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_resource.h" | 16 #include "ppapi/c/pp_resource.h" |
17 #include "ppapi/c/pp_size.h" | 17 #include "ppapi/c/pp_size.h" |
18 #include "ppapi/c/pp_stdint.h" | 18 #include "ppapi/c/pp_stdint.h" |
19 | 19 |
20 #define PPB_VIDEODECODER_INTERFACE_0_1 "PPB_VideoDecoder;0.1" /* dev */ | 20 #define PPB_VIDEODECODER_INTERFACE_0_1 "PPB_VideoDecoder;0.1" /* dev */ |
| 21 #define PPB_VIDEODECODER_INTERFACE_0_2 "PPB_VideoDecoder;0.2" /* dev */ |
21 /** | 22 /** |
22 * @file | 23 * @file |
23 * This file defines the <code>PPB_VideoDecoder</code> interface. | 24 * This file defines the <code>PPB_VideoDecoder</code> interface. |
24 */ | 25 */ |
25 | 26 |
26 | 27 |
27 /** | 28 /** |
28 * @addtogroup Interfaces | 29 * @addtogroup Interfaces |
29 * @{ | 30 * @{ |
30 */ | 31 */ |
(...skipping 13 matching lines...) Expand all Loading... |
44 * - Call Reset() to quickly stop the decoder (e.g. to implement Seek) and wait | 45 * - Call Reset() to quickly stop the decoder (e.g. to implement Seek) and wait |
45 * for the callback before restarting decoding at another point. | 46 * for the callback before restarting decoding at another point. |
46 * - To destroy the decoder, the plugin should release all of its references to | 47 * - To destroy the decoder, the plugin should release all of its references to |
47 * it. Any pending callbacks will abort before the decoder is destroyed. | 48 * it. Any pending callbacks will abort before the decoder is destroyed. |
48 * | 49 * |
49 * Available video codecs vary by platform. | 50 * Available video codecs vary by platform. |
50 * All: theora, vorbis, vp8. | 51 * All: theora, vorbis, vp8. |
51 * Chrome and ChromeOS: aac, h264. | 52 * Chrome and ChromeOS: aac, h264. |
52 * ChromeOS: mpeg4. | 53 * ChromeOS: mpeg4. |
53 */ | 54 */ |
54 struct PPB_VideoDecoder_0_1 { /* dev */ | 55 struct PPB_VideoDecoder_0_2 { /* dev */ |
55 /** | 56 /** |
56 * Creates a new video decoder resource. | 57 * Creates a new video decoder resource. |
57 * | 58 * |
58 * @param[in] instance A <code>PP_Instance</code> identifying the instance | 59 * @param[in] instance A <code>PP_Instance</code> identifying the instance |
59 * with the video decoder. | 60 * with the video decoder. |
60 * | 61 * |
61 * @return A <code>PP_Resource</code> corresponding to a video decoder if | 62 * @return A <code>PP_Resource</code> corresponding to a video decoder if |
62 * successful or 0 otherwise. | 63 * successful or 0 otherwise. |
63 */ | 64 */ |
64 PP_Resource (*Create)(PP_Instance instance); | 65 PP_Resource (*Create)(PP_Instance instance); |
(...skipping 10 matching lines...) Expand all Loading... |
75 /** | 76 /** |
76 * Initializes a video decoder resource. This should be called after Create() | 77 * Initializes a video decoder resource. This should be called after Create() |
77 * and before any other functions. | 78 * and before any other functions. |
78 * | 79 * |
79 * @param[in] video_decoder A <code>PP_Resource</code> identifying the video | 80 * @param[in] video_decoder A <code>PP_Resource</code> identifying the video |
80 * decoder. | 81 * decoder. |
81 * @param[in] graphics3d_context A <code>PPB_Graphics3D</code> resource to use | 82 * @param[in] graphics3d_context A <code>PPB_Graphics3D</code> resource to use |
82 * during decoding. | 83 * during decoding. |
83 * @param[in] profile A <code>PP_VideoProfile</code> specifying the video | 84 * @param[in] profile A <code>PP_VideoProfile</code> specifying the video |
84 * codec profile. | 85 * codec profile. |
85 * @param[in] allow_software_fallback A <code>PP_Bool</code> specifying | 86 * @param[in] acceleration A <code>PP_HardwareAcceleration</code> specifying |
86 * whether the decoder can fall back to software decoding if a suitable | 87 * whether to use a hardware accelerated or a software implementation. |
87 * hardware decoder isn't available. | |
88 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | 88 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon |
89 * completion. | 89 * completion. |
90 * | 90 * |
91 * @return An int32_t containing an error code from <code>pp_errors.h</code>. | 91 * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
92 * Returns PP_ERROR_NOTSUPPORTED if video decoding is not available, or the | 92 * Returns PP_ERROR_NOTSUPPORTED if video decoding is not available, or the |
93 * requested profile is not supported. In this case, the client may call | 93 * requested profile is not supported. In this case, the client may call |
94 * Initialize() again with different parameters to find a good configuration. | 94 * Initialize() again with different parameters to find a good configuration. |
95 */ | 95 */ |
96 int32_t (*Initialize)(PP_Resource video_decoder, | 96 int32_t (*Initialize)(PP_Resource video_decoder, |
97 PP_Resource graphics3d_context, | 97 PP_Resource graphics3d_context, |
98 PP_VideoProfile profile, | 98 PP_VideoProfile profile, |
99 PP_Bool allow_software_fallback, | 99 PP_HardwareAcceleration acceleration, |
100 struct PP_CompletionCallback callback); | 100 struct PP_CompletionCallback callback); |
101 /** | 101 /** |
102 * Decodes a bitstream buffer. Copies |size| bytes of data from the plugin's | 102 * Decodes a bitstream buffer. Copies |size| bytes of data from the plugin's |
103 * |buffer|. The plugin should wait until the decoder signals completion by | 103 * |buffer|. The plugin should wait until the decoder signals completion by |
104 * returning PP_OK or by running |callback| before calling Decode() again. | 104 * returning PP_OK or by running |callback| before calling Decode() again. |
105 * | 105 * |
106 * In general, each bitstream buffer should contain a demuxed bitstream frame | 106 * In general, each bitstream buffer should contain a demuxed bitstream frame |
107 * for the selected video codec. For example, H264 decoders expect to receive | 107 * for the selected video codec. For example, H264 decoders expect to receive |
108 * one AnnexB NAL unit, including the 4 byte start code prefix, while VP8 | 108 * one AnnexB NAL unit, including the 4 byte start code prefix, while VP8 |
109 * decoders expect to receive a bitstream frame without the IVF frame header. | 109 * decoders expect to receive a bitstream frame without the IVF frame header. |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 * decoder. | 207 * decoder. |
208 * @param[in] callback A <code>PP_CompletionCallback</code> to be called on | 208 * @param[in] callback A <code>PP_CompletionCallback</code> to be called on |
209 * completion. | 209 * completion. |
210 * | 210 * |
211 * @return An int32_t containing an error code from <code>pp_errors.h</code>. | 211 * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
212 * Returns PP_ERROR_FAILED if the decoder isn't initialized. | 212 * Returns PP_ERROR_FAILED if the decoder isn't initialized. |
213 */ | 213 */ |
214 int32_t (*Reset)(PP_Resource video_decoder, | 214 int32_t (*Reset)(PP_Resource video_decoder, |
215 struct PP_CompletionCallback callback); | 215 struct PP_CompletionCallback callback); |
216 }; | 216 }; |
| 217 |
| 218 struct PPB_VideoDecoder_0_1 { /* dev */ |
| 219 PP_Resource (*Create)(PP_Instance instance); |
| 220 PP_Bool (*IsVideoDecoder)(PP_Resource resource); |
| 221 int32_t (*Initialize)(PP_Resource video_decoder, |
| 222 PP_Resource graphics3d_context, |
| 223 PP_VideoProfile profile, |
| 224 PP_Bool allow_software_fallback, |
| 225 struct PP_CompletionCallback callback); |
| 226 int32_t (*Decode)(PP_Resource video_decoder, |
| 227 uint32_t decode_id, |
| 228 uint32_t size, |
| 229 const void* buffer, |
| 230 struct PP_CompletionCallback callback); |
| 231 int32_t (*GetPicture)(PP_Resource video_decoder, |
| 232 struct PP_VideoPicture* picture, |
| 233 struct PP_CompletionCallback callback); |
| 234 void (*RecyclePicture)(PP_Resource video_decoder, |
| 235 const struct PP_VideoPicture* picture); |
| 236 int32_t (*Flush)(PP_Resource video_decoder, |
| 237 struct PP_CompletionCallback callback); |
| 238 int32_t (*Reset)(PP_Resource video_decoder, |
| 239 struct PP_CompletionCallback callback); |
| 240 }; |
217 /** | 241 /** |
218 * @} | 242 * @} |
219 */ | 243 */ |
220 | 244 |
221 #endif /* PPAPI_C_PPB_VIDEO_DECODER_H_ */ | 245 #endif /* PPAPI_C_PPB_VIDEO_DECODER_H_ */ |
222 | 246 |
OLD | NEW |