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 [channel=dev] M36 = 0.1 | 13 [channel=dev] M36 = 0.1, |
14 [channel=dev] M39 = 0.2 | |
14 }; | 15 }; |
15 | 16 |
16 /** | 17 /** |
17 * Video decoder interface. | 18 * Video decoder interface. |
18 * | 19 * |
19 * Typical usage: | 20 * Typical usage: |
20 * - Call Create() to create a new video decoder resource. | 21 * - Call Create() to create a new video decoder resource. |
21 * - Call Initialize() to initialize it with a 3d graphics context and the | 22 * - Call Initialize() to initialize it with a 3d graphics context and the |
22 * desired codec profile. | 23 * desired codec profile. |
23 * - Call Decode() continuously (waiting for each previous call to complete) to | 24 * - Call Decode() continuously (waiting for each previous call to complete) to |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
83 * Initialize() again with different parameters to find a good configuration. | 84 * Initialize() again with different parameters to find a good configuration. |
84 */ | 85 */ |
85 int32_t Initialize( | 86 int32_t Initialize( |
86 [in] PP_Resource video_decoder, | 87 [in] PP_Resource video_decoder, |
87 [in] PP_Resource graphics3d_context, | 88 [in] PP_Resource graphics3d_context, |
88 [in] PP_VideoProfile profile, | 89 [in] PP_VideoProfile profile, |
89 [in] PP_Bool allow_software_fallback, | 90 [in] PP_Bool allow_software_fallback, |
90 [in] PP_CompletionCallback callback); | 91 [in] PP_CompletionCallback callback); |
91 | 92 |
92 /** | 93 /** |
94 * Initializes a video decoder resource. This should be called after Create() | |
95 * and before any other functions. | |
96 * | |
97 * @param[in] video_decoder A <code>PP_Resource</code> identifying the video | |
98 * decoder. | |
99 * @param[in] graphics3d_context A <code>PPB_Graphics3D</code> resource to use | |
100 * during decoding. | |
101 * @param[in] profile A <code>PP_VideoProfile</code> specifying the video | |
102 * codec profile. | |
103 * @param[in] hardware_acceleration A <code>PP_HardwareAcceleration</code> | |
teravest
2014/08/22 18:32:37
nit: The parameter name is acceleration, not hardw
bbudge
2014/08/22 21:24:52
Done.
| |
104 * specifying whether to use a hardware accelerated or a software resource | |
105 * implementation. | |
106 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | |
107 * completion. | |
108 * | |
109 * @return An int32_t containing an error code from <code>pp_errors.h</code>. | |
110 * Returns PP_ERROR_NOTSUPPORTED if video decoding is not available, or the | |
111 * requested profile is not supported. In this case, the client may call | |
112 * Initialize() again with different parameters to find a good configuration. | |
teravest
2014/08/22 18:32:37
Is it safe to call Initialize() again if the call
bbudge
2014/08/22 21:24:52
This only works after failing with PP_ERROR_NOTSUP
| |
113 */ | |
114 [version = 0.2] | |
115 int32_t Initialize( | |
116 [in] PP_Resource video_decoder, | |
117 [in] PP_Resource graphics3d_context, | |
118 [in] PP_VideoProfile profile, | |
119 [in] PP_HardwareAcceleration acceleration, | |
120 [in] PP_CompletionCallback callback); | |
121 | |
122 /** | |
93 * Decodes a bitstream buffer. Copies |size| bytes of data from the plugin's | 123 * Decodes a bitstream buffer. Copies |size| bytes of data from the plugin's |
94 * |buffer|. The plugin should wait until the decoder signals completion by | 124 * |buffer|. The plugin should wait until the decoder signals completion by |
95 * returning PP_OK or by running |callback| before calling Decode() again. | 125 * returning PP_OK or by running |callback| before calling Decode() again. |
96 * | 126 * |
97 * In general, each bitstream buffer should contain a demuxed bitstream frame | 127 * In general, each bitstream buffer should contain a demuxed bitstream frame |
98 * for the selected video codec. For example, H264 decoders expect to receive | 128 * for the selected video codec. For example, H264 decoders expect to receive |
99 * one AnnexB NAL unit, including the 4 byte start code prefix, while VP8 | 129 * one AnnexB NAL unit, including the 4 byte start code prefix, while VP8 |
100 * decoders expect to receive a bitstream frame without the IVF frame header. | 130 * decoders expect to receive a bitstream frame without the IVF frame header. |
101 * | 131 * |
102 * If the call to Decode() eventually results in a picture, the |decode_id| | 132 * If the call to Decode() eventually results in a picture, the |decode_id| |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
207 * @param[in] callback A <code>PP_CompletionCallback</code> to be called on | 237 * @param[in] callback A <code>PP_CompletionCallback</code> to be called on |
208 * completion. | 238 * completion. |
209 * | 239 * |
210 * @return An int32_t containing an error code from <code>pp_errors.h</code>. | 240 * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
211 * Returns PP_ERROR_FAILED if the decoder isn't initialized. | 241 * Returns PP_ERROR_FAILED if the decoder isn't initialized. |
212 */ | 242 */ |
213 int32_t Reset( | 243 int32_t Reset( |
214 [in] PP_Resource video_decoder, | 244 [in] PP_Resource video_decoder, |
215 [in] PP_CompletionCallback callback); | 245 [in] PP_CompletionCallback callback); |
216 }; | 246 }; |
OLD | NEW |