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 /** | 6 /** |
7 * This file defines the <code>PPB_VideoDecoder</code> interface. | 7 * This file defines the <code>PPB_VideoDecoder</code> interface. |
8 */ | 8 */ |
9 | 9 |
10 [generate_thunk] | 10 [generate_thunk] |
11 | 11 |
12 label Chrome { | 12 label Chrome { |
13 /** Though not labeled 'channel=dev', 0.1 is a still a 'Dev' only API. */ | 13 /** Though not labeled 'channel=dev', 0.1 is a still a 'Dev' only API. */ |
14 M36 = 0.1, | 14 M36 = 0.1, |
15 M39 = 0.2, | 15 M39 = 0.2, |
16 M40 = 1.0 | 16 M40 = 1.0, |
| 17 [channel=dev] M46 = 1.1 |
17 }; | 18 }; |
18 | 19 |
19 /** | 20 /** |
20 * Video decoder interface. | 21 * Video decoder interface. |
21 * | 22 * |
22 * Typical usage: | 23 * Typical usage: |
23 * - Call Create() to create a new video decoder resource. | 24 * - Call Create() to create a new video decoder resource. |
24 * - Call Initialize() to initialize it with a 3d graphics context and the | 25 * - Call Initialize() to initialize it with a 3d graphics context and the |
25 * desired codec profile. | 26 * desired codec profile. |
26 * - Call Decode() continuously (waiting for each previous call to complete) to | 27 * - Call Decode() continuously (waiting for each previous call to complete) to |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 */ | 115 */ |
115 [version = 0.2] | 116 [version = 0.2] |
116 int32_t Initialize( | 117 int32_t Initialize( |
117 [in] PP_Resource video_decoder, | 118 [in] PP_Resource video_decoder, |
118 [in] PP_Resource graphics3d_context, | 119 [in] PP_Resource graphics3d_context, |
119 [in] PP_VideoProfile profile, | 120 [in] PP_VideoProfile profile, |
120 [in] PP_HardwareAcceleration acceleration, | 121 [in] PP_HardwareAcceleration acceleration, |
121 [in] PP_CompletionCallback callback); | 122 [in] PP_CompletionCallback callback); |
122 | 123 |
123 /** | 124 /** |
| 125 * Initializes a video decoder resource. This should be called after Create() |
| 126 * and before any other functions. |
| 127 * |
| 128 * @param[in] video_decoder A <code>PP_Resource</code> identifying the video |
| 129 * decoder. |
| 130 * @param[in] graphics3d_context A <code>PPB_Graphics3D</code> resource to use |
| 131 * during decoding. |
| 132 * @param[in] profile A <code>PP_VideoProfile</code> specifying the video |
| 133 * codec profile. |
| 134 * @param[in] acceleration A <code>PP_HardwareAcceleration</code> specifying |
| 135 * whether to use a hardware accelerated or a software implementation. |
| 136 * @param[in] min_picture_count A count of pictures the plugin would like to |
| 137 * have in flight. This is effectively the number of times the plugin can |
| 138 * call GetPicture() and get a decoded frame without calling |
| 139 * RecyclePicture(). The decoder has its own internal minimum count, and will |
| 140 * take the larger of its internal and this value. A client that doesn't care |
| 141 * can therefore just pass in zero for this argument. |
| 142 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon |
| 143 * completion. |
| 144 * |
| 145 * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
| 146 * Returns PP_ERROR_NOTSUPPORTED if video decoding is not available, or the |
| 147 * requested profile is not supported. In this case, the client may call |
| 148 * Initialize() again with different parameters to find a good configuration. |
| 149 * Returns PP_ERROR_BADARGUMENT if the requested minimum picture count is |
| 150 * unreasonably large. |
| 151 */ |
| 152 [version = 1.1] |
| 153 int32_t Initialize( |
| 154 [in] PP_Resource video_decoder, |
| 155 [in] PP_Resource graphics3d_context, |
| 156 [in] PP_VideoProfile profile, |
| 157 [in] PP_HardwareAcceleration acceleration, |
| 158 [in] uint32_t min_picture_count, |
| 159 [in] PP_CompletionCallback callback); |
| 160 |
| 161 /** |
124 * Decodes a bitstream buffer. Copies |size| bytes of data from the plugin's | 162 * Decodes a bitstream buffer. Copies |size| bytes of data from the plugin's |
125 * |buffer|. The plugin should wait until the decoder signals completion by | 163 * |buffer|. The plugin should wait until the decoder signals completion by |
126 * returning PP_OK or by running |callback| before calling Decode() again. | 164 * returning PP_OK or by running |callback| before calling Decode() again. |
127 * | 165 * |
128 * In general, each bitstream buffer should contain a demuxed bitstream frame | 166 * In general, each bitstream buffer should contain a demuxed bitstream frame |
129 * for the selected video codec. For example, H264 decoders expect to receive | 167 * for the selected video codec. For example, H264 decoders expect to receive |
130 * one AnnexB NAL unit, including the 4 byte start code prefix, while VP8 | 168 * one AnnexB NAL unit, including the 4 byte start code prefix, while VP8 |
131 * decoders expect to receive a bitstream frame without the IVF frame header. | 169 * decoders expect to receive a bitstream frame without the IVF frame header. |
132 * | 170 * |
133 * If the call to Decode() eventually results in a picture, the |decode_id| | 171 * If the call to Decode() eventually results in a picture, the |decode_id| |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 * @param[in] callback A <code>PP_CompletionCallback</code> to be called on | 303 * @param[in] callback A <code>PP_CompletionCallback</code> to be called on |
266 * completion. | 304 * completion. |
267 * | 305 * |
268 * @return An int32_t containing an error code from <code>pp_errors.h</code>. | 306 * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
269 * Returns PP_ERROR_FAILED if the decoder isn't initialized. | 307 * Returns PP_ERROR_FAILED if the decoder isn't initialized. |
270 */ | 308 */ |
271 int32_t Reset( | 309 int32_t Reset( |
272 [in] PP_Resource video_decoder, | 310 [in] PP_Resource video_decoder, |
273 [in] PP_CompletionCallback callback); | 311 [in] PP_CompletionCallback callback); |
274 }; | 312 }; |
OLD | NEW |