blob: de97a32e41203a755fb220ca756d148f3f5ab821 [file] [log] [blame]
{{+bindTo:partials.standard_nacl_api}}
<h1>PPB_VideoEncoder 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_VideoEncoder" --><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_encoder__0__2.html#a94d87da92ccfb984cef497977d00d80c">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_encoder__0__2.html#a9006f1c2d0d3fe9a71bb2343e22e679a">IsVideoEncoder</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_encoder__0__2.html#abe007473d19c6c82555799c0ecff0cc7">GetSupportedProfiles</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_encoder, struct <a class="el" href="struct_p_p___array_output.html">PP_ArrayOutput</a> output, 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_encoder__0__2.html#a9cd78deaf493477ca7ec96a6e6445561">Initialize</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_encoder, <a class="el" href="group___enums.html#ga4e7cf746d8acbfa268db1f5ebe8061bf">PP_VideoFrame_Format</a> input_format, const struct <a class="el" href="struct_p_p___size.html">PP_Size</a> *input_visible_size, <a class="el" href="group___enums.html#ga4d50d27186f68b2de578e82162206fea">PP_VideoProfile</a> output_profile, uint32_t initial_bitrate, <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_encoder__0__2.html#a468e94294b704c002a6532687bb53ed0">GetFramesRequired</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_encoder)</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_encoder__0__2.html#adbd41c5b25729bbfb1ad90124d9e9528">GetFrameCodedSize</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_encoder, struct <a class="el" href="struct_p_p___size.html">PP_Size</a> *coded_size)</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_encoder__0__2.html#a64a5b77b1130f13184b797828a49587a">GetVideoFrame</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_encoder, <a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> *video_frame, 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_encoder__0__2.html#a873344d65a32d15426cd4424e76bb6d9">Encode</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_encoder, <a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_frame, <a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a> force_keyframe, 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_encoder__0__2.html#a8b2b489462a35bdc6300bcf1fdadabe4">GetBitstreamBuffer</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_encoder, struct <a class="el" href="struct_p_p___bitstream_buffer.html">PP_BitstreamBuffer</a> *bitstream_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">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___video_encoder__0__2.html#a072f3199019aa262fbdf42412678220a">RecycleBitstreamBuffer</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_encoder, const struct <a class="el" href="struct_p_p___bitstream_buffer.html">PP_BitstreamBuffer</a> *bitstream_buffer)</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_encoder__0__2.html#aa1a3fa20e5d8c56e420d169af6f02845">RequestEncodingParametersChange</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_encoder, uint32_t bitrate, uint32_t framerate)</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_encoder__0__2.html#afe91b697d39e41ca9c4b187e1f66749f">Close</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_encoder)</td></tr>
</table>
<hr /><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Video encoder interface. </p>
<p>Typical usage:</p>
<ul>
<li>Call <a class="el" href="struct_p_p_b___video_encoder__0__2.html#a94d87da92ccfb984cef497977d00d80c" title="Creates a new video encoder resource.">Create()</a> to create a new video encoder resource.</li>
<li>Call GetSupportedFormats() to determine which codecs and profiles are available.</li>
<li>Call <a class="el" href="struct_p_p_b___video_encoder__0__2.html#a9cd78deaf493477ca7ec96a6e6445561" title="Initializes a video encoder resource.">Initialize()</a> to initialize the encoder for a supported profile.</li>
<li>Call <a class="el" href="struct_p_p_b___video_encoder__0__2.html#a64a5b77b1130f13184b797828a49587a" title="Gets a blank video frame which can be filled with video data and passed to the encoder.">GetVideoFrame()</a> to get a blank frame and fill it in, or get a video frame from another resource, e.g. <code>PPB_MediaStreamVideoTrack</code>.</li>
<li>Call <a class="el" href="struct_p_p_b___video_encoder__0__2.html#a873344d65a32d15426cd4424e76bb6d9" title="Encodes a video frame.">Encode()</a> to push the video frame to the encoder. If an external frame is pushed, wait for completion to recycle the frame.</li>
<li>Call <a class="el" href="struct_p_p_b___video_encoder__0__2.html#a8b2b489462a35bdc6300bcf1fdadabe4" title="Gets the next encoded bitstream buffer from the encoder.">GetBitstreamBuffer()</a> continuously (waiting for each previous call to complete) to pull encoded pictures from the encoder.</li>
<li>Call <a class="el" href="struct_p_p_b___video_encoder__0__2.html#a072f3199019aa262fbdf42412678220a" title="Recycles a bitstream buffer back to the encoder.">RecycleBitstreamBuffer()</a> after consuming the data in the bitstream buffer.</li>
<li>To destroy the encoder, the plugin should release all of its references to it. Any pending callbacks will abort before the encoder is destroyed.</li>
</ul>
<p>Available video codecs vary by platform. All: vp8 (software). ChromeOS, depending on your device: h264 (hardware), vp8 (hardware) </p>
</div><hr /><h2>Field Documentation</h2>
<a class="anchor" id="afe91b697d39e41ca9c4b187e1f66749f"></a><!-- doxytag: member="PPB_VideoEncoder::Close" ref="afe91b697d39e41ca9c4b187e1f66749f" args=")(PP_Resource video_encoder)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void(* <a class="el" href="struct_p_p_b___video_encoder__0__2.html#afe91b697d39e41ca9c4b187e1f66749f">PPB_VideoEncoder::Close</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_encoder)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Closes the video encoder, and cancels any pending encodes. </p>
<p>Any pending callbacks will still run, reporting <code>PP_ERROR_ABORTED</code> . It is not valid to call any encoder functions after a call to this method. <b>Note:</b> Destroying the video encoder closes it implicitly, so you are not required to call <a class="el" href="struct_p_p_b___video_encoder__0__2.html#afe91b697d39e41ca9c4b187e1f66749f" title="Closes the video encoder, and cancels any pending encodes.">Close()</a>.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">video_encoder</td><td>A <code>PP_Resource</code> identifying the video encoder. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a94d87da92ccfb984cef497977d00d80c"></a><!-- doxytag: member="PPB_VideoEncoder::Create" ref="a94d87da92ccfb984cef497977d00d80c" 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_encoder__0__2.html#a94d87da92ccfb984cef497977d00d80c">PPB_VideoEncoder::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 encoder 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 encoder.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_Resource</code> corresponding to a video encoder if successful or 0 otherwise. </dd></dl>
</div>
</div>
<a class="anchor" id="a873344d65a32d15426cd4424e76bb6d9"></a><!-- doxytag: member="PPB_VideoEncoder::Encode" ref="a873344d65a32d15426cd4424e76bb6d9" args=")(PP_Resource video_encoder, PP_Resource video_frame, PP_Bool force_keyframe, 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_encoder__0__2.html#a873344d65a32d15426cd4424e76bb6d9">PPB_VideoEncoder::Encode</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_encoder, <a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_frame, <a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a> force_keyframe, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Encodes a video frame. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">video_encoder</td><td>A <code>PP_Resource</code> identifying the video encoder. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">video_frame</td><td>The <code>PPB_VideoFrame</code> to be encoded. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">force_keyframe</td><td>A <code>PP_Bool&gt; specifying whether the encoder should emit a key frame for this video frame. </code></td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td><code>A </code><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. Plugins that pass <code>PPB_VideoFrame</code> resources owned by other resources should wait for completion before reusing them.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><code> An int32_t containing an error code from </code><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 <a class="el" href="struct_p_p_b___video_encoder__0__2.html#a9cd78deaf493477ca7ec96a6e6445561" title="Initializes a video encoder resource.">Initialize()</a> has not successfully completed. </dd></dl>
</div>
</div>
<a class="anchor" id="a8b2b489462a35bdc6300bcf1fdadabe4"></a><!-- doxytag: member="PPB_VideoEncoder::GetBitstreamBuffer" ref="a8b2b489462a35bdc6300bcf1fdadabe4" args=")(PP_Resource video_encoder, struct PP_BitstreamBuffer *bitstream_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_encoder__0__2.html#a8b2b489462a35bdc6300bcf1fdadabe4">PPB_VideoEncoder::GetBitstreamBuffer</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_encoder, struct <a class="el" href="struct_p_p___bitstream_buffer.html">PP_BitstreamBuffer</a> *bitstream_buffer, 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 encoded bitstream buffer from the encoder. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">video_encoder</td><td>A <code>PP_Resource</code> identifying the video encoder. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">bitstream_buffer</td><td>A <code><a class="el" href="struct_p_p___bitstream_buffer.html" title="Struct describing a bitstream buffer.">PP_BitstreamBuffer</a></code> containing encoded video data. </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. The plugin can call GetBitstreamBuffer from the callback in order to continuously "pull" bitstream buffers from the encoder.</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 <a class="el" href="struct_p_p_b___video_encoder__0__2.html#a9cd78deaf493477ca7ec96a6e6445561" title="Initializes a video encoder resource.">Initialize()</a> has not successfully completed. Returns PP_ERROR_INPROGRESS if a prior call to <a class="el" href="struct_p_p_b___video_encoder__0__2.html#a8b2b489462a35bdc6300bcf1fdadabe4" title="Gets the next encoded bitstream buffer from the encoder.">GetBitstreamBuffer()</a> has not completed. </dd></dl>
</div>
</div>
<a class="anchor" id="adbd41c5b25729bbfb1ad90124d9e9528"></a><!-- doxytag: member="PPB_VideoEncoder::GetFrameCodedSize" ref="adbd41c5b25729bbfb1ad90124d9e9528" args=")(PP_Resource video_encoder, struct PP_Size *coded_size)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___video_encoder__0__2.html#adbd41c5b25729bbfb1ad90124d9e9528">PPB_VideoEncoder::GetFrameCodedSize</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_encoder, struct <a class="el" href="struct_p_p___size.html">PP_Size</a> *coded_size)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gets the coded size of the video frames required by the encoder. </p>
<p>Coded size is the logical size of the input frames, in pixels. The encoder may have hardware alignment requirements that make this different from |input_visible_size|, as requested in the call to <a class="el" href="struct_p_p_b___video_encoder__0__2.html#a9cd78deaf493477ca7ec96a6e6445561" title="Initializes a video encoder resource.">Initialize()</a>.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">video_encoder</td><td>A <code>PP_Resource</code> identifying the video encoder. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">coded_size</td><td>A <code><a class="el" href="struct_p_p___size.html" title="The PP_Size struct contains the size of a 2D rectangle.">PP_Size</a></code> to hold the coded size. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing a result 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 <a class="el" href="struct_p_p_b___video_encoder__0__2.html#a9cd78deaf493477ca7ec96a6e6445561" title="Initializes a video encoder resource.">Initialize()</a> has not successfully completed. </dd></dl>
</div>
</div>
<a class="anchor" id="a468e94294b704c002a6532687bb53ed0"></a><!-- doxytag: member="PPB_VideoEncoder::GetFramesRequired" ref="a468e94294b704c002a6532687bb53ed0" args=")(PP_Resource video_encoder)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___video_encoder__0__2.html#a468e94294b704c002a6532687bb53ed0">PPB_VideoEncoder::GetFramesRequired</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_encoder)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gets the number of input video frames that the encoder may hold while encoding. </p>
<p>If the plugin is providing the video frames, it should have at least this many available.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">video_encoder</td><td>A <code>PP_Resource</code> identifying the video encoder. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing the number of frames required, or 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 <a class="el" href="struct_p_p_b___video_encoder__0__2.html#a9cd78deaf493477ca7ec96a6e6445561" title="Initializes a video encoder resource.">Initialize()</a> has not successfully completed. </dd></dl>
</div>
</div>
<a class="anchor" id="abe007473d19c6c82555799c0ecff0cc7"></a><!-- doxytag: member="PPB_VideoEncoder::GetSupportedProfiles" ref="abe007473d19c6c82555799c0ecff0cc7" args=")(PP_Resource video_encoder, struct PP_ArrayOutput output, 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_encoder__0__2.html#abe007473d19c6c82555799c0ecff0cc7">PPB_VideoEncoder::GetSupportedProfiles</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_encoder, struct <a class="el" href="struct_p_p___array_output.html">PP_ArrayOutput</a> output, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gets an array of supported video encoder profiles. </p>
<p>These can be used to choose a profile before calling <a class="el" href="struct_p_p_b___video_encoder__0__2.html#a9cd78deaf493477ca7ec96a6e6445561" title="Initializes a video encoder resource.">Initialize()</a>.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">video_encoder</td><td>A <code>PP_Resource</code> identifying the video encoder. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">output</td><td>A <code><a class="el" href="struct_p_p___array_output.html" title="A structure that defines a way for the browser to return arrays of data to the plugin.">PP_ArrayOutput</a></code> to receive the supported <code><a class="el" href="struct_p_p___video_profile_description.html" title="Supported video profile information.">PP_VideoProfileDescription</a></code> structs. </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>If &gt;= 0, the number of supported profiles returned, otherwise 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>. </dd></dl>
</div>
</div>
<a class="anchor" id="a64a5b77b1130f13184b797828a49587a"></a><!-- doxytag: member="PPB_VideoEncoder::GetVideoFrame" ref="a64a5b77b1130f13184b797828a49587a" args=")(PP_Resource video_encoder, PP_Resource *video_frame, 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_encoder__0__2.html#a64a5b77b1130f13184b797828a49587a">PPB_VideoEncoder::GetVideoFrame</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_encoder, <a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> *video_frame, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gets a blank video frame which can be filled with video data and passed to the encoder. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">video_encoder</td><td>A <code>PP_Resource</code> identifying the video encoder. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">video_frame</td><td>A blank <code>PPB_VideoFrame</code> resource. </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_FAILED if <a class="el" href="struct_p_p_b___video_encoder__0__2.html#a9cd78deaf493477ca7ec96a6e6445561" title="Initializes a video encoder resource.">Initialize()</a> has not successfully completed. </dd></dl>
</div>
</div>
<a class="anchor" id="a9cd78deaf493477ca7ec96a6e6445561"></a><!-- doxytag: member="PPB_VideoEncoder::Initialize" ref="a9cd78deaf493477ca7ec96a6e6445561" args=")(PP_Resource video_encoder, PP_VideoFrame_Format input_format, const struct PP_Size *input_visible_size, PP_VideoProfile output_profile, uint32_t initial_bitrate, 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_encoder__0__2.html#a9cd78deaf493477ca7ec96a6e6445561">PPB_VideoEncoder::Initialize</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_encoder, <a class="el" href="group___enums.html#ga4e7cf746d8acbfa268db1f5ebe8061bf">PP_VideoFrame_Format</a> input_format, const struct <a class="el" href="struct_p_p___size.html">PP_Size</a> *input_visible_size, <a class="el" href="group___enums.html#ga4d50d27186f68b2de578e82162206fea">PP_VideoProfile</a> output_profile, uint32_t initial_bitrate, <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 encoder resource. </p>
<p>The plugin should call <a class="el" href="struct_p_p_b___video_encoder__0__2.html#a9cd78deaf493477ca7ec96a6e6445561" title="Initializes a video encoder resource.">Initialize()</a> successfully before calling any of the functions below.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">video_encoder</td><td>A <code>PP_Resource</code> identifying the video encoder. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">input_format</td><td>The <code>PP_VideoFrame_Format</code> of the frames which will be encoded. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">input_visible_size</td><td>A <code><a class="el" href="struct_p_p___size.html" title="The PP_Size struct contains the size of a 2D rectangle.">PP_Size</a></code> specifying the dimensions of the visible part of the input frames. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">output_profile</td><td>A <code>PP_VideoProfile</code> specifying the codec profile of the encoded output stream. </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 encoding is not available, or the requested codec profile is not supported. </dd></dl>
</div>
</div>
<a class="anchor" id="a9006f1c2d0d3fe9a71bb2343e22e679a"></a><!-- doxytag: member="PPB_VideoEncoder::IsVideoEncoder" ref="a9006f1c2d0d3fe9a71bb2343e22e679a" 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_encoder__0__2.html#a9006f1c2d0d3fe9a71bb2343e22e679a">PPB_VideoEncoder::IsVideoEncoder</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 encoder. </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_VideoEncoder</code>, <code>PP_FALSE</code> if the resource is invalid or some other type. </dd></dl>
</div>
</div>
<a class="anchor" id="a072f3199019aa262fbdf42412678220a"></a><!-- doxytag: member="PPB_VideoEncoder::RecycleBitstreamBuffer" ref="a072f3199019aa262fbdf42412678220a" args=")(PP_Resource video_encoder, const struct PP_BitstreamBuffer *bitstream_buffer)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void(* <a class="el" href="struct_p_p_b___video_encoder__0__2.html#a072f3199019aa262fbdf42412678220a">PPB_VideoEncoder::RecycleBitstreamBuffer</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_encoder, const struct <a class="el" href="struct_p_p___bitstream_buffer.html">PP_BitstreamBuffer</a> *bitstream_buffer)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Recycles a bitstream buffer back to the encoder. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">video_encoder</td><td>A <code>PP_Resource</code> identifying the video encoder. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">bitstream_buffer</td><td>A <code><a class="el" href="struct_p_p___bitstream_buffer.html" title="Struct describing a bitstream buffer.">PP_BitstreamBuffer</a></code> that is no longer needed by the plugin. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="aa1a3fa20e5d8c56e420d169af6f02845"></a><!-- doxytag: member="PPB_VideoEncoder::RequestEncodingParametersChange" ref="aa1a3fa20e5d8c56e420d169af6f02845" args=")(PP_Resource video_encoder, uint32_t bitrate, uint32_t framerate)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void(* <a class="el" href="struct_p_p_b___video_encoder__0__2.html#aa1a3fa20e5d8c56e420d169af6f02845">PPB_VideoEncoder::RequestEncodingParametersChange</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> video_encoder, uint32_t bitrate, uint32_t framerate)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Requests a change to encoding parameters. </p>
<p>This is only a request, fulfilled on a best-effort basis.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">video_encoder</td><td>A <code>PP_Resource</code> identifying the video encoder. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">bitrate</td><td>The requested new bitrate, in bits per second. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">framerate</td><td>The requested new framerate, in frames per second. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr />The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="ppb__video__encoder_8h.html">ppb_video_encoder.h</a></li>
</ul>
</div><!-- contents -->
</div>
{{/partials.standard_nacl_api}}