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>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">
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-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>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#gst-plugins-base-libs-gsttagdemux.synopsis" class="shortcut">Top</a>
26 <a href="#gst-plugins-base-libs-gsttagdemux.description" class="shortcut">Description</a>
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>
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>
37 <td valign="top" align="right"></td>
39 <div class="refsynopsisdiv">
40 <a name="gst-plugins-base-libs-gsttagdemux.synopsis"></a><h2>Synopsis</h2>
41 <pre class="synopsis">
42 #include <gst/tag/gsttagdemux.h>
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>;
49 <div class="refsect1">
50 <a name="gst-plugins-base-libs-gsttagdemux.description"></a><h2>Description</h2>
53 <div class="refsect2">
54 <a name="idp17345968"></a><h3>Deriving from GstTagDemux</h3>
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.
67 Subclasses have to do four things:
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.
75 <li class="listitem"><p>
76 In their class init function, they must override
77 GST_TAG_DEMUX_CLASS(demux_klass)->identify_tag with their own identify
80 <li class="listitem"><p>
81 In their class init function, they must override
82 GST_TAG_DEMUX_CLASS(demux_klass)->parse_tag with their own parse
85 <li class="listitem"><p>
86 In their class init function, they must also set
87 GST_TAG_DEMUX_CLASS(demux_klass)->min_start_size and/or
88 GST_TAG_DEMUX_CLASS(demux_klass)->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
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 {
109 Opaque <a class="link" href="gst-plugins-base-libs-gsttagdemux.html#GstTagDemux" title="struct GstTagDemux"><span class="type">GstTagDemux</span></a> structure.
111 <div class="variablelist"><table border="0">
112 <col align="left" valign="top">
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>
118 <p class="since">Since 0.10.15</p>
121 <div class="refsect2">
122 <a name="GstTagDemuxClass"></a><h3>struct GstTagDemuxClass</h3>
123 <pre class="programlisting">struct GstTagDemuxClass {
124 GstElementClass parent_class;
126 /* minimum size required to identify a tag at the start and determine
128 guint min_start_size;
130 /* minimum size required to identify a tag at the end and determine
136 /* identify tag and determine the size required to parse the tag */
137 gboolean (*identify_tag) (GstTagDemux * demux,
142 /* parse the tag once it is identified and its size is known */
143 GstTagDemuxResult (*parse_tag) (GstTagDemux * demux,
149 /* merge start and end tags (optional) */
150 GstTagList * (*merge_tags) (GstTagDemux * demux,
151 const GstTagList * start_tags,
152 const GstTagList * end_tags);
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.
159 <div class="variablelist"><table border="0">
160 <col align="left" valign="top">
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>
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>
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>
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>
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>
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>
202 <p class="since">Since 0.10.15</p>
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
214 Result values from the parse_tag virtual function.
216 <div class="variablelist"><table border="0">
217 <col align="left" valign="top">
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
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
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
236 <p class="since">Since 0.10.15</p>
239 <div class="refsect1">
240 <a name="gst-plugins-base-libs-gsttagdemux.see-also"></a><h2>See Also</h2>
241 GstApeDemux, GstID3Demux
246 Generated by GTK-Doc V1.18</div>