1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
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">
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">
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>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#gst-plugins-bad-libs-GstBaseVideoDecoder.synopsis" class="shortcut">Top</a>
26 <a href="#gst-plugins-bad-libs-GstBaseVideoDecoder.description" class="shortcut">Description</a>
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>
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>
36 <td valign="top" align="right"></td>
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,
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>);
81 <div class="refsect1">
82 <a name="gst-plugins-bad-libs-GstBaseVideoDecoder.description"></a><h2>Description</h2>
84 This base class is for video decoders turning encoded data into raw video
88 GstBaseVideoDecoder and subclass should cooperate as follows.
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.
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.
105 <li class="listitem"><p>
106 GstBaseVideoDecoder calls <em class="parameter"><code>stop</code></em> at end of all processing.
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'.
118 <li class="listitem"><p>
119 Input frame is provided to subclass' <em class="parameter"><code>handle_frame</code></em>.
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
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.
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>.
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.
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
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.
167 Things that subclass need to take care of:
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
174 <li class="listitem"><p>
175 Configure some baseclass behaviour parameters.
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.
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>.
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"
199 The name of the templates for the sink pad.
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"
208 The name of the templates for the source pad.
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
217 Returned while parsing to indicate more data is needed.
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
226 Returned when the event/buffer should be dropped.
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>
235 <div class="refsect2">
236 <a name="GstBaseVideoDecoder"></a><h3>struct GstBaseVideoDecoder</h3>
237 <pre class="programlisting">struct GstBaseVideoDecoder {
238 GstBaseVideoCodec base_video_codec;
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.
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;
251 gboolean (*start) (GstBaseVideoDecoder *coder);
253 gboolean (*stop) (GstBaseVideoDecoder *coder);
255 int (*scan_for_sync) (GstBaseVideoDecoder *decoder, gboolean at_eos,
258 GstFlowReturn (*parse_data) (GstBaseVideoDecoder *decoder, gboolean at_eos);
260 gboolean (*set_format) (GstBaseVideoDecoder *coder, GstVideoState * state);
262 gboolean (*reset) (GstBaseVideoDecoder *coder);
264 GstFlowReturn (*finish) (GstBaseVideoDecoder *coder);
266 GstFlowReturn (*handle_frame) (GstBaseVideoDecoder *coder, GstVideoFrame *frame);
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.
275 <div class="variablelist"><table border="0">
276 <col align="left" valign="top">
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>
283 <td><p><span class="term"><em class="structfield"><code><a name="GstBaseVideoDecoderClass.start"></a>start</code></em> ()</span></p></td>
285 Called when the element starts processing.
286 Allows opening external resources.</td>
289 <td><p><span class="term"><em class="structfield"><code><a name="GstBaseVideoDecoderClass.stop"></a>stop</code></em> ()</span></p></td>
291 Called when the element stops processing.
292 Allows closing external resources.</td>
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>
297 Allows subclass to obtain sync for subsequent parsing
298 by custom means (above an beyond scanning for specific
299 marker and mask).</td>
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>
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>
312 <td><p><span class="term"><em class="structfield"><code><a name="GstBaseVideoDecoderClass.reset"></a>reset</code></em> ()</span></p></td>
314 Allows subclass (codec) to perform post-seek semantics reset.</td>
317 <td><p><span class="term"><em class="structfield"><code><a name="GstBaseVideoDecoderClass.finish"></a>finish</code></em> ()</span></p></td>
319 Called to request subclass to dispatch any pending remaining
320 data (e.g. at EOS).</td>
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>
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>
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">
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>
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>
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>
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>
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.
370 <div class="variablelist"><table border="0">
371 <col align="left" valign="top">
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>
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>
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>
390 Advances out-of-sync input data by 1 byte and marks it accordingly.
392 <div class="variablelist"><table border="0">
393 <col align="left" valign="top">
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>
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>
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>.
409 <div class="variablelist"><table border="0">
410 <col align="left" valign="top">
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>
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>
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>
431 Marks current frame as a sync point, i.e. keyframe.
433 <div class="variablelist"><table border="0">
434 <col align="left" valign="top">
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>
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>
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>.
449 <div class="variablelist"><table border="0">
450 <col align="left" valign="top">
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>
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>
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>.
468 <div class="variablelist"><table border="0">
469 <col align="left" valign="top">
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>
477 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
478 <td>allocated buffer</td>
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>
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.
495 <div class="variablelist"><table border="0">
496 <col align="left" valign="top">
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>
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>
509 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
510 <td>result from pad alloc call</td>
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">
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>
528 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></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>
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>
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.
547 <div class="variablelist"><table border="0">
548 <col align="left" valign="top">
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>
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>
561 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
562 <td>max decoding time.</td>
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>
573 Removes next <em class="parameter"><code>n_bytes</code></em> of input data and adds it to currently parsed frame.
575 <div class="variablelist"><table border="0">
576 <col align="left" valign="top">
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>
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>
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>
599 Generated by GTK-Doc V1.18</div>