{{+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>(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___video_decoder__1__1.html#ab84df8254cf35702e09425b835b5958f">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>(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___video_decoder__1__1.html#aa32bb990160f3e1fbfa90a2f363c61bc">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(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___video_decoder__1__1.html#a65fc7d77135a1c55eb77ad4f7fd1a8a8">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, uint32_t min_picture_count, 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(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___video_decoder__1__1.html#a5f87d174876dc480029275f94e4669cd">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(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___video_decoder__1__1.html#adc8b4eb41199cdf96aaa55d9a2df0b6c">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(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___video_decoder__1__1.html#ab0b4f4b781cf6c0b347832961a08b6bb">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(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___video_decoder__1__1.html#a40e2989df1005096fd6fc9832e078413">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(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___video_decoder__1__1.html#ad8151e35df062e82434fb1d6e0629fd0">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__1.html#ab84df8254cf35702e09425b835b5958f" 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__1.html#a65fc7d77135a1c55eb77ad4f7fd1a8a8" 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__1.html#a5f87d174876dc480029275f94e4669cd" 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__1.html#adc8b4eb41199cdf96aaa55d9a2df0b6c" 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__1.html#a40e2989df1005096fd6fc9832e078413" 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__1.html#ad8151e35df062e82434fb1d6e0629fd0" 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="ab84df8254cf35702e09425b835b5958f"></a><!-- doxytag: member="PPB_VideoDecoder::Create" ref="ab84df8254cf35702e09425b835b5958f" 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__1.html#ab84df8254cf35702e09425b835b5958f">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="a5f87d174876dc480029275f94e4669cd"></a><!-- doxytag: member="PPB_VideoDecoder::Decode" ref="a5f87d174876dc480029275f94e4669cd" 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__1.html#a5f87d174876dc480029275f94e4669cd">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__1.html#a5f87d174876dc480029275f94e4669cd" 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__1.html#a5f87d174876dc480029275f94e4669cd" 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__1.html#a5f87d174876dc480029275f94e4669cd" 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__1.html#a5f87d174876dc480029275f94e4669cd" title="Decodes a bitstream buffer.">Decode()</a> with decoded pictures returned by <a class="el" href="struct_p_p_b___video_decoder__1__1.html#adc8b4eb41199cdf96aaa55d9a2df0b6c" 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__1.html#a40e2989df1005096fd6fc9832e078413" title="Flushes the decoder.">Flush()</a> or <a class="el" href="struct_p_p_b___video_decoder__1__1.html#ad8151e35df062e82434fb1d6e0629fd0" 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__1.html#a5f87d174876dc480029275f94e4669cd" 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__1.html#ad8151e35df062e82434fb1d6e0629fd0" title="Resets the decoder as quickly as possible.">Reset()</a> is called while <a class="el" href="struct_p_p_b___video_decoder__1__1.html#a5f87d174876dc480029275f94e4669cd" title="Decodes a bitstream buffer.">Decode()</a> is pending. </dd></dl>
</div>
</div>
<a class="anchor" id="a40e2989df1005096fd6fc9832e078413"></a><!-- doxytag: member="PPB_VideoDecoder::Flush" ref="a40e2989df1005096fd6fc9832e078413" 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__1.html#a40e2989df1005096fd6fc9832e078413">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__1.html#a40e2989df1005096fd6fc9832e078413" 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__1.html#a5f87d174876dc480029275f94e4669cd" 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__1.html#adc8b4eb41199cdf96aaa55d9a2df0b6c" title="Gets the next picture from the decoder.">GetPicture()</a> and <a class="el" href="struct_p_p_b___video_decoder__1__1.html#ab0b4f4b781cf6c0b347832961a08b6bb" 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__1.html#adc8b4eb41199cdf96aaa55d9a2df0b6c" 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="adc8b4eb41199cdf96aaa55d9a2df0b6c"></a><!-- doxytag: member="PPB_VideoDecoder::GetPicture" ref="adc8b4eb41199cdf96aaa55d9a2df0b6c" 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__1.html#adc8b4eb41199cdf96aaa55d9a2df0b6c">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__1.html#adc8b4eb41199cdf96aaa55d9a2df0b6c" 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__1.html#ab0b4f4b781cf6c0b347832961a08b6bb" 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__1.html#ad8151e35df062e82434fb1d6e0629fd0" 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__1.html#adc8b4eb41199cdf96aaa55d9a2df0b6c" 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__1.html#ad8151e35df062e82434fb1d6e0629fd0" 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__1.html#a40e2989df1005096fd6fc9832e078413" title="Flushes the decoder.">Flush()</a> completes while <a class="el" href="struct_p_p_b___video_decoder__1__1.html#adc8b4eb41199cdf96aaa55d9a2df0b6c" title="Gets the next picture from the decoder.">GetPicture()</a> is pending. </dd></dl>
</div>
</div>
<a class="anchor" id="a65fc7d77135a1c55eb77ad4f7fd1a8a8"></a><!-- doxytag: member="PPB_VideoDecoder::Initialize" ref="a65fc7d77135a1c55eb77ad4f7fd1a8a8" args=")(PP_Resource video_decoder, PP_Resource graphics3d_context, PP_VideoProfile profile, PP_HardwareAcceleration acceleration, uint32_t min_picture_count, 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__1.html#a65fc7d77135a1c55eb77ad4f7fd1a8a8">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, uint32_t min_picture_count, 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__1.html#ab84df8254cf35702e09425b835b5958f" 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">min_picture_count</td><td>A count of pictures the plugin would like to have in flight. This is effectively the number of times the plugin can call <a class="el" href="struct_p_p_b___video_decoder__1__1.html#adc8b4eb41199cdf96aaa55d9a2df0b6c" title="Gets the next picture from the decoder.">GetPicture()</a> and get a decoded frame without calling <a class="el" href="struct_p_p_b___video_decoder__1__1.html#ab0b4f4b781cf6c0b347832961a08b6bb" title="Recycles a picture that the plugin has received from the decoder.">RecyclePicture()</a>. The decoder has its own internal minimum count, and will take the larger of its internal and this value. A client that doesn't care can therefore just pass in zero for this argument. </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__1.html#a65fc7d77135a1c55eb77ad4f7fd1a8a8" title="Initializes a video decoder resource.">Initialize()</a> again with different parameters to find a good configuration. Returns PP_ERROR_BADARGUMENT if the requested minimum picture count is unreasonably large. </dd></dl>
</div>
</div>
<a class="anchor" id="aa32bb990160f3e1fbfa90a2f363c61bc"></a><!-- doxytag: member="PPB_VideoDecoder::IsVideoDecoder" ref="aa32bb990160f3e1fbfa90a2f363c61bc" 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__1.html#aa32bb990160f3e1fbfa90a2f363c61bc">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="ab0b4f4b781cf6c0b347832961a08b6bb"></a><!-- doxytag: member="PPB_VideoDecoder::RecyclePicture" ref="ab0b4f4b781cf6c0b347832961a08b6bb" 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__1.html#ab0b4f4b781cf6c0b347832961a08b6bb">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="ad8151e35df062e82434fb1d6e0629fd0"></a><!-- doxytag: member="PPB_VideoDecoder::Reset" ref="ad8151e35df062e82434fb1d6e0629fd0" 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__1.html#ad8151e35df062e82434fb1d6e0629fd0">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__1.html#ad8151e35df062e82434fb1d6e0629fd0" 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__1.html#ad8151e35df062e82434fb1d6e0629fd0" 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__1.html#a5f87d174876dc480029275f94e4669cd" title="Decodes a bitstream buffer.">Decode()</a> and <a class="el" href="struct_p_p_b___video_decoder__1__1.html#adc8b4eb41199cdf96aaa55d9a2df0b6c" 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__1.html#ab0b4f4b781cf6c0b347832961a08b6bb" 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}}