classpp_1_1_video_decoder.html revision f8ee788a64d60abd8f2d742a5fdedde054ecd910
1{{+bindTo:partials.standard_nacl_api}}
2<h1>pp::VideoDecoder Class Reference</h1>
3<div id="doxygen-ref">
4{{- dummy div to appease doxygen -}}
5  <div>
6<!-- Generated by Doxygen 1.7.6.1 -->
7
8
9
10</div>
11<!--header-->
12<div class="contents">
13<!-- doxytag: class="pp::VideoDecoder" --><!-- doxytag: inherits="pp::Resource" --><div class="dynheader">
14Inheritance diagram for pp::VideoDecoder:</div>
15<div class="dyncontent">
16<div class="center"><img src="classpp_1_1_video_decoder__inherit__graph.png" border="0" usemap="#pp_1_1_video_decoder_inherit__map" alt="Inheritance graph" /></div>
17<map name="pp_1_1_video_decoder_inherit__map" id="pp_1_1_video_decoder_inherit__map">
18<area shape="rect" id="node2" href="classpp_1_1_resource.html" title="A reference counted module resource." alt="" coords="21,5,125,35"></area></map>
19<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
20<p><a href="classpp_1_1_video_decoder-members.html">List of all members.</a></p>
21<h2>
22Public Member Functions</h2><table class="memberdecls">
23
24<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_video_decoder.html#afc9613c960f58ff4c97804da4645cd64">VideoDecoder</a> ()</td></tr>
25<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_video_decoder.html#a5c7b1010b42e179cf51e55266eb1491a">VideoDecoder</a> (const <a class="el" href="classpp_1_1_instance_handle.html">InstanceHandle</a> &amp;instance)</td></tr>
26<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_video_decoder.html#a0eec2949dd73ef6d52b6782cee3b427d">VideoDecoder</a> (const <a class="el" href="classpp_1_1_video_decoder.html">VideoDecoder</a> &amp;other)</td></tr>
27<tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_video_decoder.html#a8f576cfbd03dc0ef97a49c9f0a667a16">Initialize</a> (const <a class="el" href="classpp_1_1_graphics3_d.html">Graphics3D</a> &amp;graphics3d_context, PP_VideoProfile profile, bool allow_software_fallback, const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;callback)</td></tr>
28<tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_video_decoder.html#a2f1a48cf6d2f1854b20e6a747c9b03e3">Decode</a> (uint32_t decode_id, uint32_t size, const void *buffer, const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;callback)</td></tr>
29<tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_video_decoder.html#aec1a1bc95b8d3eea64b942af48dff02a">GetPicture</a> (const <a class="el" href="classpp_1_1_completion_callback_with_output.html">CompletionCallbackWithOutput</a>&lt; PP_VideoPicture &gt; &amp;callback)</td></tr>
30<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_video_decoder.html#a7b9c4917ebd205572a0fe69a34f1bfd9">RecyclePicture</a> (const PP_VideoPicture &amp;picture)</td></tr>
31<tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_video_decoder.html#adb59ebce58f83b1c27e9c427596fb366">Flush</a> (const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;callback)</td></tr>
32<tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_video_decoder.html#aa05481906b07e929c9567bc22a48917a">Reset</a> (const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;callback)</td></tr>
33</table>
34<hr /><a name="details" id="details"></a><h2>Detailed Description</h2>
35<div class="textblock"><p>Video decoder interface. </p>
36<p>Typical usage:</p>
37<ul>
38<li>Call Create() to create a new video decoder resource.</li>
39<li>Call <a class="el" href="classpp_1_1_video_decoder.html#a8f576cfbd03dc0ef97a49c9f0a667a16" title="Initializes a video decoder resource.">Initialize()</a> to initialize it with a 3d graphics context and the desired codec profile.</li>
40<li>Call <a class="el" href="classpp_1_1_video_decoder.html#a2f1a48cf6d2f1854b20e6a747c9b03e3" title="Decodes a bitstream buffer.">Decode()</a> continuously (waiting for each previous call to complete) to push bitstream buffers to the decoder.</li>
41<li>Call <a class="el" href="classpp_1_1_video_decoder.html#aec1a1bc95b8d3eea64b942af48dff02a" 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>
42<li>Call <a class="el" href="classpp_1_1_video_decoder.html#adb59ebce58f83b1c27e9c427596fb366" title="Flushes the decoder.">Flush()</a> to signal end of stream to the decoder and perform shutdown when it completes.</li>
43<li>Call <a class="el" href="classpp_1_1_video_decoder.html#aa05481906b07e929c9567bc22a48917a" 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>
44<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>
45</ul>
46<p>Available video codecs vary by platform. All: theora, vorbis, vp8. Chrome and ChromeOS: aac, h264. ChromeOS: mpeg4. </p>
47</div><hr /><h2>Constructor &amp; Destructor Documentation</h2>
48<a class="anchor" id="afc9613c960f58ff4c97804da4645cd64"></a><!-- doxytag: member="pp::VideoDecoder::VideoDecoder" ref="afc9613c960f58ff4c97804da4645cd64" args="()" -->
49<div class="memitem">
50<div class="memproto">
51<table class="memname">
52<tr>
53<td class="memname"><a class="el" href="classpp_1_1_video_decoder.html#afc9613c960f58ff4c97804da4645cd64">pp::VideoDecoder::VideoDecoder</a> </td>
54<td>(</td>
55<td class="paramname"></td><td>)</td>
56<td></td>
57</tr>
58</table>
59</div>
60<div class="memdoc">
61<p>Default constructor for creating an <a class="el" href="classpp_1_1_resource.html#a859068e34cdc2dc0b78754c255323aa9" title="This functions determines if this resource is invalid or uninitialized.">is_null()</a> <code><a class="el" href="classpp_1_1_video_decoder.html" title="Video decoder interface.">VideoDecoder</a></code> object. </p>
62</div>
63</div>
64<a class="anchor" id="a5c7b1010b42e179cf51e55266eb1491a"></a><!-- doxytag: member="pp::VideoDecoder::VideoDecoder" ref="a5c7b1010b42e179cf51e55266eb1491a" args="(const InstanceHandle &amp;instance)" -->
65<div class="memitem">
66<div class="memproto">
67<table class="memname">
68<tr>
69<td class="memname"><a class="el" href="classpp_1_1_video_decoder.html#afc9613c960f58ff4c97804da4645cd64">pp::VideoDecoder::VideoDecoder</a> </td>
70<td>(</td>
71<td class="paramtype">const <a class="el" href="classpp_1_1_instance_handle.html">InstanceHandle</a> &amp;&#160;</td>
72<td class="paramname"><em>instance</em></td><td>)</td>
73<td><code> [explicit]</code></td>
74</tr>
75</table>
76</div>
77<div class="memdoc">
78<p>A constructor used to create a <code><a class="el" href="classpp_1_1_video_decoder.html" title="Video decoder interface.">VideoDecoder</a></code> and associate it with the provided <code><a class="el" href="classpp_1_1_instance.html">Instance</a></code>. </p>
79<dl class="params"><dt><b>Parameters:</b></dt><dd>
80<table class="params">
81<tr><td class="paramdir">[in]</td><td class="paramname">instance</td><td>The instance with which this resource will be associated. </td></tr>
82</table>
83</dd>
84</dl>
85</div>
86</div>
87<a class="anchor" id="a0eec2949dd73ef6d52b6782cee3b427d"></a><!-- doxytag: member="pp::VideoDecoder::VideoDecoder" ref="a0eec2949dd73ef6d52b6782cee3b427d" args="(const VideoDecoder &amp;other)" -->
88<div class="memitem">
89<div class="memproto">
90<table class="memname">
91<tr>
92<td class="memname"><a class="el" href="classpp_1_1_video_decoder.html#afc9613c960f58ff4c97804da4645cd64">pp::VideoDecoder::VideoDecoder</a> </td>
93<td>(</td>
94<td class="paramtype">const <a class="el" href="classpp_1_1_video_decoder.html">VideoDecoder</a> &amp;&#160;</td>
95<td class="paramname"><em>other</em></td><td>)</td>
96<td></td>
97</tr>
98</table>
99</div>
100<div class="memdoc">
101<p>The copy constructor for <code><a class="el" href="classpp_1_1_video_decoder.html" title="Video decoder interface.">VideoDecoder</a></code>. </p>
102<dl class="params"><dt><b>Parameters:</b></dt><dd>
103<table class="params">
104<tr><td class="paramdir">[in]</td><td class="paramname">other</td><td>A reference to a <code><a class="el" href="classpp_1_1_video_decoder.html" title="Video decoder interface.">VideoDecoder</a></code>. </td></tr>
105</table>
106</dd>
107</dl>
108</div>
109</div>
110<hr /><h2>Member Function Documentation</h2>
111<a class="anchor" id="a2f1a48cf6d2f1854b20e6a747c9b03e3"></a><!-- doxytag: member="pp::VideoDecoder::Decode" ref="a2f1a48cf6d2f1854b20e6a747c9b03e3" args="(uint32_t decode_id, uint32_t size, const void *buffer, const CompletionCallback &amp;callback)" -->
112<div class="memitem">
113<div class="memproto">
114<table class="memname">
115<tr>
116<td class="memname">int32_t <a class="el" href="classpp_1_1_video_decoder.html#a2f1a48cf6d2f1854b20e6a747c9b03e3">pp::VideoDecoder::Decode</a> </td>
117<td>(</td>
118<td class="paramtype">uint32_t&#160;</td>
119<td class="paramname"><em>decode_id</em>, </td>
120</tr>
121<tr>
122<td class="paramkey"></td>
123<td></td>
124<td class="paramtype">uint32_t&#160;</td>
125<td class="paramname"><em>size</em>, </td>
126</tr>
127<tr>
128<td class="paramkey"></td>
129<td></td>
130<td class="paramtype">const void *&#160;</td>
131<td class="paramname"><em>buffer</em>, </td>
132</tr>
133<tr>
134<td class="paramkey"></td>
135<td></td>
136<td class="paramtype">const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;&#160;</td>
137<td class="paramname"><em>callback</em>&#160;</td>
138</tr>
139<tr>
140<td></td>
141<td>)</td>
142<td></td><td></td>
143</tr>
144</table>
145</div>
146<div class="memdoc">
147<p>Decodes a bitstream buffer. </p>
148<p>Copies |size| bytes of data from the plugin's |buffer|. The plugin should maintain the buffer and not call <a class="el" href="classpp_1_1_video_decoder.html#a2f1a48cf6d2f1854b20e6a747c9b03e3" title="Decodes a bitstream buffer.">Decode()</a> again until the decoder signals completion by returning PP_OK or by running |callback|.</p>
149<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>
150<p>If the call to <a class="el" href="classpp_1_1_video_decoder.html#a2f1a48cf6d2f1854b20e6a747c9b03e3" 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="classpp_1_1_video_decoder.html#a2f1a48cf6d2f1854b20e6a747c9b03e3" 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>
151<dl class="params"><dt><b>Parameters:</b></dt><dd>
152<table class="params">
153<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="classpp_1_1_video_decoder.html#a2f1a48cf6d2f1854b20e6a747c9b03e3" title="Decodes a bitstream buffer.">Decode()</a> with decoded pictures returned by <a class="el" href="classpp_1_1_video_decoder.html#aec1a1bc95b8d3eea64b942af48dff02a" title="Gets the next picture from the decoder.">GetPicture()</a>. </td></tr>
154<tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Buffer size in bytes. </td></tr>
155<tr><td class="paramdir">[in]</td><td class="paramname">buffer</td><td>Starting address of buffer. </td></tr>
156<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>A <code><a class="el" href="classpp_1_1_completion_callback.html" title="This API enables you to implement and receive callbacks when Pepper operations complete asynchronousl...">CompletionCallback</a></code> to be called on completion.</td></tr>
157</table>
158</dd>
159</dl>
160<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code>pp_errors.h</code>. </dd></dl>
161</div>
162</div>
163<a class="anchor" id="adb59ebce58f83b1c27e9c427596fb366"></a><!-- doxytag: member="pp::VideoDecoder::Flush" ref="adb59ebce58f83b1c27e9c427596fb366" args="(const CompletionCallback &amp;callback)" -->
164<div class="memitem">
165<div class="memproto">
166<table class="memname">
167<tr>
168<td class="memname">int32_t <a class="el" href="classpp_1_1_video_decoder.html#adb59ebce58f83b1c27e9c427596fb366">pp::VideoDecoder::Flush</a> </td>
169<td>(</td>
170<td class="paramtype">const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;&#160;</td>
171<td class="paramname"><em>callback</em></td><td>)</td>
172<td></td>
173</tr>
174</table>
175</div>
176<div class="memdoc">
177<p>Flushes the decoder. </p>
178<p>The plugin should call this when it reaches the end of its video stream in order to stop cleanly. The decoder will run all pending calls to completion. The plugin should make no further calls to the decoder other than <a class="el" href="classpp_1_1_video_decoder.html#aec1a1bc95b8d3eea64b942af48dff02a" title="Gets the next picture from the decoder.">GetPicture()</a> and <a class="el" href="classpp_1_1_video_decoder.html#a7b9c4917ebd205572a0fe69a34f1bfd9" title="Recycles a picture that the plugin has received from the decoder.">RecyclePicture()</a> until the decoder signals completion by running the callback. Just before completion, any pending <a class="el" href="classpp_1_1_video_decoder.html#aec1a1bc95b8d3eea64b942af48dff02a" title="Gets the next picture from the decoder.">GetPicture()</a> call will complete by running the callback with result PP_ERROR_ABORTED to signal that no more pictures are available.</p>
179<dl class="params"><dt><b>Parameters:</b></dt><dd>
180<table class="params">
181<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>A <code><a class="el" href="classpp_1_1_completion_callback.html" title="This API enables you to implement and receive callbacks when Pepper operations complete asynchronousl...">CompletionCallback</a></code> to be called on completion.</td></tr>
182</table>
183</dd>
184</dl>
185<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code>pp_errors.h</code>. </dd></dl>
186</div>
187</div>
188<a class="anchor" id="aec1a1bc95b8d3eea64b942af48dff02a"></a><!-- doxytag: member="pp::VideoDecoder::GetPicture" ref="aec1a1bc95b8d3eea64b942af48dff02a" args="(const CompletionCallbackWithOutput&lt; PP_VideoPicture &gt; &amp;callback)" -->
189<div class="memitem">
190<div class="memproto">
191<table class="memname">
192<tr>
193<td class="memname">int32_t <a class="el" href="classpp_1_1_video_decoder.html#aec1a1bc95b8d3eea64b942af48dff02a">pp::VideoDecoder::GetPicture</a> </td>
194<td>(</td>
195<td class="paramtype">const <a class="el" href="classpp_1_1_completion_callback_with_output.html">CompletionCallbackWithOutput</a>&lt; PP_VideoPicture &gt; &amp;&#160;</td>
196<td class="paramname"><em>callback</em></td><td>)</td>
197<td></td>
198</tr>
199</table>
200</div>
201<div class="memdoc">
202<p>Gets the next picture from the decoder. </p>
203<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="classpp_1_1_video_decoder.html#aec1a1bc95b8d3eea64b942af48dff02a" 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="classpp_1_1_video_decoder.html#a7b9c4917ebd205572a0fe69a34f1bfd9" title="Recycles a picture that the plugin has received from the decoder.">RecyclePicture()</a>.</p>
204<dl class="params"><dt><b>Parameters:</b></dt><dd>
205<table class="params">
206<tr><td class="paramdir">[in]</td><td class="paramname">video_decoder</td><td>A <code>PP_Resource</code> identifying the video decoder. </td></tr>
207<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>A <code><a class="el" href="classpp_1_1_completion_callback_with_output.html" title="A CompletionCallbackWithOutput defines a completion callback that additionally stores a pointer to so...">CompletionCallbackWithOutput</a></code> to be called on completion, and on success, to hold the picture descriptor.</td></tr>
208</table>
209</dd>
210</dl>
211<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code>pp_errors.h</code>. Returns PP_OK if a picture is available. Returns PP_ERROR_ABORTED when <a class="el" href="classpp_1_1_video_decoder.html#aa05481906b07e929c9567bc22a48917a" title="Resets the decoder as quickly as possible.">Reset()</a> is called, or if a call to <a class="el" href="classpp_1_1_video_decoder.html#adb59ebce58f83b1c27e9c427596fb366" title="Flushes the decoder.">Flush()</a> completes while <a class="el" href="classpp_1_1_video_decoder.html#aec1a1bc95b8d3eea64b942af48dff02a" title="Gets the next picture from the decoder.">GetPicture()</a> is pending. </dd></dl>
212</div>
213</div>
214<a class="anchor" id="a8f576cfbd03dc0ef97a49c9f0a667a16"></a><!-- doxytag: member="pp::VideoDecoder::Initialize" ref="a8f576cfbd03dc0ef97a49c9f0a667a16" args="(const Graphics3D &amp;graphics3d_context, PP_VideoProfile profile, bool allow_software_fallback, const CompletionCallback &amp;callback)" -->
215<div class="memitem">
216<div class="memproto">
217<table class="memname">
218<tr>
219<td class="memname">int32_t <a class="el" href="classpp_1_1_video_decoder.html#a8f576cfbd03dc0ef97a49c9f0a667a16">pp::VideoDecoder::Initialize</a> </td>
220<td>(</td>
221<td class="paramtype">const <a class="el" href="classpp_1_1_graphics3_d.html">Graphics3D</a> &amp;&#160;</td>
222<td class="paramname"><em>graphics3d_context</em>, </td>
223</tr>
224<tr>
225<td class="paramkey"></td>
226<td></td>
227<td class="paramtype">PP_VideoProfile&#160;</td>
228<td class="paramname"><em>profile</em>, </td>
229</tr>
230<tr>
231<td class="paramkey"></td>
232<td></td>
233<td class="paramtype">bool&#160;</td>
234<td class="paramname"><em>allow_software_fallback</em>, </td>
235</tr>
236<tr>
237<td class="paramkey"></td>
238<td></td>
239<td class="paramtype">const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;&#160;</td>
240<td class="paramname"><em>callback</em>&#160;</td>
241</tr>
242<tr>
243<td></td>
244<td>)</td>
245<td></td><td></td>
246</tr>
247</table>
248</div>
249<div class="memdoc">
250<p>Initializes a video decoder resource. </p>
251<p>This should be called after Create() and before any other functions.</p>
252<dl class="params"><dt><b>Parameters:</b></dt><dd>
253<table class="params">
254<tr><td class="paramdir">[in]</td><td class="paramname">video_decoder</td><td>A <code>PP_Resource</code> identifying the video decoder. </td></tr>
255<tr><td class="paramdir">[in]</td><td class="paramname">profile</td><td>A <code>PP_VideoProfile</code> specifying the video codec profile. </td></tr>
256<tr><td class="paramdir">[in]</td><td class="paramname">allow_software_fallback</td><td>A <code>PP_Bool</code> specifying whether the decoder can fall back to software decoding if a suitable hardware decoder isn't available. </td></tr>
257<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>A <code><a class="el" href="classpp_1_1_completion_callback.html" title="This API enables you to implement and receive callbacks when Pepper operations complete asynchronousl...">CompletionCallback</a></code> to be called on completion.</td></tr>
258</table>
259</dd>
260</dl>
261<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code>pp_errors.h</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="classpp_1_1_video_decoder.html#a8f576cfbd03dc0ef97a49c9f0a667a16" title="Initializes a video decoder resource.">Initialize()</a> again with different parameters to find a good configuration. </dd></dl>
262</div>
263</div>
264<a class="anchor" id="a7b9c4917ebd205572a0fe69a34f1bfd9"></a><!-- doxytag: member="pp::VideoDecoder::RecyclePicture" ref="a7b9c4917ebd205572a0fe69a34f1bfd9" args="(const PP_VideoPicture &amp;picture)" -->
265<div class="memitem">
266<div class="memproto">
267<table class="memname">
268<tr>
269<td class="memname">void <a class="el" href="classpp_1_1_video_decoder.html#a7b9c4917ebd205572a0fe69a34f1bfd9">pp::VideoDecoder::RecyclePicture</a> </td>
270<td>(</td>
271<td class="paramtype">const PP_VideoPicture &amp;&#160;</td>
272<td class="paramname"><em>picture</em></td><td>)</td>
273<td></td>
274</tr>
275</table>
276</div>
277<div class="memdoc">
278<p>Recycles a picture that the plugin has received from the decoder. </p>
279<p>The plugin should call this as soon as it has finished using the texture so the decoder can decode more pictures.</p>
280<dl class="params"><dt><b>Parameters:</b></dt><dd>
281<table class="params">
282<tr><td class="paramdir">[in]</td><td class="paramname">picture</td><td>A <code>PP_VideoPicture</code> to return to the decoder. </td></tr>
283</table>
284</dd>
285</dl>
286</div>
287</div>
288<a class="anchor" id="aa05481906b07e929c9567bc22a48917a"></a><!-- doxytag: member="pp::VideoDecoder::Reset" ref="aa05481906b07e929c9567bc22a48917a" args="(const CompletionCallback &amp;callback)" -->
289<div class="memitem">
290<div class="memproto">
291<table class="memname">
292<tr>
293<td class="memname">int32_t <a class="el" href="classpp_1_1_video_decoder.html#aa05481906b07e929c9567bc22a48917a">pp::VideoDecoder::Reset</a> </td>
294<td>(</td>
295<td class="paramtype">const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;&#160;</td>
296<td class="paramname"><em>callback</em></td><td>)</td>
297<td></td>
298</tr>
299</table>
300</div>
301<div class="memdoc">
302<p>Resets the decoder as quickly as possible. </p>
303<p>The plugin can call <a class="el" href="classpp_1_1_video_decoder.html#aa05481906b07e929c9567bc22a48917a" title="Resets the decoder as quickly as possible.">Reset()</a> to skip to another position in the video stream. Pending calls to <a class="el" href="classpp_1_1_video_decoder.html#a2f1a48cf6d2f1854b20e6a747c9b03e3" title="Decodes a bitstream buffer.">Decode()</a> and <a class="el" href="classpp_1_1_video_decoder.html#aec1a1bc95b8d3eea64b942af48dff02a" title="Gets the next picture from the decoder.">GetPicture()</a>) are immediately aborted, causing their callbacks to run with PP_ERROR_ABORTED. The plugin should not make any further calls to the decoder until the decoder signals completion by running |callback|.</p>
304<dl class="params"><dt><b>Parameters:</b></dt><dd>
305<table class="params">
306<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>A <code><a class="el" href="classpp_1_1_completion_callback.html" title="This API enables you to implement and receive callbacks when Pepper operations complete asynchronousl...">CompletionCallback</a></code> to be called on completion.</td></tr>
307</table>
308</dd>
309</dl>
310<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code>pp_errors.h</code>. </dd></dl>
311</div>
312</div>
313<hr />The documentation for this class was generated from the following file:<ul>
314<li><a class="el" href="video__decoder_8h.html">video_decoder.h</a></li>
315</ul>
316</div><!-- contents -->
317</div>
318{{/partials.standard_nacl_api}}
319