tizen 2.3 release
[framework/multimedia/gst-plugins-base0.10.git] / docs / libs / html / gst-plugins-base-libs-gsttagdemux.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>gsttagdemux</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GStreamer Base Plugins 0.10 Library Reference Manual">
8 <link rel="up" href="gstreamer-tag.html" title="Tag Support Library">
9 <link rel="prev" href="gst-plugins-base-libs-gsttagxmpwriter.html" title="gsttagxmpwriter">
10 <link rel="next" href="gst-plugins-base-libs-gsttagmux.html" title="gsttagmux">
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-base-libs-gsttagxmpwriter.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="gstreamer-tag.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 Base Plugins 0.10 Library Reference Manual</th>
21 <td><a accesskey="n" href="gst-plugins-base-libs-gsttagmux.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-base-libs-gsttagdemux.synopsis" class="shortcut">Top</a>
25                    | 
26                   <a href="#gst-plugins-base-libs-gsttagdemux.description" class="shortcut">Description</a>
27 </td></tr>
28 </table>
29 <div class="refentry">
30 <a name="gst-plugins-base-libs-gsttagdemux"></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-base-libs-gsttagdemux.top_of_page"></a>gsttagdemux</span></h2>
34 <p>gsttagdemux — Base class for demuxing tags that are in chunks
35                     directly at the beginning or at the end of a file</p>
36 </td>
37 <td valign="top" align="right"></td>
38 </tr></table></div>
39 <div class="refsynopsisdiv">
40 <a name="gst-plugins-base-libs-gsttagdemux.synopsis"></a><h2>Synopsis</h2>
41 <pre class="synopsis">
42 #include &lt;gst/tag/gsttagdemux.h&gt;
43
44 struct              <a class="link" href="gst-plugins-base-libs-gsttagdemux.html#GstTagDemux" title="struct GstTagDemux">GstTagDemux</a>;
45 struct              <a class="link" href="gst-plugins-base-libs-gsttagdemux.html#GstTagDemuxClass" title="struct GstTagDemuxClass">GstTagDemuxClass</a>;
46 enum                <a class="link" href="gst-plugins-base-libs-gsttagdemux.html#GstTagDemuxResult" title="enum GstTagDemuxResult">GstTagDemuxResult</a>;
47 </pre>
48 </div>
49 <div class="refsect1">
50 <a name="gst-plugins-base-libs-gsttagdemux.description"></a><h2>Description</h2>
51 <p>
52 </p>
53 <div class="refsect2">
54 <a name="idp17345968"></a><h3>Deriving from GstTagDemux</h3>
55 <p>
56 Provides a base class for demuxing tags at the beginning or end of a
57 stream and handles things like typefinding, querying, seeking, and
58 different modes of operation (chain-based, pull_range-based, and providing
59 downstream elements with random access if upstream supports that). The tag
60 is stripped from the output, and all offsets are adjusted for the tag
61 sizes, so that to the downstream element the stream will appear as if
62 there was no tag at all. Also, once the tag has been parsed, GstTagDemux
63 will try to determine the media type of the resulting stream and add a
64 source pad with the appropriate caps in order to facilitate auto-plugging.
65 </p>
66 <p>
67 Subclasses have to do four things:
68 </p>
69 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
70 <li class="listitem"><p>
71  In their base init function, they must add a pad template for the sink
72  pad to the element class, describing the media type they can parse in
73  the caps of the pad template.
74  </p></li>
75 <li class="listitem"><p>
76  In their class init function, they must override
77  GST_TAG_DEMUX_CLASS(demux_klass)-&gt;identify_tag with their own identify
78  function.
79  </p></li>
80 <li class="listitem"><p>
81  In their class init function, they must override
82  GST_TAG_DEMUX_CLASS(demux_klass)-&gt;parse_tag with their own parse
83  function.
84  </p></li>
85 <li class="listitem"><p>
86  In their class init function, they must also set
87  GST_TAG_DEMUX_CLASS(demux_klass)-&gt;min_start_size and/or 
88  GST_TAG_DEMUX_CLASS(demux_klass)-&gt;min_end_size to the minimum size required
89  for the identify function to decide whether the stream has a supported tag
90  or not. A class parsing ID3v1 tags, for example, would set min_end_size to
91  128 bytes.
92  </p></li>
93 </ul></div>
94 <p>
95 </p>
96 </div>
97 <p>
98 </p>
99 </div>
100 <div class="refsect1">
101 <a name="gst-plugins-base-libs-gsttagdemux.details"></a><h2>Details</h2>
102 <div class="refsect2">
103 <a name="GstTagDemux"></a><h3>struct GstTagDemux</h3>
104 <pre class="programlisting">struct GstTagDemux {
105   GstElement element;
106 };
107 </pre>
108 <p>
109 Opaque <a class="link" href="gst-plugins-base-libs-gsttagdemux.html#GstTagDemux" title="struct GstTagDemux"><span class="type">GstTagDemux</span></a> structure.
110 </p>
111 <div class="variablelist"><table border="0">
112 <col align="left" valign="top">
113 <tbody><tr>
114 <td><p><span class="term"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html"><span class="type">GstElement</span></a> <em class="structfield"><code><a name="GstTagDemux.element"></a>element</code></em>;</span></p></td>
115 <td>parent element</td>
116 </tr></tbody>
117 </table></div>
118 <p class="since">Since 0.10.15</p>
119 </div>
120 <hr>
121 <div class="refsect2">
122 <a name="GstTagDemuxClass"></a><h3>struct GstTagDemuxClass</h3>
123 <pre class="programlisting">struct GstTagDemuxClass {
124   GstElementClass parent_class;
125
126   /* minimum size required to identify a tag at the start and determine
127    * its total size */
128   guint                  min_start_size;
129
130   /* minimum size required to identify a tag at the end and determine
131    * its total size */
132   guint                  min_end_size;
133
134   /* vtable */
135
136   /* identify tag and determine the size required to parse the tag */
137   gboolean               (*identify_tag)  (GstTagDemux * demux,
138                                            GstBuffer   * buffer,
139                                            gboolean      start_tag,
140                                            guint       * tag_size);
141
142   /* parse the tag once it is identified and its size is known */
143   GstTagDemuxResult      (*parse_tag)     (GstTagDemux * demux,
144                                            GstBuffer   * buffer,
145                                            gboolean      start_tag,
146                                            guint       * tag_size,
147                                            GstTagList ** tags);
148
149   /* merge start and end tags (optional) */
150   GstTagList *           (*merge_tags)    (GstTagDemux      * demux,
151                                            const GstTagList * start_tags,
152                                            const GstTagList * end_tags);
153 };
154 </pre>
155 <p>
156 The <a class="link" href="gst-plugins-base-libs-gsttagdemux.html#GstTagDemuxClass" title="struct GstTagDemuxClass"><span class="type">GstTagDemuxClass</span></a> structure.  See documentation at beginning of section
157 for details about what subclasses need to override and do.
158 </p>
159 <div class="variablelist"><table border="0">
160 <col align="left" valign="top">
161 <tbody>
162 <tr>
163 <td><p><span class="term"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html#GstElementClass"><span class="type">GstElementClass</span></a> <em class="structfield"><code><a name="GstTagDemuxClass.parent-class"></a>parent_class</code></em>;</span></p></td>
164 <td>the parent class.</td>
165 </tr>
166 <tr>
167 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> <em class="structfield"><code><a name="GstTagDemuxClass.min-start-size"></a>min_start_size</code></em>;</span></p></td>
168 <td>minimum size required to identify a tag at the start and
169 determine its total size. Set to 0 if not interested in start tags.
170 Subclasses should set this in their class_init function.</td>
171 </tr>
172 <tr>
173 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> <em class="structfield"><code><a name="GstTagDemuxClass.min-end-size"></a>min_end_size</code></em>;</span></p></td>
174 <td>minimum size required to identify a tag at the end and
175 determine its total size. Set to 0 if not interested in end tags.
176 Subclasses should set this in their class_init function.</td>
177 </tr>
178 <tr>
179 <td><p><span class="term"><em class="structfield"><code><a name="GstTagDemuxClass.identify-tag"></a>identify_tag</code></em> ()</span></p></td>
180 <td>identify tag and determine the size required to parse the
181 tag. Buffer may be larger than the specified minimum size.
182 Subclassed MUST override this vfunc in their class_init function.</td>
183 </tr>
184 <tr>
185 <td><p><span class="term"><em class="structfield"><code><a name="GstTagDemuxClass.parse-tag"></a>parse_tag</code></em> ()</span></p></td>
186 <td>parse the tag. Buffer will be exactly of the size determined by
187 the identify_tag vfunc before. The parse_tag vfunc may change the size
188 stored in *tag_size and return GST_TAG_DEMUX_RESULT_AGAIN to request a
189 larger or smaller buffer. It is also permitted to adjust the tag_size to a
190 smaller value and then return GST_TAG_DEMUX_RESULT_OK in one go.
191 Subclassed MUST override the parse_tag vfunc in their class_init function.</td>
192 </tr>
193 <tr>
194 <td><p><span class="term"><em class="structfield"><code><a name="GstTagDemuxClass.merge-tags"></a>merge_tags</code></em> ()</span></p></td>
195 <td>merge start and end tags. Subclasses may want to override this
196 vfunc to allow prioritising of start or end tag according to user
197 preference.  Note that both start_tags and end_tags may be NULL. By default
198 start tags are prefered over end tags.</td>
199 </tr>
200 </tbody>
201 </table></div>
202 <p class="since">Since 0.10.15</p>
203 </div>
204 <hr>
205 <div class="refsect2">
206 <a name="GstTagDemuxResult"></a><h3>enum GstTagDemuxResult</h3>
207 <pre class="programlisting">typedef enum {
208   GST_TAG_DEMUX_RESULT_BROKEN_TAG,
209   GST_TAG_DEMUX_RESULT_AGAIN,
210   GST_TAG_DEMUX_RESULT_OK
211 } GstTagDemuxResult;
212 </pre>
213 <p>
214 Result values from the parse_tag virtual function.
215 </p>
216 <div class="variablelist"><table border="0">
217 <col align="left" valign="top">
218 <tbody>
219 <tr>
220 <td><p><a name="GST-TAG-DEMUX-RESULT-BROKEN-TAG:CAPS"></a><span class="term"><code class="literal">GST_TAG_DEMUX_RESULT_BROKEN_TAG</code></span></p></td>
221 <td>cannot parse tag, just skip it
222 </td>
223 </tr>
224 <tr>
225 <td><p><a name="GST-TAG-DEMUX-RESULT-AGAIN:CAPS"></a><span class="term"><code class="literal">GST_TAG_DEMUX_RESULT_AGAIN</code></span></p></td>
226 <td>call again with less or more data
227 </td>
228 </tr>
229 <tr>
230 <td><p><a name="GST-TAG-DEMUX-RESULT-OK:CAPS"></a><span class="term"><code class="literal">GST_TAG_DEMUX_RESULT_OK</code></span></p></td>
231 <td>parsed tag successfully
232 </td>
233 </tr>
234 </tbody>
235 </table></div>
236 <p class="since">Since 0.10.15</p>
237 </div>
238 </div>
239 <div class="refsect1">
240 <a name="gst-plugins-base-libs-gsttagdemux.see-also"></a><h2>See Also</h2>
241 GstApeDemux, GstID3Demux
242 </div>
243 </div>
244 <div class="footer">
245 <hr>
246           Generated by GTK-Doc V1.18</div>
247 </body>
248 </html>