• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5<title>GstVideoEncoder: GStreamer Base Plugins 1.0 Library Reference Manual</title>
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="index.html" title="GStreamer Base Plugins 1.0 Library Reference Manual">
8<link rel="up" href="gstreamer-video.html" title="Video Library">
9<link rel="prev" href="GstVideoDecoder.html" title="GstVideoDecoder">
10<link rel="next" href="gst-plugins-base-libs-GstVideoPool.html" title="GstVideoBufferPool">
11<meta name="generator" content="GTK-Doc V1.28 (XML mode)">
12<link rel="stylesheet" href="style.css" type="text/css">
13</head>
14<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
16<td width="100%" align="left" class="shortcuts">
17<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span18                  <a href="#GstVideoEncoder.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span19                  <a href="#GstVideoEncoder.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_interfaces">  <span class="dim">|</span20                  <a href="#GstVideoEncoder.implemented-interfaces" class="shortcut">Implemented Interfaces</a></span><span id="nav_properties">  <span class="dim">|</span21                  <a href="#GstVideoEncoder.properties" class="shortcut">Properties</a></span>
22</td>
23<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
24<td><a accesskey="u" href="gstreamer-video.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
25<td><a accesskey="p" href="GstVideoDecoder.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
26<td><a accesskey="n" href="gst-plugins-base-libs-GstVideoPool.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
27</tr></table>
28<div class="refentry">
29<a name="GstVideoEncoder"></a><div class="titlepage"></div>
30<div class="refnamediv"><table width="100%"><tr>
31<td valign="top">
32<h2><span class="refentrytitle"><a name="GstVideoEncoder.top_of_page"></a>GstVideoEncoder</span></h2>
33<p>GstVideoEncoder — Base class for video encoders</p>
34</td>
35<td class="gallery_image" valign="top" align="right"></td>
36</tr></table></div>
37<div class="refsect1">
38<a name="GstVideoEncoder.functions"></a><h2>Functions</h2>
39<div class="informaltable"><table class="informaltable" width="100%" border="0">
40<colgroup>
41<col width="150px" class="functions_return">
42<col class="functions_name">
43</colgroup>
44<tbody>
45<tr>
46<td class="define_keyword">#define</td>
47<td class="function_name">
48<a class="link" href="GstVideoEncoder.html#GST-VIDEO-ENCODER-CAST:CAPS" title="GST_VIDEO_ENCODER_CAST()">GST_VIDEO_ENCODER_CAST</a><span class="c_punctuation">()</span>
49</td>
50</tr>
51<tr>
52<td class="define_keyword">#define</td>
53<td class="function_name">
54<a class="link" href="GstVideoEncoder.html#GST-VIDEO-ENCODER-SINK-PAD:CAPS" title="GST_VIDEO_ENCODER_SINK_PAD()">GST_VIDEO_ENCODER_SINK_PAD</a><span class="c_punctuation">()</span>
55</td>
56</tr>
57<tr>
58<td class="define_keyword">#define</td>
59<td class="function_name">
60<a class="link" href="GstVideoEncoder.html#GST-VIDEO-ENCODER-SRC-PAD:CAPS" title="GST_VIDEO_ENCODER_SRC_PAD()">GST_VIDEO_ENCODER_SRC_PAD</a><span class="c_punctuation">()</span>
61</td>
62</tr>
63<tr>
64<td class="define_keyword">#define</td>
65<td class="function_name">
66<a class="link" href="GstVideoEncoder.html#GST-VIDEO-ENCODER-INPUT-SEGMENT:CAPS" title="GST_VIDEO_ENCODER_INPUT_SEGMENT()">GST_VIDEO_ENCODER_INPUT_SEGMENT</a><span class="c_punctuation">()</span>
67</td>
68</tr>
69<tr>
70<td class="define_keyword">#define</td>
71<td class="function_name">
72<a class="link" href="GstVideoEncoder.html#GST-VIDEO-ENCODER-OUTPUT-SEGMENT:CAPS" title="GST_VIDEO_ENCODER_OUTPUT_SEGMENT()">GST_VIDEO_ENCODER_OUTPUT_SEGMENT</a><span class="c_punctuation">()</span>
73</td>
74</tr>
75<tr>
76<td class="define_keyword">#define</td>
77<td class="function_name">
78<a class="link" href="GstVideoEncoder.html#GST-VIDEO-ENCODER-STREAM-LOCK:CAPS" title="GST_VIDEO_ENCODER_STREAM_LOCK()">GST_VIDEO_ENCODER_STREAM_LOCK</a><span class="c_punctuation">()</span>
79</td>
80</tr>
81<tr>
82<td class="define_keyword">#define</td>
83<td class="function_name">
84<a class="link" href="GstVideoEncoder.html#GST-VIDEO-ENCODER-STREAM-UNLOCK:CAPS" title="GST_VIDEO_ENCODER_STREAM_UNLOCK()">GST_VIDEO_ENCODER_STREAM_UNLOCK</a><span class="c_punctuation">()</span>
85</td>
86</tr>
87<tr>
88<td class="function_type">
89<a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstBuffer.html#GstBuffer-struct"><span class="returnvalue">GstBuffer</span></a> *
90</td>
91<td class="function_name">
92<a class="link" href="GstVideoEncoder.html#gst-video-encoder-allocate-output-buffer" title="gst_video_encoder_allocate_output_buffer ()">gst_video_encoder_allocate_output_buffer</a> <span class="c_punctuation">()</span>
93</td>
94</tr>
95<tr>
96<td class="function_type">
97<a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>
98</td>
99<td class="function_name">
100<a class="link" href="GstVideoEncoder.html#gst-video-encoder-allocate-output-frame" title="gst_video_encoder_allocate_output_frame ()">gst_video_encoder_allocate_output_frame</a> <span class="c_punctuation">()</span>
101</td>
102</tr>
103<tr>
104<td class="function_type">
105<span class="returnvalue">void</span>
106</td>
107<td class="function_name">
108<a class="link" href="GstVideoEncoder.html#gst-video-encoder-get-allocator" title="gst_video_encoder_get_allocator ()">gst_video_encoder_get_allocator</a> <span class="c_punctuation">()</span>
109</td>
110</tr>
111<tr>
112<td class="function_type">
113<a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>
114</td>
115<td class="function_name">
116<a class="link" href="GstVideoEncoder.html#gst-video-encoder-finish-frame" title="gst_video_encoder_finish_frame ()">gst_video_encoder_finish_frame</a> <span class="c_punctuation">()</span>
117</td>
118</tr>
119<tr>
120<td class="function_type">
121<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
122</td>
123<td class="function_name">
124<a class="link" href="GstVideoEncoder.html#gst-video-encoder-negotiate" title="gst_video_encoder_negotiate ()">gst_video_encoder_negotiate</a> <span class="c_punctuation">()</span>
125</td>
126</tr>
127<tr>
128<td class="function_type">
129<a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecFrame" title="struct GstVideoCodecFrame"><span class="returnvalue">GstVideoCodecFrame</span></a> *
130</td>
131<td class="function_name">
132<a class="link" href="GstVideoEncoder.html#gst-video-encoder-get-frame" title="gst_video_encoder_get_frame ()">gst_video_encoder_get_frame</a> <span class="c_punctuation">()</span>
133</td>
134</tr>
135<tr>
136<td class="function_type">
137<a href="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a> *
138</td>
139<td class="function_name">
140<a class="link" href="GstVideoEncoder.html#gst-video-encoder-get-frames" title="gst_video_encoder_get_frames ()">gst_video_encoder_get_frames</a> <span class="c_punctuation">()</span>
141</td>
142</tr>
143<tr>
144<td class="function_type">
145<a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecFrame" title="struct GstVideoCodecFrame"><span class="returnvalue">GstVideoCodecFrame</span></a> *
146</td>
147<td class="function_name">
148<a class="link" href="GstVideoEncoder.html#gst-video-encoder-get-oldest-frame" title="gst_video_encoder_get_oldest_frame ()">gst_video_encoder_get_oldest_frame</a> <span class="c_punctuation">()</span>
149</td>
150</tr>
151<tr>
152<td class="function_type">
153<span class="returnvalue">void</span>
154</td>
155<td class="function_name">
156<a class="link" href="GstVideoEncoder.html#gst-video-encoder-set-headers" title="gst_video_encoder_set_headers ()">gst_video_encoder_set_headers</a> <span class="c_punctuation">()</span>
157</td>
158</tr>
159<tr>
160<td class="function_type">
161<span class="returnvalue">void</span>
162</td>
163<td class="function_name">
164<a class="link" href="GstVideoEncoder.html#gst-video-encoder-get-latency" title="gst_video_encoder_get_latency ()">gst_video_encoder_get_latency</a> <span class="c_punctuation">()</span>
165</td>
166</tr>
167<tr>
168<td class="function_type">
169<span class="returnvalue">void</span>
170</td>
171<td class="function_name">
172<a class="link" href="GstVideoEncoder.html#gst-video-encoder-set-latency" title="gst_video_encoder_set_latency ()">gst_video_encoder_set_latency</a> <span class="c_punctuation">()</span>
173</td>
174</tr>
175<tr>
176<td class="function_type">
177<a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecState" title="struct GstVideoCodecState"><span class="returnvalue">GstVideoCodecState</span></a> *
178</td>
179<td class="function_name">
180<a class="link" href="GstVideoEncoder.html#gst-video-encoder-set-output-state" title="gst_video_encoder_set_output_state ()">gst_video_encoder_set_output_state</a> <span class="c_punctuation">()</span>
181</td>
182</tr>
183<tr>
184<td class="function_type">
185<a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecState" title="struct GstVideoCodecState"><span class="returnvalue">GstVideoCodecState</span></a> *
186</td>
187<td class="function_name">
188<a class="link" href="GstVideoEncoder.html#gst-video-encoder-get-output-state" title="gst_video_encoder_get_output_state ()">gst_video_encoder_get_output_state</a> <span class="c_punctuation">()</span>
189</td>
190</tr>
191<tr>
192<td class="function_type">
193<span class="returnvalue">void</span>
194</td>
195<td class="function_name">
196<a class="link" href="GstVideoEncoder.html#gst-video-encoder-set-min-pts" title="gst_video_encoder_set_min_pts ()">gst_video_encoder_set_min_pts</a> <span class="c_punctuation">()</span>
197</td>
198</tr>
199<tr>
200<td class="function_type">
201<a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstCaps.html#GstCaps-struct"><span class="returnvalue">GstCaps</span></a> *
202</td>
203<td class="function_name">
204<a class="link" href="GstVideoEncoder.html#gst-video-encoder-proxy-getcaps" title="gst_video_encoder_proxy_getcaps ()">gst_video_encoder_proxy_getcaps</a> <span class="c_punctuation">()</span>
205</td>
206</tr>
207<tr>
208<td class="function_type">
209<span class="returnvalue">void</span>
210</td>
211<td class="function_name">
212<a class="link" href="GstVideoEncoder.html#gst-video-encoder-merge-tags" title="gst_video_encoder_merge_tags ()">gst_video_encoder_merge_tags</a> <span class="c_punctuation">()</span>
213</td>
214</tr>
215<tr>
216<td class="function_type">
217<a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstClock.html#GstClockTimeDiff"><span class="returnvalue">GstClockTimeDiff</span></a>
218</td>
219<td class="function_name">
220<a class="link" href="GstVideoEncoder.html#gst-video-encoder-get-max-encode-time" title="gst_video_encoder_get_max_encode_time ()">gst_video_encoder_get_max_encode_time</a> <span class="c_punctuation">()</span>
221</td>
222</tr>
223<tr>
224<td class="function_type">
225<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
226</td>
227<td class="function_name">
228<a class="link" href="GstVideoEncoder.html#gst-video-encoder-is-qos-enabled" title="gst_video_encoder_is_qos_enabled ()">gst_video_encoder_is_qos_enabled</a> <span class="c_punctuation">()</span>
229</td>
230</tr>
231<tr>
232<td class="function_type">
233<span class="returnvalue">void</span>
234</td>
235<td class="function_name">
236<a class="link" href="GstVideoEncoder.html#gst-video-encoder-set-qos-enabled" title="gst_video_encoder_set_qos_enabled ()">gst_video_encoder_set_qos_enabled</a> <span class="c_punctuation">()</span>
237</td>
238</tr>
239</tbody>
240</table></div>
241</div>
242<div class="refsect1">
243<a name="GstVideoEncoder.properties"></a><h2>Properties</h2>
244<div class="informaltable"><table class="informaltable" border="0">
245<colgroup>
246<col width="150px" class="properties_type">
247<col width="300px" class="properties_name">
248<col width="200px" class="properties_flags">
249</colgroup>
250<tbody><tr>
251<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
252<td class="property_name"><a class="link" href="GstVideoEncoder.html#GstVideoEncoder--qos" title="The “qos” property">qos</a></td>
253<td class="property_flags">Read / Write</td>
254</tr></tbody>
255</table></div>
256</div>
257<div class="refsect1">
258<a name="GstVideoEncoder.other"></a><h2>Types and Values</h2>
259<div class="informaltable"><table class="informaltable" width="100%" border="0">
260<colgroup>
261<col width="150px" class="name">
262<col class="description">
263</colgroup>
264<tbody>
265<tr>
266<td class="define_keyword">#define</td>
267<td class="function_name"><a class="link" href="GstVideoEncoder.html#GST-VIDEO-ENCODER-FLOW-DROPPED:CAPS" title="GST_VIDEO_ENCODER_FLOW_DROPPED">GST_VIDEO_ENCODER_FLOW_DROPPED</a></td>
268</tr>
269<tr>
270<td class="define_keyword">#define</td>
271<td class="function_name"><a class="link" href="GstVideoEncoder.html#GST-VIDEO-ENCODER-FLOW-NEED-DATA:CAPS" title="GST_VIDEO_ENCODER_FLOW_NEED_DATA">GST_VIDEO_ENCODER_FLOW_NEED_DATA</a></td>
272</tr>
273<tr>
274<td class="define_keyword">#define</td>
275<td class="function_name"><a class="link" href="GstVideoEncoder.html#GST-VIDEO-ENCODER-SINK-NAME:CAPS" title="GST_VIDEO_ENCODER_SINK_NAME">GST_VIDEO_ENCODER_SINK_NAME</a></td>
276</tr>
277<tr>
278<td class="define_keyword">#define</td>
279<td class="function_name"><a class="link" href="GstVideoEncoder.html#GST-VIDEO-ENCODER-SRC-NAME:CAPS" title="GST_VIDEO_ENCODER_SRC_NAME">GST_VIDEO_ENCODER_SRC_NAME</a></td>
280</tr>
281<tr>
282<td class="datatype_keyword">struct</td>
283<td class="function_name"><a class="link" href="GstVideoEncoder.html#GstVideoEncoder-struct" title="struct GstVideoEncoder">GstVideoEncoder</a></td>
284</tr>
285<tr>
286<td class="datatype_keyword">struct</td>
287<td class="function_name"><a class="link" href="GstVideoEncoder.html#GstVideoEncoderClass" title="struct GstVideoEncoderClass">GstVideoEncoderClass</a></td>
288</tr>
289</tbody>
290</table></div>
291</div>
292<div class="refsect1">
293<a name="GstVideoEncoder.object-hierarchy"></a><h2>Object Hierarchy</h2>
294<pre class="screen">    <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>
295    <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a>
296        <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstObject.html#GstObject-struct">GstObject</a>
297            <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstElement.html#GstElement-struct">GstElement</a>
298                <span class="lineart">╰──</span> GstVideoEncoder
299</pre>
300</div>
301<div class="refsect1">
302<a name="GstVideoEncoder.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
303<p>
304GstVideoEncoder implements
305 <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPreset.html#GstPreset-struct">GstPreset</a>.</p>
306</div>
307<div class="refsect1">
308<a name="GstVideoEncoder.includes"></a><h2>Includes</h2>
309<pre class="synopsis">#include &lt;gst/video/video.h&gt;
310</pre>
311</div>
312<div class="refsect1">
313<a name="GstVideoEncoder.description"></a><h2>Description</h2>
314<p>This base class is for video encoders turning raw video into
315encoded video data.</p>
316<p>GstVideoEncoder and subclass should cooperate as follows.</p>
317<div class="refsect3">
318<a name="id-1.2.15.21.9.4"></a><h4>Configuration</h4>
319<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
320<li class="listitem"><p>Initially, GstVideoEncoder calls <em class="parameter"><code>start</code></em>
321 when the encoder element
322is activated, which allows subclass to perform any global setup.</p></li>
323<li class="listitem"><p>GstVideoEncoder calls <em class="parameter"><code>set_format</code></em>
324 to inform subclass of the format
325of input video data that it is about to receive.  Subclass should
326setup for encoding and configure base class as appropriate
327(e.g. latency). While unlikely, it might be called more than once,
328if changing input parameters require reconfiguration.  Baseclass
329will ensure that processing of current configuration is finished.</p></li>
330<li class="listitem"><p>GstVideoEncoder calls <em class="parameter"><code>stop</code></em>
331 at end of all processing.</p></li>
332</ul></div>
333</div>
334<div class="refsect3">
335<a name="id-1.2.15.21.9.5"></a><h4>Data processing</h4>
336<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
337<p>Base class collects input data and metadata into a frame and hands
338  this to subclass' <em class="parameter"><code>handle_frame</code></em>
339.</p>
340<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; ">
341<li class="listitem"><p>If codec processing results in encoded data, subclass should call
342<em class="parameter"><code>gst_video_encoder_finish_frame</code></em>
343 to have encoded data pushed
344downstream.</p></li>
345<li class="listitem"><p>If implemented, baseclass calls subclass <em class="parameter"><code>pre_push</code></em>
346 just prior to
347pushing to allow subclasses to modify some metadata on the buffer.
348If it returns GST_FLOW_OK, the buffer is pushed downstream.</p></li>
349<li class="listitem"><p>GstVideoEncoderClass will handle both srcpad and sinkpad events.
350Sink events will be passed to subclass if <em class="parameter"><code>event</code></em>
351 callback has been
352provided.</p></li>
353</ul></div>
354</li></ul></div>
355</div>
356<div class="refsect3">
357<a name="id-1.2.15.21.9.6"></a><h4>Shutdown phase</h4>
358<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>GstVideoEncoder class calls <em class="parameter"><code>stop</code></em>
359 to inform the subclass that data
360parsing will be stopped.</p></li></ul></div>
361<p>Subclass is responsible for providing pad template caps for
362source and sink pads. The pads need to be named "sink" and "src". It should
363also be able to provide fixed src pad caps in <em class="parameter"><code>getcaps</code></em>
364 by the time it calls
365<em class="parameter"><code>gst_video_encoder_finish_frame</code></em>
366.</p>
367<p>Things that subclass need to take care of:</p>
368<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
369<li class="listitem"><p>Provide pad templates</p></li>
370<li class="listitem"><p>Provide source pad caps before pushing the first buffer</p></li>
371<li class="listitem"><p>Accept data in <em class="parameter"><code>handle_frame</code></em>
372 and provide encoded results to
373 <em class="parameter"><code>gst_video_encoder_finish_frame</code></em>
374.</p></li>
375</ul></div>
376<p>The <a class="link" href="GstVideoEncoder.html#GstVideoEncoder--qos" title="The “qos” property"><span class="type">“qos”</span></a> property will enable the Quality-of-Service
377features of the encoder which gather statistics about the real-time
378performance of the downstream elements. If enabled, subclasses can
379use <a class="link" href="GstVideoEncoder.html#gst-video-encoder-get-max-encode-time" title="gst_video_encoder_get_max_encode_time ()"><code class="function">gst_video_encoder_get_max_encode_time()</code></a> to check if input frames
380are already late and drop them right away to give a chance to the
381pipeline to catch up.</p>
382</div>
383</div>
384<div class="refsect1">
385<a name="GstVideoEncoder.functions_details"></a><h2>Functions</h2>
386<div class="refsect2">
387<a name="GST-VIDEO-ENCODER-CAST:CAPS"></a><h3>GST_VIDEO_ENCODER_CAST()</h3>
388<pre class="programlisting">#define GST_VIDEO_ENCODER_CAST(enc) ((GstVideoEncoder*)enc)
389</pre>
390</div>
391<hr>
392<div class="refsect2">
393<a name="GST-VIDEO-ENCODER-SINK-PAD:CAPS"></a><h3>GST_VIDEO_ENCODER_SINK_PAD()</h3>
394<pre class="programlisting">#define GST_VIDEO_ENCODER_SINK_PAD(obj)        (((GstVideoEncoder *) (obj))-&gt;sinkpad)
395</pre>
396<p>Gives the pointer to the sink <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GstPad-struct"><span class="type">GstPad</span></a> object of the element.</p>
397<div class="refsect3">
398<a name="GST-VIDEO-ENCODER-SINK-PAD.parameters"></a><h4>Parameters</h4>
399<div class="informaltable"><table class="informaltable" width="100%" border="0">
400<colgroup>
401<col width="150px" class="parameters_name">
402<col class="parameters_description">
403<col width="200px" class="parameters_annotations">
404</colgroup>
405<tbody><tr>
406<td class="parameter_name"><p>obj</p></td>
407<td class="parameter_description"><p>a <a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a></p></td>
408<td class="parameter_annotations"> </td>
409</tr></tbody>
410</table></div>
411</div>
412</div>
413<hr>
414<div class="refsect2">
415<a name="GST-VIDEO-ENCODER-SRC-PAD:CAPS"></a><h3>GST_VIDEO_ENCODER_SRC_PAD()</h3>
416<pre class="programlisting">#define GST_VIDEO_ENCODER_SRC_PAD(obj)         (((GstVideoEncoder *) (obj))-&gt;srcpad)
417</pre>
418<p>Gives the pointer to the source <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GstPad-struct"><span class="type">GstPad</span></a> object of the element.</p>
419<div class="refsect3">
420<a name="GST-VIDEO-ENCODER-SRC-PAD.parameters"></a><h4>Parameters</h4>
421<div class="informaltable"><table class="informaltable" width="100%" border="0">
422<colgroup>
423<col width="150px" class="parameters_name">
424<col class="parameters_description">
425<col width="200px" class="parameters_annotations">
426</colgroup>
427<tbody><tr>
428<td class="parameter_name"><p>obj</p></td>
429<td class="parameter_description"><p>a <a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a></p></td>
430<td class="parameter_annotations"> </td>
431</tr></tbody>
432</table></div>
433</div>
434</div>
435<hr>
436<div class="refsect2">
437<a name="GST-VIDEO-ENCODER-INPUT-SEGMENT:CAPS"></a><h3>GST_VIDEO_ENCODER_INPUT_SEGMENT()</h3>
438<pre class="programlisting">#define GST_VIDEO_ENCODER_INPUT_SEGMENT(obj)     (GST_VIDEO_ENCODER_CAST (obj)-&gt;input_segment)
439</pre>
440<p>Gives the segment of the element.</p>
441<div class="refsect3">
442<a name="GST-VIDEO-ENCODER-INPUT-SEGMENT.parameters"></a><h4>Parameters</h4>
443<div class="informaltable"><table class="informaltable" width="100%" border="0">
444<colgroup>
445<col width="150px" class="parameters_name">
446<col class="parameters_description">
447<col width="200px" class="parameters_annotations">
448</colgroup>
449<tbody><tr>
450<td class="parameter_name"><p>obj</p></td>
451<td class="parameter_description"><p>base parse instance</p></td>
452<td class="parameter_annotations"> </td>
453</tr></tbody>
454</table></div>
455</div>
456</div>
457<hr>
458<div class="refsect2">
459<a name="GST-VIDEO-ENCODER-OUTPUT-SEGMENT:CAPS"></a><h3>GST_VIDEO_ENCODER_OUTPUT_SEGMENT()</h3>
460<pre class="programlisting">#define GST_VIDEO_ENCODER_OUTPUT_SEGMENT(obj)     (GST_VIDEO_ENCODER_CAST (obj)-&gt;output_segment)
461</pre>
462<p>Gives the segment of the element.</p>
463<div class="refsect3">
464<a name="GST-VIDEO-ENCODER-OUTPUT-SEGMENT.parameters"></a><h4>Parameters</h4>
465<div class="informaltable"><table class="informaltable" width="100%" border="0">
466<colgroup>
467<col width="150px" class="parameters_name">
468<col class="parameters_description">
469<col width="200px" class="parameters_annotations">
470</colgroup>
471<tbody><tr>
472<td class="parameter_name"><p>obj</p></td>
473<td class="parameter_description"><p>base parse instance</p></td>
474<td class="parameter_annotations"> </td>
475</tr></tbody>
476</table></div>
477</div>
478</div>
479<hr>
480<div class="refsect2">
481<a name="GST-VIDEO-ENCODER-STREAM-LOCK:CAPS"></a><h3>GST_VIDEO_ENCODER_STREAM_LOCK()</h3>
482<pre class="programlisting">#define GST_VIDEO_ENCODER_STREAM_LOCK(encoder) g_rec_mutex_lock (&amp;GST_VIDEO_ENCODER (encoder)-&gt;stream_lock)
483</pre>
484<p>Obtain a lock to protect the encoder function from concurrent access.</p>
485<div class="refsect3">
486<a name="GST-VIDEO-ENCODER-STREAM-LOCK.parameters"></a><h4>Parameters</h4>
487<div class="informaltable"><table class="informaltable" width="100%" border="0">
488<colgroup>
489<col width="150px" class="parameters_name">
490<col class="parameters_description">
491<col width="200px" class="parameters_annotations">
492</colgroup>
493<tbody><tr>
494<td class="parameter_name"><p>encoder</p></td>
495<td class="parameter_description"><p>video encoder instance</p></td>
496<td class="parameter_annotations"> </td>
497</tr></tbody>
498</table></div>
499</div>
500</div>
501<hr>
502<div class="refsect2">
503<a name="GST-VIDEO-ENCODER-STREAM-UNLOCK:CAPS"></a><h3>GST_VIDEO_ENCODER_STREAM_UNLOCK()</h3>
504<pre class="programlisting">#define GST_VIDEO_ENCODER_STREAM_UNLOCK(encoder) g_rec_mutex_unlock (&amp;GST_VIDEO_ENCODER (encoder)-&gt;stream_lock)
505</pre>
506<p>Release the lock that protects the encoder function from concurrent access.</p>
507<div class="refsect3">
508<a name="GST-VIDEO-ENCODER-STREAM-UNLOCK.parameters"></a><h4>Parameters</h4>
509<div class="informaltable"><table class="informaltable" width="100%" border="0">
510<colgroup>
511<col width="150px" class="parameters_name">
512<col class="parameters_description">
513<col width="200px" class="parameters_annotations">
514</colgroup>
515<tbody><tr>
516<td class="parameter_name"><p>encoder</p></td>
517<td class="parameter_description"><p>video encoder instance</p></td>
518<td class="parameter_annotations"> </td>
519</tr></tbody>
520</table></div>
521</div>
522</div>
523<hr>
524<div class="refsect2">
525<a name="gst-video-encoder-allocate-output-buffer"></a><h3>gst_video_encoder_allocate_output_buffer ()</h3>
526<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstBuffer.html#GstBuffer-struct"><span class="returnvalue">GstBuffer</span></a> *
527gst_video_encoder_allocate_output_buffer
528                               (<em class="parameter"><code><a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a> *encoder</code></em>,
529                                <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>);</pre>
530<p>Helper function that allocates a buffer to hold an encoded video frame
531for <em class="parameter"><code>encoder</code></em>
532's current <a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecState" title="struct GstVideoCodecState"><span class="type">GstVideoCodecState</span></a>.</p>
533<div class="refsect3">
534<a name="gst-video-encoder-allocate-output-buffer.parameters"></a><h4>Parameters</h4>
535<div class="informaltable"><table class="informaltable" width="100%" border="0">
536<colgroup>
537<col width="150px" class="parameters_name">
538<col class="parameters_description">
539<col width="200px" class="parameters_annotations">
540</colgroup>
541<tbody>
542<tr>
543<td class="parameter_name"><p>encoder</p></td>
544<td class="parameter_description"><p>a <a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a></p></td>
545<td class="parameter_annotations"> </td>
546</tr>
547<tr>
548<td class="parameter_name"><p>size</p></td>
549<td class="parameter_description"><p>size of the buffer</p></td>
550<td class="parameter_annotations"> </td>
551</tr>
552</tbody>
553</table></div>
554</div>
555<div class="refsect3">
556<a name="gst-video-encoder-allocate-output-buffer.returns"></a><h4>Returns</h4>
557<p>allocated buffer. </p>
558<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
559</div>
560</div>
561<hr>
562<div class="refsect2">
563<a name="gst-video-encoder-allocate-output-frame"></a><h3>gst_video_encoder_allocate_output_frame ()</h3>
564<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>
565gst_video_encoder_allocate_output_frame
566                               (<em class="parameter"><code><a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a> *encoder</code></em>,
567                                <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecFrame" title="struct GstVideoCodecFrame"><span class="type">GstVideoCodecFrame</span></a> *frame</code></em>,
568                                <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>);</pre>
569<p>Helper function that allocates a buffer to hold an encoded video frame for <em class="parameter"><code>encoder</code></em>
570's
571current <a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecState" title="struct GstVideoCodecState"><span class="type">GstVideoCodecState</span></a>.  Subclass should already have configured video
572state and set src pad caps.</p>
573<p>The buffer allocated here is owned by the frame and you should only
574keep references to the frame, not the buffer.</p>
575<div class="refsect3">
576<a name="gst-video-encoder-allocate-output-frame.parameters"></a><h4>Parameters</h4>
577<div class="informaltable"><table class="informaltable" width="100%" border="0">
578<colgroup>
579<col width="150px" class="parameters_name">
580<col class="parameters_description">
581<col width="200px" class="parameters_annotations">
582</colgroup>
583<tbody>
584<tr>
585<td class="parameter_name"><p>encoder</p></td>
586<td class="parameter_description"><p>a <a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a></p></td>
587<td class="parameter_annotations"> </td>
588</tr>
589<tr>
590<td class="parameter_name"><p>frame</p></td>
591<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecFrame" title="struct GstVideoCodecFrame"><span class="type">GstVideoCodecFrame</span></a></p></td>
592<td class="parameter_annotations"> </td>
593</tr>
594<tr>
595<td class="parameter_name"><p>size</p></td>
596<td class="parameter_description"><p>size of the buffer</p></td>
597<td class="parameter_annotations"> </td>
598</tr>
599</tbody>
600</table></div>
601</div>
602<div class="refsect3">
603<a name="gst-video-encoder-allocate-output-frame.returns"></a><h4>Returns</h4>
604<p> <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GST-FLOW-OK:CAPS"><code class="literal">GST_FLOW_OK</code></a> if an output buffer could be allocated</p>
605</div>
606</div>
607<hr>
608<div class="refsect2">
609<a name="gst-video-encoder-get-allocator"></a><h3>gst_video_encoder_get_allocator ()</h3>
610<pre class="programlisting"><span class="returnvalue">void</span>
611gst_video_encoder_get_allocator (<em class="parameter"><code><a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a> *encoder</code></em>,
612                                 <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstAllocator.html#GstAllocator-struct"><span class="type">GstAllocator</span></a> **allocator</code></em>,
613                                 <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstAllocator.html#GstAllocationParams-struct"><span class="type">GstAllocationParams</span></a> *params</code></em>);</pre>
614<p>Lets <a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a> sub-classes to know the memory <em class="parameter"><code>allocator</code></em>
615
616used by the base class and its <em class="parameter"><code>params</code></em>
617.</p>
618<p>Unref the <em class="parameter"><code>allocator</code></em>
619 after use it.</p>
620<div class="refsect3">
621<a name="gst-video-encoder-get-allocator.parameters"></a><h4>Parameters</h4>
622<div class="informaltable"><table class="informaltable" width="100%" border="0">
623<colgroup>
624<col width="150px" class="parameters_name">
625<col class="parameters_description">
626<col width="200px" class="parameters_annotations">
627</colgroup>
628<tbody>
629<tr>
630<td class="parameter_name"><p>encoder</p></td>
631<td class="parameter_description"><p>a <a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a></p></td>
632<td class="parameter_annotations"> </td>
633</tr>
634<tr>
635<td class="parameter_name"><p>allocator</p></td>
636<td class="parameter_description"><p>the <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstAllocator.html#GstAllocator-struct"><span class="type">GstAllocator</span></a>
637used. </p></td>
638<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td>
639</tr>
640<tr>
641<td class="parameter_name"><p>params</p></td>
642<td class="parameter_description"><p>the
643<a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstAllocator.html#GstAllocationParams-struct"><span class="type">GstAllocationParams</span></a> of <em class="parameter"><code>allocator</code></em>
644. </p></td>
645<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td>
646</tr>
647</tbody>
648</table></div>
649</div>
650</div>
651<hr>
652<div class="refsect2">
653<a name="gst-video-encoder-finish-frame"></a><h3>gst_video_encoder_finish_frame ()</h3>
654<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>
655gst_video_encoder_finish_frame (<em class="parameter"><code><a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a> *encoder</code></em>,
656                                <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecFrame" title="struct GstVideoCodecFrame"><span class="type">GstVideoCodecFrame</span></a> *frame</code></em>);</pre>
657<p><em class="parameter"><code>frame</code></em>
658 must have a valid encoded data buffer, whose metadata fields
659are then appropriately set according to frame data or no buffer at
660all if the frame should be dropped.
661It is subsequently pushed downstream or provided to <em class="parameter"><code>pre_push</code></em>
662.
663In any case, the frame is considered finished and released.</p>
664<p>After calling this function the output buffer of the frame is to be
665considered read-only. This function will also change the metadata
666of the buffer.</p>
667<div class="refsect3">
668<a name="gst-video-encoder-finish-frame.parameters"></a><h4>Parameters</h4>
669<div class="informaltable"><table class="informaltable" width="100%" border="0">
670<colgroup>
671<col width="150px" class="parameters_name">
672<col class="parameters_description">
673<col width="200px" class="parameters_annotations">
674</colgroup>
675<tbody>
676<tr>
677<td class="parameter_name"><p>encoder</p></td>
678<td class="parameter_description"><p>a <a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a></p></td>
679<td class="parameter_annotations"> </td>
680</tr>
681<tr>
682<td class="parameter_name"><p>frame</p></td>
683<td class="parameter_description"><p>an encoded <a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecFrame" title="struct GstVideoCodecFrame"><span class="type">GstVideoCodecFrame</span></a>. </p></td>
684<td class="parameter_annotations"><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td>
685</tr>
686</tbody>
687</table></div>
688</div>
689<div class="refsect3">
690<a name="gst-video-encoder-finish-frame.returns"></a><h4>Returns</h4>
691<p> a <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GstFlowReturn"><span class="type">GstFlowReturn</span></a> resulting from sending data downstream</p>
692</div>
693</div>
694<hr>
695<div class="refsect2">
696<a name="gst-video-encoder-negotiate"></a><h3>gst_video_encoder_negotiate ()</h3>
697<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
698gst_video_encoder_negotiate (<em class="parameter"><code><a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a> *encoder</code></em>);</pre>
699<p>Negotiate with downstream elements to currently configured <a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecState" title="struct GstVideoCodecState"><span class="type">GstVideoCodecState</span></a>.
700Unmark GST_PAD_FLAG_NEED_RECONFIGURE in any case. But mark it again if
701negotiate fails.</p>
702<div class="refsect3">
703<a name="gst-video-encoder-negotiate.parameters"></a><h4>Parameters</h4>
704<div class="informaltable"><table class="informaltable" width="100%" border="0">
705<colgroup>
706<col width="150px" class="parameters_name">
707<col class="parameters_description">
708<col width="200px" class="parameters_annotations">
709</colgroup>
710<tbody><tr>
711<td class="parameter_name"><p>encoder</p></td>
712<td class="parameter_description"><p>a <a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a></p></td>
713<td class="parameter_annotations"> </td>
714</tr></tbody>
715</table></div>
716</div>
717<div class="refsect3">
718<a name="gst-video-encoder-negotiate.returns"></a><h4>Returns</h4>
719<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the negotiation succeeded, else <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.</p>
720</div>
721</div>
722<hr>
723<div class="refsect2">
724<a name="gst-video-encoder-get-frame"></a><h3>gst_video_encoder_get_frame ()</h3>
725<pre class="programlisting"><a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecFrame" title="struct GstVideoCodecFrame"><span class="returnvalue">GstVideoCodecFrame</span></a> *
726gst_video_encoder_get_frame (<em class="parameter"><code><a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a> *encoder</code></em>,
727                             <em class="parameter"><code><span class="type">int</span> frame_number</code></em>);</pre>
728<p>Get a pending unfinished <a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecFrame" title="struct GstVideoCodecFrame"><span class="type">GstVideoCodecFrame</span></a></p>
729<div class="refsect3">
730<a name="gst-video-encoder-get-frame.parameters"></a><h4>Parameters</h4>
731<div class="informaltable"><table class="informaltable" width="100%" border="0">
732<colgroup>
733<col width="150px" class="parameters_name">
734<col class="parameters_description">
735<col width="200px" class="parameters_annotations">
736</colgroup>
737<tbody>
738<tr>
739<td class="parameter_name"><p>encoder</p></td>
740<td class="parameter_description"><p>a <a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a></p></td>
741<td class="parameter_annotations"> </td>
742</tr>
743<tr>
744<td class="parameter_name"><p>frame_number</p></td>
745<td class="parameter_description"><p>system_frame_number of a frame</p></td>
746<td class="parameter_annotations"> </td>
747</tr>
748</tbody>
749</table></div>
750</div>
751<div class="refsect3">
752<a name="gst-video-encoder-get-frame.returns"></a><h4>Returns</h4>
753<p>pending unfinished <a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecFrame" title="struct GstVideoCodecFrame"><span class="type">GstVideoCodecFrame</span></a> identified by <em class="parameter"><code>frame_number</code></em>
754. </p>
755<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
756</div>
757</div>
758<hr>
759<div class="refsect2">
760<a name="gst-video-encoder-get-frames"></a><h3>gst_video_encoder_get_frames ()</h3>
761<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a> *
762gst_video_encoder_get_frames (<em class="parameter"><code><a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a> *encoder</code></em>);</pre>
763<p>Get all pending unfinished <a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecFrame" title="struct GstVideoCodecFrame"><span class="type">GstVideoCodecFrame</span></a></p>
764<div class="refsect3">
765<a name="gst-video-encoder-get-frames.parameters"></a><h4>Parameters</h4>
766<div class="informaltable"><table class="informaltable" width="100%" border="0">
767<colgroup>
768<col width="150px" class="parameters_name">
769<col class="parameters_description">
770<col width="200px" class="parameters_annotations">
771</colgroup>
772<tbody><tr>
773<td class="parameter_name"><p>encoder</p></td>
774<td class="parameter_description"><p>a <a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a></p></td>
775<td class="parameter_annotations"> </td>
776</tr></tbody>
777</table></div>
778</div>
779<div class="refsect3">
780<a name="gst-video-encoder-get-frames.returns"></a><h4>Returns</h4>
781<p>pending unfinished <a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecFrame" title="struct GstVideoCodecFrame"><span class="type">GstVideoCodecFrame</span></a>. </p>
782<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GstVideoCodecFrame]</span></p>
783</div>
784</div>
785<hr>
786<div class="refsect2">
787<a name="gst-video-encoder-get-oldest-frame"></a><h3>gst_video_encoder_get_oldest_frame ()</h3>
788<pre class="programlisting"><a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecFrame" title="struct GstVideoCodecFrame"><span class="returnvalue">GstVideoCodecFrame</span></a> *
789gst_video_encoder_get_oldest_frame (<em class="parameter"><code><a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a> *encoder</code></em>);</pre>
790<p>Get the oldest unfinished pending <a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecFrame" title="struct GstVideoCodecFrame"><span class="type">GstVideoCodecFrame</span></a></p>
791<div class="refsect3">
792<a name="gst-video-encoder-get-oldest-frame.parameters"></a><h4>Parameters</h4>
793<div class="informaltable"><table class="informaltable" width="100%" border="0">
794<colgroup>
795<col width="150px" class="parameters_name">
796<col class="parameters_description">
797<col width="200px" class="parameters_annotations">
798</colgroup>
799<tbody><tr>
800<td class="parameter_name"><p>encoder</p></td>
801<td class="parameter_description"><p>a <a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a></p></td>
802<td class="parameter_annotations"> </td>
803</tr></tbody>
804</table></div>
805</div>
806<div class="refsect3">
807<a name="gst-video-encoder-get-oldest-frame.returns"></a><h4>Returns</h4>
808<p>oldest unfinished pending <a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecFrame" title="struct GstVideoCodecFrame"><span class="type">GstVideoCodecFrame</span></a>. </p>
809<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
810</div>
811</div>
812<hr>
813<div class="refsect2">
814<a name="gst-video-encoder-set-headers"></a><h3>gst_video_encoder_set_headers ()</h3>
815<pre class="programlisting"><span class="returnvalue">void</span>
816gst_video_encoder_set_headers (<em class="parameter"><code><a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a> *encoder</code></em>,
817                               <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList"><span class="type">GList</span></a> *headers</code></em>);</pre>
818<p>Set the codec headers to be sent downstream whenever requested.</p>
819<div class="refsect3">
820<a name="gst-video-encoder-set-headers.parameters"></a><h4>Parameters</h4>
821<div class="informaltable"><table class="informaltable" width="100%" border="0">
822<colgroup>
823<col width="150px" class="parameters_name">
824<col class="parameters_description">
825<col width="200px" class="parameters_annotations">
826</colgroup>
827<tbody>
828<tr>
829<td class="parameter_name"><p>encoder</p></td>
830<td class="parameter_description"><p>a <a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a></p></td>
831<td class="parameter_annotations"> </td>
832</tr>
833<tr>
834<td class="parameter_name"><p>headers</p></td>
835<td class="parameter_description"><p>a list of <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstBuffer.html#GstBuffer-struct"><span class="type">GstBuffer</span></a> containing the codec header. </p></td>
836<td class="parameter_annotations"><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GstBuffer]</span></td>
837</tr>
838</tbody>
839</table></div>
840</div>
841</div>
842<hr>
843<div class="refsect2">
844<a name="gst-video-encoder-get-latency"></a><h3>gst_video_encoder_get_latency ()</h3>
845<pre class="programlisting"><span class="returnvalue">void</span>
846gst_video_encoder_get_latency (<em class="parameter"><code><a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a> *encoder</code></em>,
847                               <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstClock.html#GstClockTime"><span class="type">GstClockTime</span></a> *min_latency</code></em>,
848                               <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstClock.html#GstClockTime"><span class="type">GstClockTime</span></a> *max_latency</code></em>);</pre>
849<p>Query the configured encoding latency. Results will be returned via
850<em class="parameter"><code>min_latency</code></em>
851 and <em class="parameter"><code>max_latency</code></em>
852.</p>
853<div class="refsect3">
854<a name="gst-video-encoder-get-latency.parameters"></a><h4>Parameters</h4>
855<div class="informaltable"><table class="informaltable" width="100%" border="0">
856<colgroup>
857<col width="150px" class="parameters_name">
858<col class="parameters_description">
859<col width="200px" class="parameters_annotations">
860</colgroup>
861<tbody>
862<tr>
863<td class="parameter_name"><p>encoder</p></td>
864<td class="parameter_description"><p>a <a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a></p></td>
865<td class="parameter_annotations"> </td>
866</tr>
867<tr>
868<td class="parameter_name"><p>min_latency</p></td>
869<td class="parameter_description"><p>address of variable in which to store the
870configured minimum latency, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
871<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
872</tr>
873<tr>
874<td class="parameter_name"><p>max_latency</p></td>
875<td class="parameter_description"><p>address of variable in which to store the
876configured maximum latency, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
877<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
878</tr>
879</tbody>
880</table></div>
881</div>
882</div>
883<hr>
884<div class="refsect2">
885<a name="gst-video-encoder-set-latency"></a><h3>gst_video_encoder_set_latency ()</h3>
886<pre class="programlisting"><span class="returnvalue">void</span>
887gst_video_encoder_set_latency (<em class="parameter"><code><a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a> *encoder</code></em>,
888                               <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstClock.html#GstClockTime"><span class="type">GstClockTime</span></a> min_latency</code></em>,
889                               <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstClock.html#GstClockTime"><span class="type">GstClockTime</span></a> max_latency</code></em>);</pre>
890<p>Informs baseclass of encoding latency.</p>
891<div class="refsect3">
892<a name="gst-video-encoder-set-latency.parameters"></a><h4>Parameters</h4>
893<div class="informaltable"><table class="informaltable" width="100%" border="0">
894<colgroup>
895<col width="150px" class="parameters_name">
896<col class="parameters_description">
897<col width="200px" class="parameters_annotations">
898</colgroup>
899<tbody>
900<tr>
901<td class="parameter_name"><p>encoder</p></td>
902<td class="parameter_description"><p>a <a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a></p></td>
903<td class="parameter_annotations"> </td>
904</tr>
905<tr>
906<td class="parameter_name"><p>min_latency</p></td>
907<td class="parameter_description"><p>minimum latency</p></td>
908<td class="parameter_annotations"> </td>
909</tr>
910<tr>
911<td class="parameter_name"><p>max_latency</p></td>
912<td class="parameter_description"><p>maximum latency</p></td>
913<td class="parameter_annotations"> </td>
914</tr>
915</tbody>
916</table></div>
917</div>
918</div>
919<hr>
920<div class="refsect2">
921<a name="gst-video-encoder-set-output-state"></a><h3>gst_video_encoder_set_output_state ()</h3>
922<pre class="programlisting"><a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecState" title="struct GstVideoCodecState"><span class="returnvalue">GstVideoCodecState</span></a> *
923gst_video_encoder_set_output_state (<em class="parameter"><code><a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a> *encoder</code></em>,
924                                    <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstCaps.html#GstCaps-struct"><span class="type">GstCaps</span></a> *caps</code></em>,
925                                    <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecState" title="struct GstVideoCodecState"><span class="type">GstVideoCodecState</span></a> *reference</code></em>);</pre>
926<p>Creates a new <a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecState" title="struct GstVideoCodecState"><span class="type">GstVideoCodecState</span></a> with the specified caps as the output state
927for the encoder.
928Any previously set output state on <em class="parameter"><code>encoder</code></em>
929 will be replaced by the newly
930created one.</p>
931<p>The specified <em class="parameter"><code>caps</code></em>
932 should not contain any resolution, pixel-aspect-ratio,
933framerate, codec-data, .... Those should be specified instead in the returned
934<a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecState" title="struct GstVideoCodecState"><span class="type">GstVideoCodecState</span></a>.</p>
935<p>If the subclass wishes to copy over existing fields (like pixel aspect ratio,
936or framerate) from an existing <a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecState" title="struct GstVideoCodecState"><span class="type">GstVideoCodecState</span></a>, it can be provided as a
937<em class="parameter"><code>reference</code></em>
938.</p>
939<p>If the subclass wishes to override some fields from the output state (like
940pixel-aspect-ratio or framerate) it can do so on the returned <a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecState" title="struct GstVideoCodecState"><span class="type">GstVideoCodecState</span></a>.</p>
941<p>The new output state will only take effect (set on pads and buffers) starting
942from the next call to <a class="link" href="GstVideoEncoder.html#gst-video-encoder-finish-frame" title="gst_video_encoder_finish_frame ()"><code class="function">gst_video_encoder_finish_frame()</code></a>.</p>
943<div class="refsect3">
944<a name="gst-video-encoder-set-output-state.parameters"></a><h4>Parameters</h4>
945<div class="informaltable"><table class="informaltable" width="100%" border="0">
946<colgroup>
947<col width="150px" class="parameters_name">
948<col class="parameters_description">
949<col width="200px" class="parameters_annotations">
950</colgroup>
951<tbody>
952<tr>
953<td class="parameter_name"><p>encoder</p></td>
954<td class="parameter_description"><p>a <a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a></p></td>
955<td class="parameter_annotations"> </td>
956</tr>
957<tr>
958<td class="parameter_name"><p>caps</p></td>
959<td class="parameter_description"><p>the <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstCaps.html#GstCaps-struct"><span class="type">GstCaps</span></a> to use for the output. </p></td>
960<td class="parameter_annotations"><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td>
961</tr>
962<tr>
963<td class="parameter_name"><p>reference</p></td>
964<td class="parameter_description"><p>An optional reference <em class="parameter"><code>GstVideoCodecState</code></em>
965. </p></td>
966<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></td>
967</tr>
968</tbody>
969</table></div>
970</div>
971<div class="refsect3">
972<a name="gst-video-encoder-set-output-state.returns"></a><h4>Returns</h4>
973<p>the newly configured output state. </p>
974<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
975</div>
976</div>
977<hr>
978<div class="refsect2">
979<a name="gst-video-encoder-get-output-state"></a><h3>gst_video_encoder_get_output_state ()</h3>
980<pre class="programlisting"><a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecState" title="struct GstVideoCodecState"><span class="returnvalue">GstVideoCodecState</span></a> *
981gst_video_encoder_get_output_state (<em class="parameter"><code><a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a> *encoder</code></em>);</pre>
982<p>Get the current <a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecState" title="struct GstVideoCodecState"><span class="type">GstVideoCodecState</span></a></p>
983<div class="refsect3">
984<a name="gst-video-encoder-get-output-state.parameters"></a><h4>Parameters</h4>
985<div class="informaltable"><table class="informaltable" width="100%" border="0">
986<colgroup>
987<col width="150px" class="parameters_name">
988<col class="parameters_description">
989<col width="200px" class="parameters_annotations">
990</colgroup>
991<tbody><tr>
992<td class="parameter_name"><p>encoder</p></td>
993<td class="parameter_description"><p>a <a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a></p></td>
994<td class="parameter_annotations"> </td>
995</tr></tbody>
996</table></div>
997</div>
998<div class="refsect3">
999<a name="gst-video-encoder-get-output-state.returns"></a><h4>Returns</h4>
1000<p><a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecState" title="struct GstVideoCodecState"><span class="type">GstVideoCodecState</span></a> describing format of video data. </p>
1001<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
1002</div>
1003</div>
1004<hr>
1005<div class="refsect2">
1006<a name="gst-video-encoder-set-min-pts"></a><h3>gst_video_encoder_set_min_pts ()</h3>
1007<pre class="programlisting"><span class="returnvalue">void</span>
1008gst_video_encoder_set_min_pts (<em class="parameter"><code><a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a> *encoder</code></em>,
1009                               <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstClock.html#GstClockTime"><span class="type">GstClockTime</span></a> min_pts</code></em>);</pre>
1010<p>Request minimal value for PTS passed to handle_frame.</p>
1011<p>For streams with reordered frames this can be used to ensure that there
1012is enough time to accomodate first DTS, which may be less than first PTS</p>
1013<div class="refsect3">
1014<a name="gst-video-encoder-set-min-pts.parameters"></a><h4>Parameters</h4>
1015<div class="informaltable"><table class="informaltable" width="100%" border="0">
1016<colgroup>
1017<col width="150px" class="parameters_name">
1018<col class="parameters_description">
1019<col width="200px" class="parameters_annotations">
1020</colgroup>
1021<tbody>
1022<tr>
1023<td class="parameter_name"><p>encoder</p></td>
1024<td class="parameter_description"><p>a <a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a></p></td>
1025<td class="parameter_annotations"> </td>
1026</tr>
1027<tr>
1028<td class="parameter_name"><p>min_pts</p></td>
1029<td class="parameter_description"><p>minimal PTS that will be passed to handle_frame</p></td>
1030<td class="parameter_annotations"> </td>
1031</tr>
1032</tbody>
1033</table></div>
1034</div>
1035<p class="since">Since: <a class="link" href="ix10.html#api-index-1.6">1.6</a></p>
1036</div>
1037<hr>
1038<div class="refsect2">
1039<a name="gst-video-encoder-proxy-getcaps"></a><h3>gst_video_encoder_proxy_getcaps ()</h3>
1040<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstCaps.html#GstCaps-struct"><span class="returnvalue">GstCaps</span></a> *
1041gst_video_encoder_proxy_getcaps (<em class="parameter"><code><a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a> *enc</code></em>,
1042                                 <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstCaps.html#GstCaps-struct"><span class="type">GstCaps</span></a> *caps</code></em>,
1043                                 <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstCaps.html#GstCaps-struct"><span class="type">GstCaps</span></a> *filter</code></em>);</pre>
1044<p>Returns caps that express <em class="parameter"><code>caps</code></em>
1045 (or sink template caps if <em class="parameter"><code>caps</code></em>
1046 == NULL)
1047restricted to resolution/format/... combinations supported by downstream
1048elements (e.g. muxers).</p>
1049<div class="refsect3">
1050<a name="gst-video-encoder-proxy-getcaps.parameters"></a><h4>Parameters</h4>
1051<div class="informaltable"><table class="informaltable" width="100%" border="0">
1052<colgroup>
1053<col width="150px" class="parameters_name">
1054<col class="parameters_description">
1055<col width="200px" class="parameters_annotations">
1056</colgroup>
1057<tbody>
1058<tr>
1059<td class="parameter_name"><p>enc</p></td>
1060<td class="parameter_description"><p>a <a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a></p></td>
1061<td class="parameter_annotations"> </td>
1062</tr>
1063<tr>
1064<td class="parameter_name"><p>caps</p></td>
1065<td class="parameter_description"><p>initial caps. </p></td>
1066<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
1067</tr>
1068<tr>
1069<td class="parameter_name"><p>filter</p></td>
1070<td class="parameter_description"><p>filter caps. </p></td>
1071<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
1072</tr>
1073</tbody>
1074</table></div>
1075</div>
1076<div class="refsect3">
1077<a name="gst-video-encoder-proxy-getcaps.returns"></a><h4>Returns</h4>
1078<p>a <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstCaps.html#GstCaps-struct"><span class="type">GstCaps</span></a> owned by caller. </p>
1079<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
1080</div>
1081</div>
1082<hr>
1083<div class="refsect2">
1084<a name="gst-video-encoder-merge-tags"></a><h3>gst_video_encoder_merge_tags ()</h3>
1085<pre class="programlisting"><span class="returnvalue">void</span>
1086gst_video_encoder_merge_tags (<em class="parameter"><code><a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a> *encoder</code></em>,
1087                              <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstTagList.html#GstTagList-struct"><span class="type">GstTagList</span></a> *tags</code></em>,
1088                              <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstTagList.html#GstTagMergeMode"><span class="type">GstTagMergeMode</span></a> mode</code></em>);</pre>
1089<p>Sets the video encoder tags and how they should be merged with any
1090upstream stream tags. This will override any tags previously-set
1091with <a class="link" href="GstVideoEncoder.html#gst-video-encoder-merge-tags" title="gst_video_encoder_merge_tags ()"><code class="function">gst_video_encoder_merge_tags()</code></a>.</p>
1092<p>Note that this is provided for convenience, and the subclass is
1093not required to use this and can still do tag handling on its own.</p>
1094<p>MT safe.</p>
1095<div class="refsect3">
1096<a name="gst-video-encoder-merge-tags.parameters"></a><h4>Parameters</h4>
1097<div class="informaltable"><table class="informaltable" width="100%" border="0">
1098<colgroup>
1099<col width="150px" class="parameters_name">
1100<col class="parameters_description">
1101<col width="200px" class="parameters_annotations">
1102</colgroup>
1103<tbody>
1104<tr>
1105<td class="parameter_name"><p>encoder</p></td>
1106<td class="parameter_description"><p>a <a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a></p></td>
1107<td class="parameter_annotations"> </td>
1108</tr>
1109<tr>
1110<td class="parameter_name"><p>tags</p></td>
1111<td class="parameter_description"><p>a <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstTagList.html#GstTagList-struct"><span class="type">GstTagList</span></a> to merge, or NULL to unset
1112previously-set tags. </p></td>
1113<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
1114</tr>
1115<tr>
1116<td class="parameter_name"><p>mode</p></td>
1117<td class="parameter_description"><p>the <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstTagList.html#GstTagMergeMode"><span class="type">GstTagMergeMode</span></a> to use, usually <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstTagList.html#GST-TAG-MERGE-REPLACE:CAPS"><span class="type">GST_TAG_MERGE_REPLACE</span></a></p></td>
1118<td class="parameter_annotations"> </td>
1119</tr>
1120</tbody>
1121</table></div>
1122</div>
1123</div>
1124<hr>
1125<div class="refsect2">
1126<a name="gst-video-encoder-get-max-encode-time"></a><h3>gst_video_encoder_get_max_encode_time ()</h3>
1127<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstClock.html#GstClockTimeDiff"><span class="returnvalue">GstClockTimeDiff</span></a>
1128gst_video_encoder_get_max_encode_time (<em class="parameter"><code><a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a> *encoder</code></em>,
1129                                       <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecFrame" title="struct GstVideoCodecFrame"><span class="type">GstVideoCodecFrame</span></a> *frame</code></em>);</pre>
1130<p>Determines maximum possible encoding time for <em class="parameter"><code>frame</code></em>
1131 that will
1132allow it to encode and arrive in time (as determined by QoS events).
1133In particular, a negative result means encoding in time is no longer possible
1134and should therefore occur as soon/skippy as possible.</p>
1135<p>If no QoS events have been received from downstream, or if
1136<a class="link" href="GstVideoEncoder.html#GstVideoEncoder--qos" title="The “qos” property"><span class="type">“qos”</span></a> is disabled this function returns <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#G-MAXINT64:CAPS"><span class="type">G_MAXINT64</span></a>.</p>
1137<div class="refsect3">
1138<a name="gst-video-encoder-get-max-encode-time.parameters"></a><h4>Parameters</h4>
1139<div class="informaltable"><table class="informaltable" width="100%" border="0">
1140<colgroup>
1141<col width="150px" class="parameters_name">
1142<col class="parameters_description">
1143<col width="200px" class="parameters_annotations">
1144</colgroup>
1145<tbody>
1146<tr>
1147<td class="parameter_name"><p>encoder</p></td>
1148<td class="parameter_description"><p>a <a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a></p></td>
1149<td class="parameter_annotations"> </td>
1150</tr>
1151<tr>
1152<td class="parameter_name"><p>frame</p></td>
1153<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-GstVideo-Codec-utility-function.html#GstVideoCodecFrame" title="struct GstVideoCodecFrame"><span class="type">GstVideoCodecFrame</span></a></p></td>
1154<td class="parameter_annotations"> </td>
1155</tr>
1156</tbody>
1157</table></div>
1158</div>
1159<div class="refsect3">
1160<a name="gst-video-encoder-get-max-encode-time.returns"></a><h4>Returns</h4>
1161<p> max decoding time.</p>
1162</div>
1163<p class="since">Since: <a class="link" href="ix04.html#api-index-1.14">1.14</a></p>
1164</div>
1165<hr>
1166<div class="refsect2">
1167<a name="gst-video-encoder-is-qos-enabled"></a><h3>gst_video_encoder_is_qos_enabled ()</h3>
1168<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
1169gst_video_encoder_is_qos_enabled (<em class="parameter"><code><a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a> *encoder</code></em>);</pre>
1170<p>Checks if <em class="parameter"><code>encoder</code></em>
1171 is currently configured to handle Quality-of-Service
1172events from downstream.</p>
1173<div class="refsect3">
1174<a name="gst-video-encoder-is-qos-enabled.parameters"></a><h4>Parameters</h4>
1175<div class="informaltable"><table class="informaltable" width="100%" border="0">
1176<colgroup>
1177<col width="150px" class="parameters_name">
1178<col class="parameters_description">
1179<col width="200px" class="parameters_annotations">
1180</colgroup>
1181<tbody><tr>
1182<td class="parameter_name"><p>encoder</p></td>
1183<td class="parameter_description"><p>the encoder</p></td>
1184<td class="parameter_annotations"> </td>
1185</tr></tbody>
1186</table></div>
1187</div>
1188<div class="refsect3">
1189<a name="gst-video-encoder-is-qos-enabled.returns"></a><h4>Returns</h4>
1190<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the encoder is configured to perform Quality-of-Service.</p>
1191</div>
1192<p class="since">Since: <a class="link" href="ix04.html#api-index-1.14">1.14</a></p>
1193</div>
1194<hr>
1195<div class="refsect2">
1196<a name="gst-video-encoder-set-qos-enabled"></a><h3>gst_video_encoder_set_qos_enabled ()</h3>
1197<pre class="programlisting"><span class="returnvalue">void</span>
1198gst_video_encoder_set_qos_enabled (<em class="parameter"><code><a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a> *encoder</code></em>,
1199                                   <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> enabled</code></em>);</pre>
1200<p>Configures <em class="parameter"><code>encoder</code></em>
1201 to handle Quality-of-Service events from downstream.</p>
1202<div class="refsect3">
1203<a name="gst-video-encoder-set-qos-enabled.parameters"></a><h4>Parameters</h4>
1204<div class="informaltable"><table class="informaltable" width="100%" border="0">
1205<colgroup>
1206<col width="150px" class="parameters_name">
1207<col class="parameters_description">
1208<col width="200px" class="parameters_annotations">
1209</colgroup>
1210<tbody>
1211<tr>
1212<td class="parameter_name"><p>encoder</p></td>
1213<td class="parameter_description"><p>the encoder</p></td>
1214<td class="parameter_annotations"> </td>
1215</tr>
1216<tr>
1217<td class="parameter_name"><p>enabled</p></td>
1218<td class="parameter_description"><p>the new qos value.</p></td>
1219<td class="parameter_annotations"> </td>
1220</tr>
1221</tbody>
1222</table></div>
1223</div>
1224<p class="since">Since: <a class="link" href="ix04.html#api-index-1.14">1.14</a></p>
1225</div>
1226</div>
1227<div class="refsect1">
1228<a name="GstVideoEncoder.other_details"></a><h2>Types and Values</h2>
1229<div class="refsect2">
1230<a name="GST-VIDEO-ENCODER-FLOW-DROPPED:CAPS"></a><h3>GST_VIDEO_ENCODER_FLOW_DROPPED</h3>
1231<pre class="programlisting">#define GST_VIDEO_ENCODER_FLOW_DROPPED GST_FLOW_CUSTOM_SUCCESS_1
1232</pre>
1233<div class="warning">
1234<p><code class="literal">GST_VIDEO_ENCODER_FLOW_DROPPED</code> is deprecated and should not be used in newly-written code.</p>
1235<p>since 1.8. use gst_video_encoder_finish_frame with
1236a <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> frame-&gt;output_buffer to drop the frame instead.</p>
1237</div>
1238<p>Returned when the event/buffer should be dropped.</p>
1239</div>
1240<hr>
1241<div class="refsect2">
1242<a name="GST-VIDEO-ENCODER-FLOW-NEED-DATA:CAPS"></a><h3>GST_VIDEO_ENCODER_FLOW_NEED_DATA</h3>
1243<pre class="programlisting">#define GST_VIDEO_ENCODER_FLOW_NEED_DATA GST_FLOW_CUSTOM_SUCCESS
1244</pre>
1245<p>Returned while parsing to indicate more data is needed.</p>
1246</div>
1247<hr>
1248<div class="refsect2">
1249<a name="GST-VIDEO-ENCODER-SINK-NAME:CAPS"></a><h3>GST_VIDEO_ENCODER_SINK_NAME</h3>
1250<pre class="programlisting">#define GST_VIDEO_ENCODER_SINK_NAME    "sink"
1251</pre>
1252<p>The name of the templates for the sink pad.</p>
1253</div>
1254<hr>
1255<div class="refsect2">
1256<a name="GST-VIDEO-ENCODER-SRC-NAME:CAPS"></a><h3>GST_VIDEO_ENCODER_SRC_NAME</h3>
1257<pre class="programlisting">#define GST_VIDEO_ENCODER_SRC_NAME     "src"
1258</pre>
1259<p>The name of the templates for the source pad.</p>
1260</div>
1261<hr>
1262<div class="refsect2">
1263<a name="GstVideoEncoder-struct"></a><h3>struct GstVideoEncoder</h3>
1264<pre class="programlisting">struct GstVideoEncoder;</pre>
1265<p>The opaque <a class="link" href="GstVideoEncoder.html" title="GstVideoEncoder"><span class="type">GstVideoEncoder</span></a> data structure.</p>
1266</div>
1267<hr>
1268<div class="refsect2">
1269<a name="GstVideoEncoderClass"></a><h3>struct GstVideoEncoderClass</h3>
1270<pre class="programlisting">struct GstVideoEncoderClass {
1271  /* virtual methods for subclasses */
1272  gboolean      (*open)         (GstVideoEncoder *encoder);
1273
1274  gboolean      (*close)        (GstVideoEncoder *encoder);
1275
1276  gboolean      (*start)        (GstVideoEncoder *encoder);
1277
1278  gboolean      (*stop)         (GstVideoEncoder *encoder);
1279
1280  gboolean      (*set_format)   (GstVideoEncoder *encoder,
1281				 GstVideoCodecState *state);
1282
1283  GstFlowReturn (*handle_frame) (GstVideoEncoder *encoder,
1284				 GstVideoCodecFrame *frame);
1285
1286  gboolean      (*reset)        (GstVideoEncoder *encoder,
1287				 gboolean hard);
1288
1289  GstFlowReturn (*finish)       (GstVideoEncoder *encoder);
1290
1291  GstFlowReturn (*pre_push)     (GstVideoEncoder *encoder,
1292				 GstVideoCodecFrame *frame);
1293
1294  GstCaps *     (*getcaps)      (GstVideoEncoder *enc,
1295                                 GstCaps *filter);
1296
1297  gboolean      (*sink_event)   (GstVideoEncoder *encoder,
1298				 GstEvent *event);
1299
1300  gboolean      (*src_event)    (GstVideoEncoder *encoder,
1301				 GstEvent *event);
1302
1303  gboolean      (*negotiate)    (GstVideoEncoder *encoder);
1304
1305  gboolean      (*decide_allocation)  (GstVideoEncoder *encoder, GstQuery *query);
1306
1307  gboolean      (*propose_allocation) (GstVideoEncoder * encoder,
1308                                       GstQuery * query);
1309  gboolean      (*flush)              (GstVideoEncoder *encoder);
1310
1311  gboolean      (*sink_query)     (GstVideoEncoder *encoder,
1312				   GstQuery *query);
1313
1314  gboolean      (*src_query)      (GstVideoEncoder *encoder,
1315				   GstQuery *query);
1316
1317  gboolean      (*transform_meta) (GstVideoEncoder *encoder,
1318                                   GstVideoCodecFrame *frame,
1319                                   GstMeta * meta);
1320};
1321</pre>
1322<p>Subclasses can override any of the available virtual methods or not, as
1323needed. At minimum <em class="parameter"><code>handle_frame</code></em>
1324 needs to be overridden, and <em class="parameter"><code>set_format</code></em>
1325
1326and <em class="parameter"><code>get_caps</code></em>
1327 are likely needed as well.</p>
1328<div class="refsect3">
1329<a name="GstVideoEncoderClass.members"></a><h4>Members</h4>
1330<div class="informaltable"><table class="informaltable" width="100%" border="0">
1331<colgroup>
1332<col width="300px" class="struct_members_name">
1333<col class="struct_members_description">
1334<col width="200px" class="struct_members_annotations">
1335</colgroup>
1336<tbody>
1337<tr>
1338<td class="struct_member_name"><p><em class="structfield"><code><a name="GstVideoEncoderClass.open"></a>open</code></em> ()</p></td>
1339<td class="struct_member_description"><p>Optional.
1340Called when the element changes to GST_STATE_READY.
1341Allows opening external resources.</p></td>
1342<td class="struct_member_annotations"> </td>
1343</tr>
1344<tr>
1345<td class="struct_member_name"><p><em class="structfield"><code><a name="GstVideoEncoderClass.close"></a>close</code></em> ()</p></td>
1346<td class="struct_member_description"><p>Optional.
1347Called when the element changes to GST_STATE_NULL.
1348Allows closing external resources.</p></td>
1349<td class="struct_member_annotations"> </td>
1350</tr>
1351<tr>
1352<td class="struct_member_name"><p><em class="structfield"><code><a name="GstVideoEncoderClass.start"></a>start</code></em> ()</p></td>
1353<td class="struct_member_description"><p>Optional.
1354Called when the element starts processing.
1355Allows opening external resources.</p></td>
1356<td class="struct_member_annotations"> </td>
1357</tr>
1358<tr>
1359<td class="struct_member_name"><p><em class="structfield"><code><a name="GstVideoEncoderClass.stop"></a>stop</code></em> ()</p></td>
1360<td class="struct_member_description"><p>Optional.
1361Called when the element stops processing.
1362Allows closing external resources.</p></td>
1363<td class="struct_member_annotations"> </td>
1364</tr>
1365<tr>
1366<td class="struct_member_name"><p><em class="structfield"><code><a name="GstVideoEncoderClass.set-format"></a>set_format</code></em> ()</p></td>
1367<td class="struct_member_description"><p>Optional.
1368Notifies subclass of incoming data format.
1369GstVideoCodecState fields have already been
1370set according to provided caps.</p></td>
1371<td class="struct_member_annotations"> </td>
1372</tr>
1373<tr>
1374<td class="struct_member_name"><p><em class="structfield"><code><a name="GstVideoEncoderClass.handle-frame"></a>handle_frame</code></em> ()</p></td>
1375<td class="struct_member_description"><p>Provides input frame to subclass.</p></td>
1376<td class="struct_member_annotations"> </td>
1377</tr>
1378<tr>
1379<td class="struct_member_name"><p><em class="structfield"><code><a name="GstVideoEncoderClass.reset"></a>reset</code></em> ()</p></td>
1380<td class="struct_member_description"><p>Optional.
1381Allows subclass (encoder) to perform post-seek semantics reset.
1382Deprecated.</p></td>
1383<td class="struct_member_annotations"> </td>
1384</tr>
1385<tr>
1386<td class="struct_member_name"><p><em class="structfield"><code><a name="GstVideoEncoderClass.finish"></a>finish</code></em> ()</p></td>
1387<td class="struct_member_description"><p>Optional.
1388Called to request subclass to dispatch any pending remaining
1389data (e.g. at EOS).</p></td>
1390<td class="struct_member_annotations"> </td>
1391</tr>
1392<tr>
1393<td class="struct_member_name"><p><em class="structfield"><code><a name="GstVideoEncoderClass.pre-push"></a>pre_push</code></em> ()</p></td>
1394<td class="struct_member_description"><p>Optional.
1395Allows subclass to push frame downstream in whatever
1396shape or form it deems appropriate.  If not provided,
1397provided encoded frame data is simply pushed downstream.</p></td>
1398<td class="struct_member_annotations"> </td>
1399</tr>
1400<tr>
1401<td class="struct_member_name"><p><em class="structfield"><code><a name="GstVideoEncoderClass.getcaps"></a>getcaps</code></em> ()</p></td>
1402<td class="struct_member_description"><p>Optional.
1403Allows for a custom sink getcaps implementation (e.g.
1404for multichannel input specification).  If not implemented,
1405default returns gst_video_encoder_proxy_getcaps
1406applied to sink template caps.</p></td>
1407<td class="struct_member_annotations"> </td>
1408</tr>
1409<tr>
1410<td class="struct_member_name"><p><em class="structfield"><code><a name="GstVideoEncoderClass.sink-event"></a>sink_event</code></em> ()</p></td>
1411<td class="struct_member_description"><p>Optional.
1412Event handler on the sink pad. This function should return
1413TRUE if the event was handled and should be discarded
1414(i.e. not unref'ed).
1415Subclasses should chain up to the parent implementation to
1416invoke the default handler.</p></td>
1417<td class="struct_member_annotations"> </td>
1418</tr>
1419<tr>
1420<td class="struct_member_name"><p><em class="structfield"><code><a name="GstVideoEncoderClass.src-event"></a>src_event</code></em> ()</p></td>
1421<td class="struct_member_description"><p>Optional.
1422Event handler on the source pad. This function should return
1423TRUE if the event was handled and should be discarded
1424(i.e. not unref'ed).
1425Subclasses should chain up to the parent implementation to
1426invoke the default handler.</p></td>
1427<td class="struct_member_annotations"> </td>
1428</tr>
1429<tr>
1430<td class="struct_member_name"><p><em class="structfield"><code><a name="GstVideoEncoderClass.negotiate"></a>negotiate</code></em> ()</p></td>
1431<td class="struct_member_description"><p>Optional.
1432Negotiate with downstream and configure buffer pools, etc.
1433Subclasses should chain up to the parent implementation to
1434invoke the default handler.</p></td>
1435<td class="struct_member_annotations"> </td>
1436</tr>
1437<tr>
1438<td class="struct_member_name"><p><em class="structfield"><code><a name="GstVideoEncoderClass.decide-allocation"></a>decide_allocation</code></em> ()</p></td>
1439<td class="struct_member_description"><p>Optional.
1440Setup the allocation parameters for allocating output
1441buffers. The passed in query contains the result of the
1442downstream allocation query.
1443Subclasses should chain up to the parent implementation to
1444invoke the default handler.</p></td>
1445<td class="struct_member_annotations"> </td>
1446</tr>
1447<tr>
1448<td class="struct_member_name"><p><em class="structfield"><code><a name="GstVideoEncoderClass.propose-allocation"></a>propose_allocation</code></em> ()</p></td>
1449<td class="struct_member_description"><p>Optional.
1450Propose buffer allocation parameters for upstream elements.
1451Subclasses should chain up to the parent implementation to
1452invoke the default handler.</p></td>
1453<td class="struct_member_annotations"> </td>
1454</tr>
1455<tr>
1456<td class="struct_member_name"><p><em class="structfield"><code><a name="GstVideoEncoderClass.flush"></a>flush</code></em> ()</p></td>
1457<td class="struct_member_description"><p>Optional.
1458Flush all remaining data from the encoder without
1459pushing it downstream. Since: 1.2</p></td>
1460<td class="struct_member_annotations"> </td>
1461</tr>
1462<tr>
1463<td class="struct_member_name"><p><em class="structfield"><code><a name="GstVideoEncoderClass.sink-query"></a>sink_query</code></em> ()</p></td>
1464<td class="struct_member_description"><p>Optional.
1465Query handler on the sink pad. This function should
1466return TRUE if the query could be performed. Subclasses
1467should chain up to the parent implementation to invoke the
1468default handler. Since: 1.4</p></td>
1469<td class="struct_member_annotations"> </td>
1470</tr>
1471<tr>
1472<td class="struct_member_name"><p><em class="structfield"><code><a name="GstVideoEncoderClass.src-query"></a>src_query</code></em> ()</p></td>
1473<td class="struct_member_description"><p>Optional.
1474Query handler on the source pad. This function should
1475return TRUE if the query could be performed. Subclasses
1476should chain up to the parent implementation to invoke the
1477default handler. Since: 1.4</p></td>
1478<td class="struct_member_annotations"> </td>
1479</tr>
1480<tr>
1481<td class="struct_member_name"><p><em class="structfield"><code><a name="GstVideoEncoderClass.transform-meta"></a>transform_meta</code></em> ()</p></td>
1482<td class="struct_member_description"><p>Optional. Transform the metadata on the input buffer to the
1483output buffer. By default this method is copies all meta without
1484tags and meta with only the "video" tag. subclasses can
1485implement this method and return <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the metadata is to be
1486copied. Since: 1.6</p></td>
1487<td class="struct_member_annotations"> </td>
1488</tr>
1489</tbody>
1490</table></div>
1491</div>
1492</div>
1493</div>
1494<div class="refsect1">
1495<a name="GstVideoEncoder.property-details"></a><h2>Property Details</h2>
1496<div class="refsect2">
1497<a name="GstVideoEncoder--qos"></a><h3>The <code class="literal">“qos”</code> property</h3>
1498<pre class="programlisting">  “qos”                      <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre>
1499<p>Handle Quality-of-Service events from downstream.</p>
1500<p>Flags: Read / Write</p>
1501<p>Default value: FALSE</p>
1502</div>
1503</div>
1504</div>
1505<div class="footer">
1506<hr>Generated by GTK-Doc V1.28</div>
1507</body>
1508</html>