summaryrefslogtreecommitdiffstats
path: root/native_client_sdk/doc_generated/pepper_beta/c/struct_p_p_b___video_encoder__0__2.html
blob: de97a32e41203a755fb220ca756d148f3f5ab821 (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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
{{+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}}