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>GstFormat</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GStreamer 0.10 Core Reference Manual">
8 <link rel="up" href="libgstreamer.html" title="GStreamer Core Library">
9 <link rel="prev" href="gstreamer-GstFilter.html" title="GstFilter">
10 <link rel="next" href="GstGhostPad.html" title="GstGhostPad">
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="gstreamer-GstFilter.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="libgstreamer.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 0.10 Core Reference Manual</th>
21 <td><a accesskey="n" href="GstGhostPad.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="#gstreamer-GstFormat.synopsis" class="shortcut">Top</a>
26 <a href="#gstreamer-GstFormat.description" class="shortcut">Description</a>
29 <div class="refentry">
30 <a name="gstreamer-GstFormat"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
33 <h2><span class="refentrytitle"><a name="gstreamer-GstFormat.top_of_page"></a>GstFormat</span></h2>
34 <p>GstFormat — Dynamically register new data formats</p>
36 <td valign="top" align="right"></td>
38 <div class="refsynopsisdiv">
39 <a name="gstreamer-GstFormat.synopsis"></a><h2>Synopsis</h2>
40 <pre class="synopsis">
41 #include <gst/gst.h>
43 enum <a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat">GstFormat</a>;
44 #define <a class="link" href="gstreamer-GstFormat.html#GST-FORMAT-PERCENT-MAX:CAPS" title="GST_FORMAT_PERCENT_MAX">GST_FORMAT_PERCENT_MAX</a>
45 #define <a class="link" href="gstreamer-GstFormat.html#GST-FORMAT-PERCENT-SCALE:CAPS" title="GST_FORMAT_PERCENT_SCALE">GST_FORMAT_PERCENT_SCALE</a>
46 struct <a class="link" href="gstreamer-GstFormat.html#GstFormatDefinition" title="struct GstFormatDefinition">GstFormatDefinition</a>;
47 const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="gstreamer-GstFormat.html#gst-format-get-name" title="gst_format_get_name ()">gst_format_get_name</a> (<em class="parameter"><code><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> format</code></em>);
48 <a href="http://library.gnome.org/devel/glib/unstable/glib-Quarks.html#GQuark"><span class="returnvalue">GQuark</span></a> <a class="link" href="gstreamer-GstFormat.html#gst-format-to-quark" title="gst_format_to_quark ()">gst_format_to_quark</a> (<em class="parameter"><code><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> format</code></em>);
49 <a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="returnvalue">GstFormat</span></a> <a class="link" href="gstreamer-GstFormat.html#gst-format-register" title="gst_format_register ()">gst_format_register</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *nick</code></em>,
50 <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *description</code></em>);
51 <a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="returnvalue">GstFormat</span></a> <a class="link" href="gstreamer-GstFormat.html#gst-format-get-by-nick" title="gst_format_get_by_nick ()">gst_format_get_by_nick</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *nick</code></em>);
52 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gstreamer-GstFormat.html#gst-formats-contains" title="gst_formats_contains ()">gst_formats_contains</a> (<em class="parameter"><code>const <a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> *formats</code></em>,
53 <em class="parameter"><code><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> format</code></em>);
54 const <a class="link" href="gstreamer-GstFormat.html#GstFormatDefinition" title="struct GstFormatDefinition"><span class="returnvalue">GstFormatDefinition</span></a> * <a class="link" href="gstreamer-GstFormat.html#gst-format-get-details" title="gst_format_get_details ()">gst_format_get_details</a> (<em class="parameter"><code><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> format</code></em>);
55 <a class="link" href="gstreamer-GstIterator.html#GstIterator" title="struct GstIterator"><span class="returnvalue">GstIterator</span></a> * <a class="link" href="gstreamer-GstFormat.html#gst-format-iterate-definitions" title="gst_format_iterate_definitions ()">gst_format_iterate_definitions</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
58 <div class="refsect1">
59 <a name="gstreamer-GstFormat.description"></a><h2>Description</h2>
61 GstFormats functions are used to register a new format to the gstreamer
62 core. Formats can be used to perform seeking or conversions/query
66 <div class="refsect1">
67 <a name="gstreamer-GstFormat.details"></a><h2>Details</h2>
68 <div class="refsect2">
69 <a name="GstFormat"></a><h3>enum GstFormat</h3>
70 <pre class="programlisting">typedef enum {
71 GST_FORMAT_UNDEFINED = 0, /* must be first in list */
72 GST_FORMAT_DEFAULT = 1,
75 GST_FORMAT_BUFFERS = 4,
76 GST_FORMAT_PERCENT = 5
80 Standard predefined formats
82 <div class="variablelist"><table border="0">
83 <col align="left" valign="top">
86 <td><p><a name="GST-FORMAT-UNDEFINED:CAPS"></a><span class="term"><code class="literal">GST_FORMAT_UNDEFINED</code></span></p></td>
91 <td><p><a name="GST-FORMAT-DEFAULT:CAPS"></a><span class="term"><code class="literal">GST_FORMAT_DEFAULT</code></span></p></td>
92 <td>the default format of the pad/element. This can be
93 samples for raw audio, frames/fields for raw video (some, but not all,
94 elements support this; use <em class="parameter"><code>GST_FORMAT_TIME</code></em> if you don't have a good
95 reason to query for samples/frames)
99 <td><p><a name="GST-FORMAT-BYTES:CAPS"></a><span class="term"><code class="literal">GST_FORMAT_BYTES</code></span></p></td>
104 <td><p><a name="GST-FORMAT-TIME:CAPS"></a><span class="term"><code class="literal">GST_FORMAT_TIME</code></span></p></td>
105 <td>time in nanoseconds
109 <td><p><a name="GST-FORMAT-BUFFERS:CAPS"></a><span class="term"><code class="literal">GST_FORMAT_BUFFERS</code></span></p></td>
110 <td>buffers (few, if any, elements implement this as of
115 <td><p><a name="GST-FORMAT-PERCENT:CAPS"></a><span class="term"><code class="literal">GST_FORMAT_PERCENT</code></span></p></td>
116 <td>percentage of stream (few, if any, elements implement
124 <div class="refsect2">
125 <a name="GST-FORMAT-PERCENT-MAX:CAPS"></a><h3>GST_FORMAT_PERCENT_MAX</h3>
126 <pre class="programlisting">#define GST_FORMAT_PERCENT_MAX G_GINT64_CONSTANT (1000000)
129 The PERCENT format is between 0 and this value
133 <div class="refsect2">
134 <a name="GST-FORMAT-PERCENT-SCALE:CAPS"></a><h3>GST_FORMAT_PERCENT_SCALE</h3>
135 <pre class="programlisting">#define GST_FORMAT_PERCENT_SCALE G_GINT64_CONSTANT (10000)
138 The value used to scale down the reported PERCENT format value to
143 <div class="refsect2">
144 <a name="GstFormatDefinition"></a><h3>struct GstFormatDefinition</h3>
145 <pre class="programlisting">struct GstFormatDefinition {
148 const gchar *description;
155 <div class="variablelist"><table border="0">
156 <col align="left" valign="top">
159 <td><p><span class="term"><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> <em class="structfield"><code><a name="GstFormatDefinition.value"></a>value</code></em>;</span></p></td>
160 <td>The unique id of this format</td>
163 <td><p><span class="term">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="GstFormatDefinition.nick"></a>nick</code></em>;</span></p></td>
164 <td>A short nick of the format</td>
167 <td><p><span class="term">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="GstFormatDefinition.description"></a>description</code></em>;</span></p></td>
168 <td>A longer description of the format</td>
171 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> <em class="structfield"><code><a name="GstFormatDefinition.quark"></a>quark</code></em>;</span></p></td>
172 <td>A quark for the nick</td>
178 <div class="refsect2">
179 <a name="gst-format-get-name"></a><h3>gst_format_get_name ()</h3>
180 <pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * gst_format_get_name (<em class="parameter"><code><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> format</code></em>);</pre>
182 Get a printable name for the given format. Do not modify or free.
184 <div class="variablelist"><table border="0">
185 <col align="left" valign="top">
188 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
189 <td>a <a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a>
193 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
194 <td>a reference to the static name of the format or NULL if
195 the format is unknown.</td>
201 <div class="refsect2">
202 <a name="gst-format-to-quark"></a><h3>gst_format_to_quark ()</h3>
203 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Quarks.html#GQuark"><span class="returnvalue">GQuark</span></a> gst_format_to_quark (<em class="parameter"><code><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> format</code></em>);</pre>
205 Get the unique quark for the given format.
207 <div class="variablelist"><table border="0">
208 <col align="left" valign="top">
211 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
212 <td>a <a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a>
216 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
217 <td>the quark associated with the format or 0 if the format
224 <div class="refsect2">
225 <a name="gst-format-register"></a><h3>gst_format_register ()</h3>
226 <pre class="programlisting"><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="returnvalue">GstFormat</span></a> gst_format_register (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *nick</code></em>,
227 <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *description</code></em>);</pre>
229 Create a new GstFormat based on the nick or return an
230 already registered format with that nick.
232 <div class="variablelist"><table border="0">
233 <col align="left" valign="top">
236 <td><p><span class="term"><em class="parameter"><code>nick</code></em> :</span></p></td>
237 <td>The nick of the new format</td>
240 <td><p><span class="term"><em class="parameter"><code>description</code></em> :</span></p></td>
241 <td>The description of the new format</td>
244 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
245 <td>A new GstFormat or an already registered format
253 <div class="refsect2">
254 <a name="gst-format-get-by-nick"></a><h3>gst_format_get_by_nick ()</h3>
255 <pre class="programlisting"><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="returnvalue">GstFormat</span></a> gst_format_get_by_nick (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *nick</code></em>);</pre>
257 Return the format registered with the given nick.
259 <div class="variablelist"><table border="0">
260 <col align="left" valign="top">
263 <td><p><span class="term"><em class="parameter"><code>nick</code></em> :</span></p></td>
264 <td>The nick of the format</td>
267 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
268 <td>The format with <em class="parameter"><code>nick</code></em> or GST_FORMAT_UNDEFINED
269 if the format was not registered.</td>
275 <div class="refsect2">
276 <a name="gst-formats-contains"></a><h3>gst_formats_contains ()</h3>
277 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_formats_contains (<em class="parameter"><code>const <a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> *formats</code></em>,
278 <em class="parameter"><code><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> format</code></em>);</pre>
280 See if the given format is inside the format array.
282 <div class="variablelist"><table border="0">
283 <col align="left" valign="top">
286 <td><p><span class="term"><em class="parameter"><code>formats</code></em> :</span></p></td>
287 <td>The format array to search</td>
290 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
291 <td>the format to find</td>
294 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
295 <td>TRUE if the format is found inside the array</td>
301 <div class="refsect2">
302 <a name="gst-format-get-details"></a><h3>gst_format_get_details ()</h3>
303 <pre class="programlisting">const <a class="link" href="gstreamer-GstFormat.html#GstFormatDefinition" title="struct GstFormatDefinition"><span class="returnvalue">GstFormatDefinition</span></a> * gst_format_get_details (<em class="parameter"><code><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> format</code></em>);</pre>
305 Get details about the given format.
307 <div class="variablelist"><table border="0">
308 <col align="left" valign="top">
311 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
312 <td>The format to get details of</td>
315 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
316 <td>The <a class="link" href="gstreamer-GstFormat.html#GstFormatDefinition" title="struct GstFormatDefinition"><span class="type">GstFormatDefinition</span></a> for <em class="parameter"><code>format</code></em> or NULL on failure.
323 <div class="refsect2">
324 <a name="gst-format-iterate-definitions"></a><h3>gst_format_iterate_definitions ()</h3>
325 <pre class="programlisting"><a class="link" href="gstreamer-GstIterator.html#GstIterator" title="struct GstIterator"><span class="returnvalue">GstIterator</span></a> * gst_format_iterate_definitions (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
327 Iterate all the registered formats. The format definition is read
330 <div class="variablelist"><table border="0">
331 <col align="left" valign="top">
333 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
334 <td>a GstIterator of <a class="link" href="gstreamer-GstFormat.html#GstFormatDefinition" title="struct GstFormatDefinition"><span class="type">GstFormatDefinition</span></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
340 <div class="refsect1">
341 <a name="gstreamer-GstFormat.see-also"></a><h2>See Also</h2>
342 <a class="link" href="GstPad.html" title="GstPad"><span class="type">GstPad</span></a>, <a class="link" href="GstElement.html" title="GstElement"><span class="type">GstElement</span></a>
347 Generated by GTK-Doc V1.18</div>