Tizen 2.0 Release
[framework/multimedia/gst-plugins-bad0.10.git] / docs / libs / html / gst-plugins-bad-libs-GstBaseVideoDecoder.html
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>GstBaseVideoDecoder</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GStreamer Bad Plugins 0.10 Library Reference Manual">
8 <link rel="up" href="video.html" title="Base video element classes">
9 <link rel="prev" href="gst-plugins-bad-libs-GstBaseVideoCodec.html" title="GstBaseVideoCodec">
10 <link rel="next" href="gst-plugins-bad-libs-GstBaseVideoEncoder.html" title="GstBaseVideoEncoder">
11 <meta name="generator" content="GTK-Doc V1.18 (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="2">
16 <tr valign="middle">
17 <td><a accesskey="p" href="gst-plugins-bad-libs-GstBaseVideoCodec.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="video.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">GStreamer Bad Plugins 0.10 Library Reference Manual</th>
21 <td><a accesskey="n" href="gst-plugins-bad-libs-GstBaseVideoEncoder.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
22 </tr>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#gst-plugins-bad-libs-GstBaseVideoDecoder.synopsis" class="shortcut">Top</a>
25                    | 
26                   <a href="#gst-plugins-bad-libs-GstBaseVideoDecoder.description" class="shortcut">Description</a>
27 </td></tr>
28 </table>
29 <div class="refentry">
30 <a name="gst-plugins-bad-libs-GstBaseVideoDecoder"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
32 <td valign="top">
33 <h2><span class="refentrytitle"><a name="gst-plugins-bad-libs-GstBaseVideoDecoder.top_of_page"></a>GstBaseVideoDecoder</span></h2>
34 <p>GstBaseVideoDecoder — Base class for video decoders</p>
35 </td>
36 <td valign="top" align="right"></td>
37 </tr></table></div>
38 <div class="refsynopsisdiv">
39 <a name="gst-plugins-bad-libs-GstBaseVideoDecoder.synopsis"></a><h2>Synopsis</h2>
40 <pre class="synopsis">#define             <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GST-BASE-VIDEO-DECODER-SINK-NAME:CAPS" title="GST_BASE_VIDEO_DECODER_SINK_NAME">GST_BASE_VIDEO_DECODER_SINK_NAME</a>
41 #define             <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GST-BASE-VIDEO-DECODER-SRC-NAME:CAPS" title="GST_BASE_VIDEO_DECODER_SRC_NAME">GST_BASE_VIDEO_DECODER_SRC_NAME</a>
42 #define             <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GST-BASE-VIDEO-DECODER-FLOW-NEED-DATA:CAPS" title="GST_BASE_VIDEO_DECODER_FLOW_NEED_DATA">GST_BASE_VIDEO_DECODER_FLOW_NEED_DATA</a>
43 #define             <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GST-BASE-VIDEO-DECODER-FLOW-DROPPED:CAPS" title="GST_BASE_VIDEO_DECODER_FLOW_DROPPED">GST_BASE_VIDEO_DECODER_FLOW_DROPPED</a>
44 #define             <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GST-BASE-AUDIO-DECODER-ERROR:CAPS" title="GST_BASE_AUDIO_DECODER_ERROR()">GST_BASE_AUDIO_DECODER_ERROR</a>        (el,
45                                                          w,
46                                                          domain,
47                                                          code,
48                                                          text,
49                                                          debug,
50                                                          ret)
51 struct              <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder">GstBaseVideoDecoder</a>;
52 struct              <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoderClass" title="struct GstBaseVideoDecoderClass">GstBaseVideoDecoderClass</a>;
53 <span class="returnvalue">void</span>                <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#gst-base-video-decoder-class-set-capture-pattern" title="gst_base_video_decoder_class_set_capture_pattern ()">gst_base_video_decoder_class_set_capture_pattern</a>
54                                                         (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoderClass" title="struct GstBaseVideoDecoderClass"><span class="type">GstBaseVideoDecoderClass</span></a> *klass</code></em>,
55                                                          <em class="parameter"><code><span class="type">guint32</span> mask</code></em>,
56                                                          <em class="parameter"><code><span class="type">guint32</span> pattern</code></em>);
57 <a class="link" href="gst-plugins-bad-libs-GstBaseVideoCodec.html#GstVideoFrame" title="struct GstVideoFrame"><span class="returnvalue">GstVideoFrame</span></a> *     <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#gst-base-video-decoder-get-frame" title="gst_base_video_decoder_get_frame ()">gst_base_video_decoder_get_frame</a>    (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *coder</code></em>,
58                                                          <em class="parameter"><code><span class="type">int</span> frame_number</code></em>);
59 <a class="link" href="gst-plugins-bad-libs-GstBaseVideoCodec.html#GstVideoFrame" title="struct GstVideoFrame"><span class="returnvalue">GstVideoFrame</span></a> *     <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#gst-base-video-decoder-get-oldest-frame" title="gst_base_video_decoder_get_oldest_frame ()">gst_base_video_decoder_get_oldest_frame</a>
60                                                         (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *coder</code></em>);
61 <span class="returnvalue">void</span>                <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#gst-base-video-decoder-add-to-frame" title="gst_base_video_decoder_add_to_frame ()">gst_base_video_decoder_add_to_frame</a> (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *base_video_decoder</code></em>,
62                                                          <em class="parameter"><code><span class="type">int</span> n_bytes</code></em>);
63 <span class="returnvalue">void</span>                <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#gst-base-video-decoder-lost-sync" title="gst_base_video_decoder_lost_sync ()">gst_base_video_decoder_lost_sync</a>    (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *base_video_decoder</code></em>);
64 <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>       <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#gst-base-video-decoder-have-frame" title="gst_base_video_decoder_have_frame ()">gst_base_video_decoder_have_frame</a>   (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *base_video_decoder</code></em>);
65 <span class="returnvalue">void</span>                <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#gst-base-video-decoder-set-sync-point" title="gst_base_video_decoder_set_sync_point ()">gst_base_video_decoder_set_sync_point</a>
66                                                         (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *base_video_decoder</code></em>);
67 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#gst-base-video-decoder-set-src-caps" title="gst_base_video_decoder_set_src_caps ()">gst_base_video_decoder_set_src_caps</a> (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *base_video_decoder</code></em>);
68 <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstBuffer.html#GstBuffer"><span class="returnvalue">GstBuffer</span></a> *         <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#gst-base-video-decoder-alloc-src-buffer" title="gst_base_video_decoder_alloc_src_buffer ()">gst_base_video_decoder_alloc_src_buffer</a>
69                                                         (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *base_video_decoder</code></em>);
70 <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>       <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#gst-base-video-decoder-alloc-src-frame" title="gst_base_video_decoder_alloc_src_frame ()">gst_base_video_decoder_alloc_src_frame</a>
71                                                         (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *base_video_decoder</code></em>,
72                                                          <em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoCodec.html#GstVideoFrame" title="struct GstVideoFrame"><span class="type">GstVideoFrame</span></a> *frame</code></em>);
73 <a class="link" href="gst-plugins-bad-libs-GstBaseVideoCodec.html#GstVideoState" title="struct GstVideoState"><span class="returnvalue">GstVideoState</span></a> *     <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#gst-base-video-decoder-get-state" title="gst_base_video_decoder_get_state ()">gst_base_video_decoder_get_state</a>    (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *base_video_decoder</code></em>);
74 <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html#GstClockTimeDiff"><span class="returnvalue">GstClockTimeDiff</span></a>    <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#gst-base-video-decoder-get-max-decode-time" title="gst_base_video_decoder_get_max_decode_time ()">gst_base_video_decoder_get_max_decode_time</a>
75                                                         (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *base_video_decoder</code></em>,
76                                                          <em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoCodec.html#GstVideoFrame" title="struct GstVideoFrame"><span class="type">GstVideoFrame</span></a> *frame</code></em>);
77 <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>       <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#gst-base-video-decoder-finish-frame" title="gst_base_video_decoder_finish_frame ()">gst_base_video_decoder_finish_frame</a> (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *base_video_decoder</code></em>,
78                                                          <em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoCodec.html#GstVideoFrame" title="struct GstVideoFrame"><span class="type">GstVideoFrame</span></a> *frame</code></em>);
79 </pre>
80 </div>
81 <div class="refsect1">
82 <a name="gst-plugins-bad-libs-GstBaseVideoDecoder.description"></a><h2>Description</h2>
83 <p>
84 This base class is for video decoders turning encoded data into raw video
85 frames.
86 </p>
87 <p>
88 GstBaseVideoDecoder and subclass should cooperate as follows.
89 </p>
90 <div class="orderedlist"><ol class="orderedlist" type="1">
91 <li class="listitem"><div class="itemizedlist">
92 <p class="title"><b>Configuration</b></p>
93 <ul class="itemizedlist" type="disc">
94 <li class="listitem"><p>
95     Initially, GstBaseVideoDecoder calls <em class="parameter"><code>start</code></em> when the decoder element
96     is activated, which allows subclass to perform any global setup.
97   </p></li>
98 <li class="listitem"><p>
99     GstBaseVideoDecoder calls <em class="parameter"><code>set_format</code></em> to inform subclass of caps
100     describing input video data that it is about to receive, including
101     possibly configuration data.
102     While unlikely, it might be called more than once, if changing input
103     parameters require reconfiguration.
104   </p></li>
105 <li class="listitem"><p>
106     GstBaseVideoDecoder calls <em class="parameter"><code>stop</code></em> at end of all processing.
107   </p></li>
108 </ul>
109 </div></li>
110 <li class="listitem"><div class="itemizedlist">
111 <p class="title"><b>Data processing</b></p>
112 <ul class="itemizedlist" type="disc">
113 <li class="listitem"><p>
114       Base class gathers input data, and optionally allows subclass
115       to parse this into subsequently manageable chunks, typically
116       corresponding to and referred to as 'frames'.
117     </p></li>
118 <li class="listitem"><p>
119       Input frame is provided to subclass' <em class="parameter"><code>handle_frame</code></em>.
120     </p></li>
121 <li class="listitem"><p>
122       If codec processing results in decoded data, subclass should call
123       <em class="parameter"><code>gst_base_video_decoder_finish_frame</code></em> to have decoded data pushed
124       downstream.
125     </p></li>
126 </ul>
127 </div></li>
128 <li class="listitem"><div class="itemizedlist">
129 <p class="title"><b>Shutdown phase</b></p>
130 <ul class="itemizedlist" type="disc"><li class="listitem"><p>
131     GstBaseVideoDecoder class calls <em class="parameter"><code>stop</code></em> to inform the subclass that data
132     parsing will be stopped.
133   </p></li></ul>
134 </div></li>
135 </ol></div>
136 <p>
137 </p>
138 <p>
139 Subclass is responsible for providing pad template caps for
140 source and sink pads. The pads need to be named "sink" and "src". It also
141 needs to set the fixed caps on srcpad, when the format is ensured.  This
142 is typically when base class calls subclass' <em class="parameter"><code>set_format</code></em> function, though
143 it might be delayed until calling <em class="parameter"><code>gst_base_video_decoder_finish_frame</code></em>.
144 </p>
145 <p>
146 Subclass is also responsible for providing (presentation) timestamps
147 (likely based on corresponding input ones).  If that is not applicable
148 or possible, baseclass provides limited framerate based interpolation.
149 </p>
150 <p>
151 Similarly, the baseclass provides some limited (legacy) seeking support
152 (upon explicit subclass request), as full-fledged support
153 should rather be left to upstream demuxer, parser or alike.  This simple
154 approach caters for seeking and duration reporting using estimated input
155 bitrates.
156 </p>
157 <p>
158 Baseclass provides some support for reverse playback, in particular
159 in case incoming data is not packetized or upstream does not provide
160 fragments on keyframe boundaries.  However, subclass should then be prepared
161 for the parsing and frame processing stage to occur separately (rather
162 than otherwise the latter immediately following the former),
163 and should ensure the parsing stage properly marks keyframes or rely on
164 upstream to do so properly for incoming data.
165 </p>
166 <p>
167 Things that subclass need to take care of:
168 </p>
169 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
170 <li class="listitem"><p>Provide pad templates</p></li>
171 <li class="listitem"><p>
172      Set source pad caps when appropriate
173   </p></li>
174 <li class="listitem"><p>
175      Configure some baseclass behaviour parameters.
176   </p></li>
177 <li class="listitem"><p>
178      Optionally parse input data, if it is not considered packetized.
179      Parse sync is obtained either by providing baseclass with a
180      mask and pattern or a custom <em class="parameter"><code>scan_for_sync</code></em>.  When sync is established,
181      <em class="parameter"><code>parse_data</code></em> should invoke <em class="parameter"><code>gst_base_video_decoder_add_to_frame</code></em> and
182      <em class="parameter"><code>gst_base_video_decoder_have_frame</code></em> as appropriate.
183   </p></li>
184 <li class="listitem"><p>
185      Accept data in <em class="parameter"><code>handle_frame</code></em> and provide decoded results to
186      <em class="parameter"><code>gst_base_video_decoder_finish_frame</code></em>.
187   </p></li>
188 </ul></div>
189 <p>
190 </p>
191 </div>
192 <div class="refsect1">
193 <a name="gst-plugins-bad-libs-GstBaseVideoDecoder.details"></a><h2>Details</h2>
194 <div class="refsect2">
195 <a name="GST-BASE-VIDEO-DECODER-SINK-NAME:CAPS"></a><h3>GST_BASE_VIDEO_DECODER_SINK_NAME</h3>
196 <pre class="programlisting">#define GST_BASE_VIDEO_DECODER_SINK_NAME    "sink"
197 </pre>
198 <p>
199 The name of the templates for the sink pad.
200 </p>
201 </div>
202 <hr>
203 <div class="refsect2">
204 <a name="GST-BASE-VIDEO-DECODER-SRC-NAME:CAPS"></a><h3>GST_BASE_VIDEO_DECODER_SRC_NAME</h3>
205 <pre class="programlisting">#define GST_BASE_VIDEO_DECODER_SRC_NAME     "src"
206 </pre>
207 <p>
208 The name of the templates for the source pad.
209 </p>
210 </div>
211 <hr>
212 <div class="refsect2">
213 <a name="GST-BASE-VIDEO-DECODER-FLOW-NEED-DATA:CAPS"></a><h3>GST_BASE_VIDEO_DECODER_FLOW_NEED_DATA</h3>
214 <pre class="programlisting">#define GST_BASE_VIDEO_DECODER_FLOW_NEED_DATA GST_FLOW_CUSTOM_SUCCESS
215 </pre>
216 <p>
217 Returned while parsing to indicate more data is needed.
218 </p>
219 </div>
220 <hr>
221 <div class="refsect2">
222 <a name="GST-BASE-VIDEO-DECODER-FLOW-DROPPED:CAPS"></a><h3>GST_BASE_VIDEO_DECODER_FLOW_DROPPED</h3>
223 <pre class="programlisting">#define GST_BASE_VIDEO_DECODER_FLOW_DROPPED GST_FLOW_CUSTOM_SUCCESS_1
224 </pre>
225 <p>
226 Returned when the event/buffer should be dropped.
227 </p>
228 </div>
229 <hr>
230 <div class="refsect2">
231 <a name="GST-BASE-AUDIO-DECODER-ERROR:CAPS"></a><h3>GST_BASE_AUDIO_DECODER_ERROR()</h3>
232 <pre class="programlisting">#define             GST_BASE_AUDIO_DECODER_ERROR(el, w, domain, code, text, debug, ret)</pre>
233 </div>
234 <hr>
235 <div class="refsect2">
236 <a name="GstBaseVideoDecoder"></a><h3>struct GstBaseVideoDecoder</h3>
237 <pre class="programlisting">struct GstBaseVideoDecoder {
238   GstBaseVideoCodec base_video_codec;
239 };
240 </pre>
241 <p>
242 The opaque <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> data structure.
243 </p>
244 </div>
245 <hr>
246 <div class="refsect2">
247 <a name="GstBaseVideoDecoderClass"></a><h3>struct GstBaseVideoDecoderClass</h3>
248 <pre class="programlisting">struct GstBaseVideoDecoderClass {
249   GstBaseVideoCodecClass base_video_codec_class;
250
251   gboolean      (*start)          (GstBaseVideoDecoder *coder);
252
253   gboolean      (*stop)           (GstBaseVideoDecoder *coder);
254
255   int           (*scan_for_sync)  (GstBaseVideoDecoder *decoder, gboolean at_eos,
256                                    int offset, int n);
257
258   GstFlowReturn (*parse_data)     (GstBaseVideoDecoder *decoder, gboolean at_eos);
259
260   gboolean      (*set_format)     (GstBaseVideoDecoder *coder, GstVideoState * state);
261
262   gboolean      (*reset)          (GstBaseVideoDecoder *coder);
263
264   GstFlowReturn (*finish)         (GstBaseVideoDecoder *coder);
265
266   GstFlowReturn (*handle_frame)   (GstBaseVideoDecoder *coder, GstVideoFrame *frame);
267 };
268 </pre>
269 <p>
270 Subclasses can override any of the available virtual methods or not, as
271 needed. At minimum <em class="parameter"><code>handle_frame</code></em> needs to be overridden, and <em class="parameter"><code>set_format</code></em>
272 and likely as well.  If non-packetized input is supported or expected,
273 <em class="parameter"><code>parse</code></em> needs to be overridden as well.
274 </p>
275 <div class="variablelist"><table border="0">
276 <col align="left" valign="top">
277 <tbody>
278 <tr>
279 <td><p><span class="term"><a class="link" href="gst-plugins-bad-libs-GstBaseVideoCodec.html#GstBaseVideoCodecClass" title="struct GstBaseVideoCodecClass"><span class="type">GstBaseVideoCodecClass</span></a> <em class="structfield"><code><a name="GstBaseVideoDecoderClass.base-video-codec-class"></a>base_video_codec_class</code></em>;</span></p></td>
280 <td></td>
281 </tr>
282 <tr>
283 <td><p><span class="term"><em class="structfield"><code><a name="GstBaseVideoDecoderClass.start"></a>start</code></em> ()</span></p></td>
284 <td>Optional.
285 Called when the element starts processing.
286 Allows opening external resources.</td>
287 </tr>
288 <tr>
289 <td><p><span class="term"><em class="structfield"><code><a name="GstBaseVideoDecoderClass.stop"></a>stop</code></em> ()</span></p></td>
290 <td>Optional.
291 Called when the element stops processing.
292 Allows closing external resources.</td>
293 </tr>
294 <tr>
295 <td><p><span class="term"><em class="structfield"><code><a name="GstBaseVideoDecoderClass.scan-for-sync"></a>scan_for_sync</code></em> ()</span></p></td>
296 <td>Optional.
297 Allows subclass to obtain sync for subsequent parsing
298 by custom means (above an beyond scanning for specific
299 marker and mask).</td>
300 </tr>
301 <tr>
302 <td><p><span class="term"><em class="structfield"><code><a name="GstBaseVideoDecoderClass.parse-data"></a>parse_data</code></em> ()</span></p></td>
303 <td>Required for non-packetized input.
304 Allows chopping incoming data into manageable units (frames)
305 for subsequent decoding.</td>
306 </tr>
307 <tr>
308 <td><p><span class="term"><em class="structfield"><code><a name="GstBaseVideoDecoderClass.set-format"></a>set_format</code></em> ()</span></p></td>
309 <td>Notifies subclass of incoming data format (caps).</td>
310 </tr>
311 <tr>
312 <td><p><span class="term"><em class="structfield"><code><a name="GstBaseVideoDecoderClass.reset"></a>reset</code></em> ()</span></p></td>
313 <td>Optional.
314 Allows subclass (codec) to perform post-seek semantics reset.</td>
315 </tr>
316 <tr>
317 <td><p><span class="term"><em class="structfield"><code><a name="GstBaseVideoDecoderClass.finish"></a>finish</code></em> ()</span></p></td>
318 <td>Optional.
319 Called to request subclass to dispatch any pending remaining
320 data (e.g. at EOS).</td>
321 </tr>
322 <tr>
323 <td><p><span class="term"><em class="structfield"><code><a name="GstBaseVideoDecoderClass.handle-frame"></a>handle_frame</code></em> ()</span></p></td>
324 <td>Provides input data frame to subclass.</td>
325 </tr>
326 </tbody>
327 </table></div>
328 </div>
329 <hr>
330 <div class="refsect2">
331 <a name="gst-base-video-decoder-class-set-capture-pattern"></a><h3>gst_base_video_decoder_class_set_capture_pattern ()</h3>
332 <pre class="programlisting"><span class="returnvalue">void</span>                gst_base_video_decoder_class_set_capture_pattern
333                                                         (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoderClass" title="struct GstBaseVideoDecoderClass"><span class="type">GstBaseVideoDecoderClass</span></a> *klass</code></em>,
334                                                          <em class="parameter"><code><span class="type">guint32</span> mask</code></em>,
335                                                          <em class="parameter"><code><span class="type">guint32</span> pattern</code></em>);</pre>
336 </div>
337 <hr>
338 <div class="refsect2">
339 <a name="gst-base-video-decoder-get-frame"></a><h3>gst_base_video_decoder_get_frame ()</h3>
340 <pre class="programlisting"><a class="link" href="gst-plugins-bad-libs-GstBaseVideoCodec.html#GstVideoFrame" title="struct GstVideoFrame"><span class="returnvalue">GstVideoFrame</span></a> *     gst_base_video_decoder_get_frame    (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *coder</code></em>,
341                                                          <em class="parameter"><code><span class="type">int</span> frame_number</code></em>);</pre>
342 <div class="variablelist"><table border="0">
343 <col align="left" valign="top">
344 <tbody>
345 <tr>
346 <td><p><span class="term"><em class="parameter"><code>base_video_decoder</code></em> :</span></p></td>
347 <td>a <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a>
348 </td>
349 </tr>
350 <tr>
351 <td><p><span class="term"><em class="parameter"><code>frame_number</code></em> :</span></p></td>
352 <td>system_frame_number of a frame</td>
353 </tr>
354 <tr>
355 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
356 <td>pending unfinished <a class="link" href="gst-plugins-bad-libs-GstBaseVideoCodec.html#GstVideoFrame" title="struct GstVideoFrame"><span class="type">GstVideoFrame</span></a> identified by <em class="parameter"><code>frame_number</code></em>.</td>
357 </tr>
358 </tbody>
359 </table></div>
360 </div>
361 <hr>
362 <div class="refsect2">
363 <a name="gst-base-video-decoder-get-oldest-frame"></a><h3>gst_base_video_decoder_get_oldest_frame ()</h3>
364 <pre class="programlisting"><a class="link" href="gst-plugins-bad-libs-GstBaseVideoCodec.html#GstVideoFrame" title="struct GstVideoFrame"><span class="returnvalue">GstVideoFrame</span></a> *     gst_base_video_decoder_get_oldest_frame
365                                                         (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *coder</code></em>);</pre>
366 <p>
367 Sets the mask and pattern that will be scanned for to obtain parse sync.
368 Note that a non-zero <em class="parameter"><code>mask</code></em> implies that <em class="parameter"><code>scan_for_sync</code></em> will be ignored.
369 </p>
370 <div class="variablelist"><table border="0">
371 <col align="left" valign="top">
372 <tbody><tr>
373 <td><p><span class="term"><em class="parameter"><code>base_video_decoder_class</code></em> :</span></p></td>
374 <td>a <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoderClass" title="struct GstBaseVideoDecoderClass"><span class="type">GstBaseVideoDecoderClass</span></a>
375 </td>
376 </tr></tbody>
377 </table></div>
378 </div>
379 <hr>
380 <div class="refsect2">
381 <a name="gst-base-video-decoder-add-to-frame"></a><h3>gst_base_video_decoder_add_to_frame ()</h3>
382 <pre class="programlisting"><span class="returnvalue">void</span>                gst_base_video_decoder_add_to_frame (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *base_video_decoder</code></em>,
383                                                          <em class="parameter"><code><span class="type">int</span> n_bytes</code></em>);</pre>
384 </div>
385 <hr>
386 <div class="refsect2">
387 <a name="gst-base-video-decoder-lost-sync"></a><h3>gst_base_video_decoder_lost_sync ()</h3>
388 <pre class="programlisting"><span class="returnvalue">void</span>                gst_base_video_decoder_lost_sync    (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *base_video_decoder</code></em>);</pre>
389 <p>
390 Advances out-of-sync input data by 1 byte and marks it accordingly.
391 </p>
392 <div class="variablelist"><table border="0">
393 <col align="left" valign="top">
394 <tbody><tr>
395 <td><p><span class="term"><em class="parameter"><code>base_video_decoder</code></em> :</span></p></td>
396 <td>a <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a>
397 </td>
398 </tr></tbody>
399 </table></div>
400 </div>
401 <hr>
402 <div class="refsect2">
403 <a name="gst-base-video-decoder-have-frame"></a><h3>gst_base_video_decoder_have_frame ()</h3>
404 <pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>       gst_base_video_decoder_have_frame   (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *base_video_decoder</code></em>);</pre>
405 <p>
406 Gathers all data collected for currently parsed frame, gathers corresponding
407 metadata and passes it along for further processing, i.e. <em class="parameter"><code>handle_frame</code></em>.
408 </p>
409 <div class="variablelist"><table border="0">
410 <col align="left" valign="top">
411 <tbody>
412 <tr>
413 <td><p><span class="term"><em class="parameter"><code>base_video_decoder</code></em> :</span></p></td>
414 <td>a <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a>
415 </td>
416 </tr>
417 <tr>
418 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
419 <td>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="type">GstFlowReturn</span></a>
420 </td>
421 </tr>
422 </tbody>
423 </table></div>
424 </div>
425 <hr>
426 <div class="refsect2">
427 <a name="gst-base-video-decoder-set-sync-point"></a><h3>gst_base_video_decoder_set_sync_point ()</h3>
428 <pre class="programlisting"><span class="returnvalue">void</span>                gst_base_video_decoder_set_sync_point
429                                                         (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *base_video_decoder</code></em>);</pre>
430 <p>
431 Marks current frame as a sync point, i.e. keyframe.
432 </p>
433 <div class="variablelist"><table border="0">
434 <col align="left" valign="top">
435 <tbody><tr>
436 <td><p><span class="term"><em class="parameter"><code>base_video_decoder</code></em> :</span></p></td>
437 <td>a <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a>
438 </td>
439 </tr></tbody>
440 </table></div>
441 </div>
442 <hr>
443 <div class="refsect2">
444 <a name="gst-base-video-decoder-set-src-caps"></a><h3>gst_base_video_decoder_set_src_caps ()</h3>
445 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gst_base_video_decoder_set_src_caps (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *base_video_decoder</code></em>);</pre>
446 <p>
447 Sets src pad caps according to currently configured <a class="link" href="gst-plugins-bad-libs-GstBaseVideoCodec.html#GstVideoState" title="struct GstVideoState"><span class="type">GstVideoState</span></a>.
448 </p>
449 <div class="variablelist"><table border="0">
450 <col align="left" valign="top">
451 <tbody><tr>
452 <td><p><span class="term"><em class="parameter"><code>base_video_decoder</code></em> :</span></p></td>
453 <td>a <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a>
454 </td>
455 </tr></tbody>
456 </table></div>
457 </div>
458 <hr>
459 <div class="refsect2">
460 <a name="gst-base-video-decoder-alloc-src-buffer"></a><h3>gst_base_video_decoder_alloc_src_buffer ()</h3>
461 <pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstBuffer.html#GstBuffer"><span class="returnvalue">GstBuffer</span></a> *         gst_base_video_decoder_alloc_src_buffer
462                                                         (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *base_video_decoder</code></em>);</pre>
463 <p>
464 Helper function that uses gst_pad_alloc_buffer_and_set_caps
465 to allocate a buffer to hold a video frame for <em class="parameter"><code>base_video_decoder</code></em>'s
466 current <a class="link" href="gst-plugins-bad-libs-GstBaseVideoCodec.html#GstVideoState" title="struct GstVideoState"><span class="type">GstVideoState</span></a>.
467 </p>
468 <div class="variablelist"><table border="0">
469 <col align="left" valign="top">
470 <tbody>
471 <tr>
472 <td><p><span class="term"><em class="parameter"><code>base_video_decoder</code></em> :</span></p></td>
473 <td>a <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a>
474 </td>
475 </tr>
476 <tr>
477 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
478 <td>allocated buffer</td>
479 </tr>
480 </tbody>
481 </table></div>
482 </div>
483 <hr>
484 <div class="refsect2">
485 <a name="gst-base-video-decoder-alloc-src-frame"></a><h3>gst_base_video_decoder_alloc_src_frame ()</h3>
486 <pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>       gst_base_video_decoder_alloc_src_frame
487                                                         (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *base_video_decoder</code></em>,
488                                                          <em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoCodec.html#GstVideoFrame" title="struct GstVideoFrame"><span class="type">GstVideoFrame</span></a> *frame</code></em>);</pre>
489 <p>
490 Helper function that uses gst_pad_alloc_buffer_and_set_caps
491 to allocate a buffer to hold a video frame for <em class="parameter"><code>base_video_decoder</code></em>'s
492 current <a class="link" href="gst-plugins-bad-libs-GstBaseVideoCodec.html#GstVideoState" title="struct GstVideoState"><span class="type">GstVideoState</span></a>.  Subclass should already have configured video state
493 and set src pad caps.
494 </p>
495 <div class="variablelist"><table border="0">
496 <col align="left" valign="top">
497 <tbody>
498 <tr>
499 <td><p><span class="term"><em class="parameter"><code>base_video_decoder</code></em> :</span></p></td>
500 <td>a <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a>
501 </td>
502 </tr>
503 <tr>
504 <td><p><span class="term"><em class="parameter"><code>frame</code></em> :</span></p></td>
505 <td>a <a class="link" href="gst-plugins-bad-libs-GstBaseVideoCodec.html#GstVideoFrame" title="struct GstVideoFrame"><span class="type">GstVideoFrame</span></a>
506 </td>
507 </tr>
508 <tr>
509 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
510 <td>result from pad alloc call</td>
511 </tr>
512 </tbody>
513 </table></div>
514 </div>
515 <hr>
516 <div class="refsect2">
517 <a name="gst-base-video-decoder-get-state"></a><h3>gst_base_video_decoder_get_state ()</h3>
518 <pre class="programlisting"><a class="link" href="gst-plugins-bad-libs-GstBaseVideoCodec.html#GstVideoState" title="struct GstVideoState"><span class="returnvalue">GstVideoState</span></a> *     gst_base_video_decoder_get_state    (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *base_video_decoder</code></em>);</pre>
519 <div class="variablelist"><table border="0">
520 <col align="left" valign="top">
521 <tbody>
522 <tr>
523 <td><p><span class="term"><em class="parameter"><code>base_video_decoder</code></em> :</span></p></td>
524 <td>a <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a>
525 </td>
526 </tr>
527 <tr>
528 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
529 <td>
530 <a class="link" href="gst-plugins-bad-libs-GstBaseVideoCodec.html#GstVideoState" title="struct GstVideoState"><span class="type">GstVideoState</span></a> describing format of video data.</td>
531 </tr>
532 </tbody>
533 </table></div>
534 </div>
535 <hr>
536 <div class="refsect2">
537 <a name="gst-base-video-decoder-get-max-decode-time"></a><h3>gst_base_video_decoder_get_max_decode_time ()</h3>
538 <pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html#GstClockTimeDiff"><span class="returnvalue">GstClockTimeDiff</span></a>    gst_base_video_decoder_get_max_decode_time
539                                                         (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *base_video_decoder</code></em>,
540                                                          <em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoCodec.html#GstVideoFrame" title="struct GstVideoFrame"><span class="type">GstVideoFrame</span></a> *frame</code></em>);</pre>
541 <p>
542 Determines maximum possible decoding time for <em class="parameter"><code>frame</code></em> that will
543 allow it to decode and arrive in time (as determined by QoS events).
544 In particular, a negative result means decoding in time is no longer possible
545 and should therefore occur as soon/skippy as possible.
546 </p>
547 <div class="variablelist"><table border="0">
548 <col align="left" valign="top">
549 <tbody>
550 <tr>
551 <td><p><span class="term"><em class="parameter"><code>base_video_decoder</code></em> :</span></p></td>
552 <td>a <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a>
553 </td>
554 </tr>
555 <tr>
556 <td><p><span class="term"><em class="parameter"><code>frame</code></em> :</span></p></td>
557 <td>a <a class="link" href="gst-plugins-bad-libs-GstBaseVideoCodec.html#GstVideoFrame" title="struct GstVideoFrame"><span class="type">GstVideoFrame</span></a>
558 </td>
559 </tr>
560 <tr>
561 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
562 <td>max decoding time.</td>
563 </tr>
564 </tbody>
565 </table></div>
566 </div>
567 <hr>
568 <div class="refsect2">
569 <a name="gst-base-video-decoder-finish-frame"></a><h3>gst_base_video_decoder_finish_frame ()</h3>
570 <pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>       gst_base_video_decoder_finish_frame (<em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a> *base_video_decoder</code></em>,
571                                                          <em class="parameter"><code><a class="link" href="gst-plugins-bad-libs-GstBaseVideoCodec.html#GstVideoFrame" title="struct GstVideoFrame"><span class="type">GstVideoFrame</span></a> *frame</code></em>);</pre>
572 <p>
573 Removes next <em class="parameter"><code>n_bytes</code></em> of input data and adds it to currently parsed frame.
574 </p>
575 <div class="variablelist"><table border="0">
576 <col align="left" valign="top">
577 <tbody>
578 <tr>
579 <td><p><span class="term"><em class="parameter"><code>base_video_decoder</code></em> :</span></p></td>
580 <td>a <a class="link" href="gst-plugins-bad-libs-GstBaseVideoDecoder.html#GstBaseVideoDecoder" title="struct GstBaseVideoDecoder"><span class="type">GstBaseVideoDecoder</span></a>
581 </td>
582 </tr>
583 <tr>
584 <td><p><span class="term"><em class="parameter"><code>n_bytes</code></em> :</span></p></td>
585 <td>an encoded <a class="link" href="gst-plugins-bad-libs-GstBaseVideoCodec.html#GstVideoFrame" title="struct GstVideoFrame"><span class="type">GstVideoFrame</span></a>
586 </td>
587 </tr>
588 </tbody>
589 </table></div>
590 </div>
591 </div>
592 <div class="refsect1">
593 <a name="gst-plugins-bad-libs-GstBaseVideoDecoder.see-also"></a><h2>See Also</h2>
594 <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-libs/html/GstBaseTransform.html"><span class="type">GstBaseTransform</span></a>
595 </div>
596 </div>
597 <div class="footer">
598 <hr>
599           Generated by GTK-Doc V1.18</div>
600 </body>
601 </html>