summaryrefslogtreecommitdiffstats
path: root/native_client_sdk/doc_generated/pepper_beta/c/struct_p_p_b___video_decoder__1__0.html
blob: c8dd1348484b7077056653f4937d7846e042b6e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
{{+bindTo:partials.standard_nacl_api}}
<h1>PPB_VideoDecoder Struct Reference</h1>
<div id="doxygen-ref">
{{- dummy div to appease doxygen -}}
  <div>
<!-- Generated by Doxygen 1.7.6.1 -->


</div>
<!--header-->
<div class="contents">
<!-- doxytag: class="PPB_VideoDecoder" --><h2>
Data Fields</h2><table class="memberdecls">

<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___video_decoder__1__0.html#a81200f606c493c49a70190ca86ac135c">Create</a> )(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___video_decoder__1__0.html#ae2329143c44bd5eaae507074c1fc0ec3">IsVideoDecoder</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> resource)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___video_decoder__1__0.html#ad115b7705b740b771e7dd9acb2b36f16">Initialize</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_decoder, <a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> graphics3d_context, <a class="el" href="group___enums.html#ga4d50d27186f68b2de578e82162206fea">PP_VideoProfile</a> profile, <a class="el" href="group___enums.html#ga6a3fd7e22be02521243b52481afadae5">PP_HardwareAcceleration</a> acceleration, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___video_decoder__1__0.html#acc8662be4232325abc545d1ae8b79366">Decode</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_decoder, uint32_t decode_id, uint32_t size, const void *buffer, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___video_decoder__1__0.html#a2351fe0cf66513ee77df0c1a22306c3e">GetPicture</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_decoder, struct <a class="el" href="struct_p_p___video_picture.html">PP_VideoPicture</a> *picture, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___video_decoder__1__0.html#ac7e6b42866d42eade96519f32755509f">RecyclePicture</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_decoder, const struct <a class="el" href="struct_p_p___video_picture.html">PP_VideoPicture</a> *picture)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___video_decoder__1__0.html#adf3ea0876d1ba686266589a04532e86d">Flush</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_decoder, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___video_decoder__1__0.html#aeb4704cfd86a4ad737af19e77f3ffd5e">Reset</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_decoder, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td></tr>
</table>
<hr /><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Video decoder interface. </p>
<p>Typical usage:</p>
<ul>
<li>Call <a class="el" href="struct_p_p_b___video_decoder__1__0.html#a81200f606c493c49a70190ca86ac135c" title="Creates a new video decoder resource.">Create()</a> to create a new video decoder resource.</li>
<li>Call <a class="el" href="struct_p_p_b___video_decoder__1__0.html#ad115b7705b740b771e7dd9acb2b36f16" title="Initializes a video decoder resource.">Initialize()</a> to initialize it with a 3d graphics context and the desired codec profile.</li>
<li>Call <a class="el" href="struct_p_p_b___video_decoder__1__0.html#acc8662be4232325abc545d1ae8b79366" title="Decodes a bitstream buffer.">Decode()</a> continuously (waiting for each previous call to complete) to push bitstream buffers to the decoder.</li>
<li>Call <a class="el" href="struct_p_p_b___video_decoder__1__0.html#a2351fe0cf66513ee77df0c1a22306c3e" title="Gets the next picture from the decoder.">GetPicture()</a> continuously (waiting for each previous call to complete) to pull decoded pictures from the decoder.</li>
<li>Call <a class="el" href="struct_p_p_b___video_decoder__1__0.html#adf3ea0876d1ba686266589a04532e86d" title="Flushes the decoder.">Flush()</a> to signal end of stream to the decoder and perform shutdown when it completes.</li>
<li>Call <a class="el" href="struct_p_p_b___video_decoder__1__0.html#aeb4704cfd86a4ad737af19e77f3ffd5e" title="Resets the decoder as quickly as possible.">Reset()</a> to quickly stop the decoder (e.g. to implement Seek) and wait for the callback before restarting decoding at another point.</li>
<li>To destroy the decoder, the plugin should release all of its references to it. Any pending callbacks will abort before the decoder is destroyed.</li>
</ul>
<p>Available video codecs vary by platform. All: theora, vorbis, vp8. Chrome and ChromeOS: aac, h264. ChromeOS: mpeg4. </p>
</div><hr /><h2>Field Documentation</h2>
<a class="anchor" id="a81200f606c493c49a70190ca86ac135c"></a><!-- doxytag: member="PPB_VideoDecoder::Create" ref="a81200f606c493c49a70190ca86ac135c" args=")(PP_Instance instance)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a>(* <a class="el" href="struct_p_p_b___video_decoder__1__0.html#a81200f606c493c49a70190ca86ac135c">PPB_VideoDecoder::Create</a>)(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Creates a new video decoder resource. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">instance</td><td>A <code>PP_Instance</code> identifying the instance with the video decoder.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_Resource</code> corresponding to a video decoder if successful or 0 otherwise. </dd></dl>
</div>
</div>
<a class="anchor" id="acc8662be4232325abc545d1ae8b79366"></a><!-- doxytag: member="PPB_VideoDecoder::Decode" ref="acc8662be4232325abc545d1ae8b79366" args=")(PP_Resource video_decoder, uint32_t decode_id, uint32_t size, const void *buffer, struct PP_CompletionCallback callback)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___video_decoder__1__0.html#acc8662be4232325abc545d1ae8b79366">PPB_VideoDecoder::Decode</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_decoder, uint32_t decode_id, uint32_t size, const void *buffer, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Decodes a bitstream buffer. </p>
<p>Copies |size| bytes of data from the plugin's |buffer|. The plugin should wait until the decoder signals completion by returning PP_OK or by running |callback| before calling <a class="el" href="struct_p_p_b___video_decoder__1__0.html#acc8662be4232325abc545d1ae8b79366" title="Decodes a bitstream buffer.">Decode()</a> again.</p>
<p>In general, each bitstream buffer should contain a demuxed bitstream frame for the selected video codec. For example, H264 decoders expect to receive one AnnexB NAL unit, including the 4 byte start code prefix, while VP8 decoders expect to receive a bitstream frame without the IVF frame header.</p>
<p>If the call to <a class="el" href="struct_p_p_b___video_decoder__1__0.html#acc8662be4232325abc545d1ae8b79366" title="Decodes a bitstream buffer.">Decode()</a> eventually results in a picture, the |decode_id| parameter is copied into the returned picture. The plugin can use this to associate decoded pictures with <a class="el" href="struct_p_p_b___video_decoder__1__0.html#acc8662be4232325abc545d1ae8b79366" title="Decodes a bitstream buffer.">Decode()</a> calls (e.g. to assign timestamps or frame numbers to pictures.) This value is opaque to the API so the plugin is free to pass any value.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">video_decoder</td><td>A <code>PP_Resource</code> identifying the video decoder. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">decode_id</td><td>An optional value, chosen by the plugin, that can be used to associate calls to <a class="el" href="struct_p_p_b___video_decoder__1__0.html#acc8662be4232325abc545d1ae8b79366" title="Decodes a bitstream buffer.">Decode()</a> with decoded pictures returned by <a class="el" href="struct_p_p_b___video_decoder__1__0.html#a2351fe0cf66513ee77df0c1a22306c3e" title="Gets the next picture from the decoder.">GetPicture()</a>. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Buffer size in bytes. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">buffer</td><td>Starting address of buffer. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>A <code><a class="el" href="struct_p_p___completion_callback.html" title="PP_CompletionCallback is a common mechanism for supporting potentially asynchronous calls in browser ...">PP_CompletionCallback</a></code> to be called on completion.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. Returns PP_ERROR_FAILED if the decoder isn't initialized or if a <a class="el" href="struct_p_p_b___video_decoder__1__0.html#adf3ea0876d1ba686266589a04532e86d" title="Flushes the decoder.">Flush()</a> or <a class="el" href="struct_p_p_b___video_decoder__1__0.html#aeb4704cfd86a4ad737af19e77f3ffd5e" title="Resets the decoder as quickly as possible.">Reset()</a> call is pending. Returns PP_ERROR_INPROGRESS if there is another <a class="el" href="struct_p_p_b___video_decoder__1__0.html#acc8662be4232325abc545d1ae8b79366" title="Decodes a bitstream buffer.">Decode()</a> call pending. Returns PP_ERROR_NOMEMORY if a bitstream buffer can't be created. Returns PP_ERROR_ABORTED when <a class="el" href="struct_p_p_b___video_decoder__1__0.html#aeb4704cfd86a4ad737af19e77f3ffd5e" title="Resets the decoder as quickly as possible.">Reset()</a> is called while <a class="el" href="struct_p_p_b___video_decoder__1__0.html#acc8662be4232325abc545d1ae8b79366" title="Decodes a bitstream buffer.">Decode()</a> is pending. </dd></dl>
</div>
</div>
<a class="anchor" id="adf3ea0876d1ba686266589a04532e86d"></a><!-- doxytag: member="PPB_VideoDecoder::Flush" ref="adf3ea0876d1ba686266589a04532e86d" args=")(PP_Resource video_decoder, struct PP_CompletionCallback callback)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___video_decoder__1__0.html#adf3ea0876d1ba686266589a04532e86d">PPB_VideoDecoder::Flush</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_decoder, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Flushes the decoder. </p>
<p>The plugin should call <a class="el" href="struct_p_p_b___video_decoder__1__0.html#adf3ea0876d1ba686266589a04532e86d" title="Flushes the decoder.">Flush()</a> when it reaches the end of its video stream in order to stop cleanly. The decoder will run any pending <a class="el" href="struct_p_p_b___video_decoder__1__0.html#acc8662be4232325abc545d1ae8b79366" title="Decodes a bitstream buffer.">Decode()</a> call to completion. The plugin should make no further calls to the decoder other than <a class="el" href="struct_p_p_b___video_decoder__1__0.html#a2351fe0cf66513ee77df0c1a22306c3e" title="Gets the next picture from the decoder.">GetPicture()</a> and <a class="el" href="struct_p_p_b___video_decoder__1__0.html#ac7e6b42866d42eade96519f32755509f" title="Recycles a picture that the plugin has received from the decoder.">RecyclePicture()</a> until the decoder signals completion by running |callback|. Just before completion, any pending <a class="el" href="struct_p_p_b___video_decoder__1__0.html#a2351fe0cf66513ee77df0c1a22306c3e" title="Gets the next picture from the decoder.">GetPicture()</a> call will complete by running its callback with result PP_ERROR_ABORTED to signal that no more pictures are available. Any pictures held by the plugin remain valid during and after the flush and should be recycled back to the decoder.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">video_decoder</td><td>A <code>PP_Resource</code> identifying the video decoder. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>A <code><a class="el" href="struct_p_p___completion_callback.html" title="PP_CompletionCallback is a common mechanism for supporting potentially asynchronous calls in browser ...">PP_CompletionCallback</a></code> to be called on completion.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. Returns PP_ERROR_FAILED if the decoder isn't initialized. </dd></dl>
</div>
</div>
<a class="anchor" id="a2351fe0cf66513ee77df0c1a22306c3e"></a><!-- doxytag: member="PPB_VideoDecoder::GetPicture" ref="a2351fe0cf66513ee77df0c1a22306c3e" args=")(PP_Resource video_decoder, struct PP_VideoPicture *picture, struct PP_CompletionCallback callback)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___video_decoder__1__0.html#a2351fe0cf66513ee77df0c1a22306c3e">PPB_VideoDecoder::GetPicture</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_decoder, struct <a class="el" href="struct_p_p___video_picture.html">PP_VideoPicture</a> *picture, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gets the next picture from the decoder. </p>
<p>The picture is valid after the decoder signals completion by returning PP_OK or running |callback|. The plugin can call <a class="el" href="struct_p_p_b___video_decoder__1__0.html#a2351fe0cf66513ee77df0c1a22306c3e" title="Gets the next picture from the decoder.">GetPicture()</a> again after the decoder signals completion. When the plugin is finished using the picture, it should return it to the system by calling <a class="el" href="struct_p_p_b___video_decoder__1__0.html#ac7e6b42866d42eade96519f32755509f" title="Recycles a picture that the plugin has received from the decoder.">RecyclePicture()</a>.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">video_decoder</td><td>A <code>PP_Resource</code> identifying the video decoder. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">picture</td><td>A <code><a class="el" href="struct_p_p___video_picture.html" title="Struct describing a decoded video picture.">PP_VideoPicture</a></code> to hold the decoded picture. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>A <code><a class="el" href="struct_p_p___completion_callback.html" title="PP_CompletionCallback is a common mechanism for supporting potentially asynchronous calls in browser ...">PP_CompletionCallback</a></code> to be called on completion.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. Returns PP_ERROR_FAILED if the decoder isn't initialized or if a <a class="el" href="struct_p_p_b___video_decoder__1__0.html#aeb4704cfd86a4ad737af19e77f3ffd5e" title="Resets the decoder as quickly as possible.">Reset()</a> call is pending. Returns PP_ERROR_INPROGRESS if there is another <a class="el" href="struct_p_p_b___video_decoder__1__0.html#a2351fe0cf66513ee77df0c1a22306c3e" title="Gets the next picture from the decoder.">GetPicture()</a> call pending. Returns PP_ERROR_ABORTED when <a class="el" href="struct_p_p_b___video_decoder__1__0.html#aeb4704cfd86a4ad737af19e77f3ffd5e" title="Resets the decoder as quickly as possible.">Reset()</a> is called, or if a call to <a class="el" href="struct_p_p_b___video_decoder__1__0.html#adf3ea0876d1ba686266589a04532e86d" title="Flushes the decoder.">Flush()</a> completes while <a class="el" href="struct_p_p_b___video_decoder__1__0.html#a2351fe0cf66513ee77df0c1a22306c3e" title="Gets the next picture from the decoder.">GetPicture()</a> is pending. </dd></dl>
</div>
</div>
<a class="anchor" id="ad115b7705b740b771e7dd9acb2b36f16"></a><!-- doxytag: member="PPB_VideoDecoder::Initialize" ref="ad115b7705b740b771e7dd9acb2b36f16" args=")(PP_Resource video_decoder, PP_Resource graphics3d_context, PP_VideoProfile profile, PP_HardwareAcceleration acceleration, struct PP_CompletionCallback callback)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___video_decoder__1__0.html#ad115b7705b740b771e7dd9acb2b36f16">PPB_VideoDecoder::Initialize</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_decoder, <a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> graphics3d_context, <a class="el" href="group___enums.html#ga4d50d27186f68b2de578e82162206fea">PP_VideoProfile</a> profile, <a class="el" href="group___enums.html#ga6a3fd7e22be02521243b52481afadae5">PP_HardwareAcceleration</a> acceleration, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initializes a video decoder resource. </p>
<p>This should be called after <a class="el" href="struct_p_p_b___video_decoder__1__0.html#a81200f606c493c49a70190ca86ac135c" title="Creates a new video decoder resource.">Create()</a> and before any other functions.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">video_decoder</td><td>A <code>PP_Resource</code> identifying the video decoder. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">graphics3d_context</td><td>A <code>PPB_Graphics3D</code> resource to use during decoding. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">profile</td><td>A <code>PP_VideoProfile</code> specifying the video codec profile. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">acceleration</td><td>A <code>PP_HardwareAcceleration</code> specifying whether to use a hardware accelerated or a software implementation. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>A <code><a class="el" href="struct_p_p___completion_callback.html" title="PP_CompletionCallback is a common mechanism for supporting potentially asynchronous calls in browser ...">PP_CompletionCallback</a></code> to be called upon completion.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. Returns PP_ERROR_NOTSUPPORTED if video decoding is not available, or the requested profile is not supported. In this case, the client may call <a class="el" href="struct_p_p_b___video_decoder__1__0.html#ad115b7705b740b771e7dd9acb2b36f16" title="Initializes a video decoder resource.">Initialize()</a> again with different parameters to find a good configuration. </dd></dl>
</div>
</div>
<a class="anchor" id="ae2329143c44bd5eaae507074c1fc0ec3"></a><!-- doxytag: member="PPB_VideoDecoder::IsVideoDecoder" ref="ae2329143c44bd5eaae507074c1fc0ec3" args=")(PP_Resource resource)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* <a class="el" href="struct_p_p_b___video_decoder__1__0.html#ae2329143c44bd5eaae507074c1fc0ec3">PPB_VideoDecoder::IsVideoDecoder</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> resource)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Determines if the given resource is a video decoder. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">resource</td><td>A <code>PP_Resource</code> identifying a resource.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><code>PP_TRUE</code> if the resource is a <code>PPB_VideoDecoder</code>, <code>PP_FALSE</code> if the resource is invalid or some other type. </dd></dl>
</div>
</div>
<a class="anchor" id="ac7e6b42866d42eade96519f32755509f"></a><!-- doxytag: member="PPB_VideoDecoder::RecyclePicture" ref="ac7e6b42866d42eade96519f32755509f" args=")(PP_Resource video_decoder, const struct PP_VideoPicture *picture)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void(* <a class="el" href="struct_p_p_b___video_decoder__1__0.html#ac7e6b42866d42eade96519f32755509f">PPB_VideoDecoder::RecyclePicture</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_decoder, const struct <a class="el" href="struct_p_p___video_picture.html">PP_VideoPicture</a> *picture)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Recycles a picture that the plugin has received from the decoder. </p>
<p>The plugin should call this as soon as it has finished using the texture so the decoder can decode more pictures.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">video_decoder</td><td>A <code>PP_Resource</code> identifying the video decoder. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">picture</td><td>A <code><a class="el" href="struct_p_p___video_picture.html" title="Struct describing a decoded video picture.">PP_VideoPicture</a></code> to return to the decoder. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="aeb4704cfd86a4ad737af19e77f3ffd5e"></a><!-- doxytag: member="PPB_VideoDecoder::Reset" ref="aeb4704cfd86a4ad737af19e77f3ffd5e" args=")(PP_Resource video_decoder, struct PP_CompletionCallback callback)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___video_decoder__1__0.html#aeb4704cfd86a4ad737af19e77f3ffd5e">PPB_VideoDecoder::Reset</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_decoder, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Resets the decoder as quickly as possible. </p>
<p>The plugin can call <a class="el" href="struct_p_p_b___video_decoder__1__0.html#aeb4704cfd86a4ad737af19e77f3ffd5e" title="Resets the decoder as quickly as possible.">Reset()</a> to skip to another position in the video stream. After <a class="el" href="struct_p_p_b___video_decoder__1__0.html#aeb4704cfd86a4ad737af19e77f3ffd5e" title="Resets the decoder as quickly as possible.">Reset()</a> returns, any pending calls to <a class="el" href="struct_p_p_b___video_decoder__1__0.html#acc8662be4232325abc545d1ae8b79366" title="Decodes a bitstream buffer.">Decode()</a> and <a class="el" href="struct_p_p_b___video_decoder__1__0.html#a2351fe0cf66513ee77df0c1a22306c3e" title="Gets the next picture from the decoder.">GetPicture()</a>) abort, causing their callbacks to run with PP_ERROR_ABORTED. The plugin should not make further calls to the decoder other than <a class="el" href="struct_p_p_b___video_decoder__1__0.html#ac7e6b42866d42eade96519f32755509f" title="Recycles a picture that the plugin has received from the decoder.">RecyclePicture()</a> until the decoder signals completion by running |callback|. Any pictures held by the plugin remain valid during and after the reset and should be recycled back to the decoder.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">video_decoder</td><td>A <code>PP_Resource</code> identifying the video decoder. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>A <code><a class="el" href="struct_p_p___completion_callback.html" title="PP_CompletionCallback is a common mechanism for supporting potentially asynchronous calls in browser ...">PP_CompletionCallback</a></code> to be called on completion.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. Returns PP_ERROR_FAILED if the decoder isn't initialized. </dd></dl>
</div>
</div>
<hr />The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="ppb__video__decoder_8h.html">ppb_video_decoder.h</a></li>
</ul>
</div><!-- contents -->
</div>
{{/partials.standard_nacl_api}}