blob: d8236c7ded6c1f1a321bd9708337e53e737bee87 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>gstdataprotocol</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="GStreamer 0.11 Library Reference Manual">
<link rel="up" href="gstreamer-dataprotocol.html" title="GStreamer Data Protocol">
<link rel="prev" href="gstreamer-dataprotocol.html" title="GStreamer Data Protocol">
<link rel="next" href="gstreamer-net.html" title="GStreamer Network Classes">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gstreamer-dataprotocol.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="gstreamer-dataprotocol.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GStreamer 0.11 Library Reference Manual</th>
<td><a accesskey="n" href="gstreamer-net.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gstreamer-libs-gstdataprotocol.synopsis" class="shortcut">Top</a>
 | 
<a href="#gstreamer-libs-gstdataprotocol.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="gstreamer-libs-gstdataprotocol"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gstreamer-libs-gstdataprotocol.top_of_page"></a>gstdataprotocol</span></h2>
<p>gstdataprotocol — Serialization of caps, buffers and events.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gstreamer-libs-gstdataprotocol.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gst/dataprotocol/dataprotocol.h&gt;
enum <a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFlag" title="enum GstDPHeaderFlag">GstDPHeaderFlag</a>;
enum <a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPayloadType" title="enum GstDPPayloadType">GstDPPayloadType</a>;
#define <a class="link" href="gstreamer-libs-gstdataprotocol.html#GST-DP-HEADER-LENGTH:CAPS" title="GST_DP_HEADER_LENGTH">GST_DP_HEADER_LENGTH</a>
enum <a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPVersion" title="enum GstDPVersion">GstDPVersion</a>;
#define <a class="link" href="gstreamer-libs-gstdataprotocol.html#GST-DP-VERSION-MAJOR:CAPS" title="GST_DP_VERSION_MAJOR">GST_DP_VERSION_MAJOR</a>
#define <a class="link" href="gstreamer-libs-gstdataprotocol.html#GST-DP-VERSION-MINOR:CAPS" title="GST_DP_VERSION_MINOR">GST_DP_VERSION_MINOR</a>
<span class="returnvalue">void</span> <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-init" title="gst_dp_init ()">gst_dp_init</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
<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-libs-gstdataprotocol.html#GstDPHeaderFromBufferFunction" title="GstDPHeaderFromBufferFunction ()">*GstDPHeaderFromBufferFunction</a>) (<em class="parameter"><code>const <a href="../gstreamer-0.11/gstreamer-GstBuffer.html#GstBuffer"><span class="type">GstBuffer</span></a> *buffer</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFlag" title="enum GstDPHeaderFlag"><span class="type">GstDPHeaderFlag</span></a> flags</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *length</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **header</code></em>);
<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-libs-gstdataprotocol.html#GstDPPacketFromCapsFunction" title="GstDPPacketFromCapsFunction ()">*GstDPPacketFromCapsFunction</a>) (<em class="parameter"><code>const <a href="../gstreamer-0.11/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a> *caps</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFlag" title="enum GstDPHeaderFlag"><span class="type">GstDPHeaderFlag</span></a> flags</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *length</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **header</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **payload</code></em>);
<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-libs-gstdataprotocol.html#GstDPPacketFromEventFunction" title="GstDPPacketFromEventFunction ()">*GstDPPacketFromEventFunction</a>) (<em class="parameter"><code>const <a href="../gstreamer-0.11/gstreamer-GstEvent.html#GstEvent"><span class="type">GstEvent</span></a> *event</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFlag" title="enum GstDPHeaderFlag"><span class="type">GstDPHeaderFlag</span></a> flags</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *length</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **header</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **payload</code></em>);
<a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPacketizer" title="GstDPPacketizer">GstDPPacketizer</a>;
<a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPacketizer" title="GstDPPacketizer"><span class="returnvalue">GstDPPacketizer</span></a> * <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-packetizer-new" title="gst_dp_packetizer_new ()">gst_dp_packetizer_new</a> (<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPVersion" title="enum GstDPVersion"><span class="type">GstDPVersion</span></a> version</code></em>);
<span class="returnvalue">void</span> <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-packetizer-free" title="gst_dp_packetizer_free ()">gst_dp_packetizer_free</a> (<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPacketizer" title="GstDPPacketizer"><span class="type">GstDPPacketizer</span></a> *packetizer</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint16"><span class="returnvalue">guint16</span></a> <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-crc" title="gst_dp_crc ()">gst_dp_crc</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *buffer</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> length</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-header-payload-length" title="gst_dp_header_payload_length ()">gst_dp_header_payload_length</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>);
<a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPayloadType" title="enum GstDPPayloadType"><span class="returnvalue">GstDPPayloadType</span></a> <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-header-payload-type" title="gst_dp_header_payload_type ()">gst_dp_header_payload_type</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>);
<a href="../gstreamer-0.11/gstreamer-GstBuffer.html#GstBuffer"><span class="returnvalue">GstBuffer</span></a> * <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-buffer-from-header" title="gst_dp_buffer_from_header ()">gst_dp_buffer_from_header</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>);
<a href="../gstreamer-0.11/gstreamer-GstCaps.html#GstCaps"><span class="returnvalue">GstCaps</span></a> * <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-caps-from-packet" title="gst_dp_caps_from_packet ()">gst_dp_caps_from_packet</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *payload</code></em>);
<a href="../gstreamer-0.11/gstreamer-GstEvent.html#GstEvent"><span class="returnvalue">GstEvent</span></a> * <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-event-from-packet" title="gst_dp_event_from_packet ()">gst_dp_event_from_packet</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *payload</code></em>);
<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-libs-gstdataprotocol.html#gst-dp-validate-header" title="gst_dp_validate_header ()">gst_dp_validate_header</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>);
<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-libs-gstdataprotocol.html#gst-dp-validate-payload" title="gst_dp_validate_payload ()">gst_dp_validate_payload</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *payload</code></em>);
<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-libs-gstdataprotocol.html#gst-dp-validate-packet" title="gst_dp_validate_packet ()">gst_dp_validate_packet</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *payload</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="gstreamer-libs-gstdataprotocol.description"></a><h2>Description</h2>
<p>
This helper library provides serialization of GstBuffer, GstCaps and
GstEvent structures.
</p>
<p>
This serialization is useful when GStreamer needs to interface with
the outside world to transport data between distinct GStreamer pipelines.
The connections with the outside world generally don't have mechanisms
to transport properties of these structures.
</p>
<p>
For example, transporting buffers across named pipes or network connections
doesn't maintain the buffer size and separation.
</p>
<p>
This data protocol assumes a reliable connection-oriented transport, such as
TCP, a pipe, or a file. The protocol does not serialize the caps for
each buffer; instead, it transport the caps only when they change in the
stream. This implies that there will always be a caps packet before any
buffer packets.
</p>
<p>
The versioning of the protocol is independent of GStreamer's version.
The major number gets incremented, and the minor reset, for incompatible
changes. The minor number gets incremented for compatible changes that
allow clients who do not completely understand the newer protocol version
to still decode what they do understand.
</p>
<p>
Version 0.2 serializes only a small subset of all events, with a custom
payload for each type. Also, all GDP streams start with the initial caps
packet.
</p>
<p>
Version 1.0 serializes all events by taking the string representation of
the event as the payload. In addition, GDP streams can now start with
events as well, as required by the new data stream model in GStreamer 0.10.
</p>
<p>
Converting buffers, caps and events to GDP buffers is done using a
<a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPacketizer" title="GstDPPacketizer"><span class="type">GstDPPacketizer</span></a> object and invoking its packetizer functions.
For backwards-compatibility reasons, the old 0.2 methods are still
available but deprecated.
</p>
<p>
For reference, this image shows the byte layout of the GDP header:
</p>
<p>
<img src="gdp-header.png">
</p>
</div>
<div class="refsect1">
<a name="gstreamer-libs-gstdataprotocol.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GstDPHeaderFlag"></a><h3>enum GstDPHeaderFlag</h3>
<pre class="programlisting">typedef enum {
GST_DP_HEADER_FLAG_NONE = 0,
GST_DP_HEADER_FLAG_CRC_HEADER = (1 &lt;&lt; 0),
GST_DP_HEADER_FLAG_CRC_PAYLOAD = (1 &lt;&lt; 1),
GST_DP_HEADER_FLAG_CRC = (1 &lt;&lt; 1) | (1 &lt;&lt; 0),
} GstDPHeaderFlag;
</pre>
<p>
header flags for the dataprotocol.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="GST-DP-HEADER-FLAG-NONE:CAPS"></a><span class="term"><code class="literal">GST_DP_HEADER_FLAG_NONE</code></span></p></td>
<td>No flag present.
</td>
</tr>
<tr>
<td><p><a name="GST-DP-HEADER-FLAG-CRC-HEADER:CAPS"></a><span class="term"><code class="literal">GST_DP_HEADER_FLAG_CRC_HEADER</code></span></p></td>
<td>a header CRC field is present.
</td>
</tr>
<tr>
<td><p><a name="GST-DP-HEADER-FLAG-CRC-PAYLOAD:CAPS"></a><span class="term"><code class="literal">GST_DP_HEADER_FLAG_CRC_PAYLOAD</code></span></p></td>
<td>a payload CRC field is present.
</td>
</tr>
<tr>
<td><p><a name="GST-DP-HEADER-FLAG-CRC:CAPS"></a><span class="term"><code class="literal">GST_DP_HEADER_FLAG_CRC</code></span></p></td>
<td>a CRC for header and payload is present.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="GstDPPayloadType"></a><h3>enum GstDPPayloadType</h3>
<pre class="programlisting">typedef enum {
GST_DP_PAYLOAD_NONE = 0,
GST_DP_PAYLOAD_BUFFER,
GST_DP_PAYLOAD_CAPS,
GST_DP_PAYLOAD_EVENT_NONE = 64,
} GstDPPayloadType;
</pre>
<p>
The GDP payload types. a <a href="../gstreamer-0.11/gstreamer-GstEvent.html#GstEvent"><span class="type">GstEvent</span></a> payload type is encoded with the
event type number starting from <em class="parameter"><code>GST_DP_PAYLOAD_EVENT_NONE</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="GST-DP-PAYLOAD-NONE:CAPS"></a><span class="term"><code class="literal">GST_DP_PAYLOAD_NONE</code></span></p></td>
<td>Invalid payload type.
</td>
</tr>
<tr>
<td><p><a name="GST-DP-PAYLOAD-BUFFER:CAPS"></a><span class="term"><code class="literal">GST_DP_PAYLOAD_BUFFER</code></span></p></td>
<td>
<a href="../gstreamer-0.11/gstreamer-GstBuffer.html#GstBuffer"><span class="type">GstBuffer</span></a> payload packet.
</td>
</tr>
<tr>
<td><p><a name="GST-DP-PAYLOAD-CAPS"></a><span class="term"><code class="literal">GST_DP_PAYLOAD_CAPS</code></span></p></td>
<td>
<a href="../gstreamer-0.11/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a> payload packet.
</td>
</tr>
<tr>
<td><p><a name="GST-DP-PAYLOAD-EVENT-NONE:CAPS"></a><span class="term"><code class="literal">GST_DP_PAYLOAD_EVENT_NONE</code></span></p></td>
<td>First value of <a href="../gstreamer-0.11/gstreamer-GstEvent.html#GstEvent"><span class="type">GstEvent</span></a> payload packets.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="GST-DP-HEADER-LENGTH:CAPS"></a><h3>GST_DP_HEADER_LENGTH</h3>
<pre class="programlisting">#define GST_DP_HEADER_LENGTH 62
</pre>
<p>
The header size in bytes.
</p>
</div>
<hr>
<div class="refsect2">
<a name="GstDPVersion"></a><h3>enum GstDPVersion</h3>
<pre class="programlisting">typedef enum {
GST_DP_VERSION_0_2 = 1,
GST_DP_VERSION_1_0,
} GstDPVersion;
</pre>
<p>
The version of the GDP protocol being used.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="GST-DP-VERSION-0-2:CAPS"></a><span class="term"><code class="literal">GST_DP_VERSION_0_2</code></span></p></td>
<td>protocol version 0.2
</td>
</tr>
<tr>
<td><p><a name="GST-DP-VERSION-1-0:CAPS"></a><span class="term"><code class="literal">GST_DP_VERSION_1_0</code></span></p></td>
<td>protocol version 1.0
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="GST-DP-VERSION-MAJOR:CAPS"></a><h3>GST_DP_VERSION_MAJOR</h3>
<pre class="programlisting">#define GST_DP_VERSION_MAJOR 0
</pre>
<p>
The major version number of the GStreamer Data Protocol.
</p>
</div>
<hr>
<div class="refsect2">
<a name="GST-DP-VERSION-MINOR:CAPS"></a><h3>GST_DP_VERSION_MINOR</h3>
<pre class="programlisting">#define GST_DP_VERSION_MINOR 2
</pre>
<p>
The minor version number of the GStreamer Data Protocol.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gst-dp-init"></a><h3>gst_dp_init ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> gst_dp_init (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Initialize GStreamer Data Protocol library.
</p>
<p>
Should be called before using these functions from source linking
to this source file.
</p>
</div>
<hr>
<div class="refsect2">
<a name="GstDPHeaderFromBufferFunction"></a><h3>GstDPHeaderFromBufferFunction ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> (*GstDPHeaderFromBufferFunction) (<em class="parameter"><code>const <a href="../gstreamer-0.11/gstreamer-GstBuffer.html#GstBuffer"><span class="type">GstBuffer</span></a> *buffer</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFlag" title="enum GstDPHeaderFlag"><span class="type">GstDPHeaderFlag</span></a> flags</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *length</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **header</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="GstDPPacketFromCapsFunction"></a><h3>GstDPPacketFromCapsFunction ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> (*GstDPPacketFromCapsFunction) (<em class="parameter"><code>const <a href="../gstreamer-0.11/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a> *caps</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFlag" title="enum GstDPHeaderFlag"><span class="type">GstDPHeaderFlag</span></a> flags</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *length</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **header</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **payload</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="GstDPPacketFromEventFunction"></a><h3>GstDPPacketFromEventFunction ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> (*GstDPPacketFromEventFunction) (<em class="parameter"><code>const <a href="../gstreamer-0.11/gstreamer-GstEvent.html#GstEvent"><span class="type">GstEvent</span></a> *event</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFlag" title="enum GstDPHeaderFlag"><span class="type">GstDPHeaderFlag</span></a> flags</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *length</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **header</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **payload</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="GstDPPacketizer"></a><h3>GstDPPacketizer</h3>
<pre class="programlisting">typedef struct {
GstDPVersion version;
GstDPHeaderFromBufferFunction header_from_buffer;
GstDPPacketFromCapsFunction packet_from_caps;
GstDPPacketFromEventFunction packet_from_event;
} GstDPPacketizer;
</pre>
<p>
Data protocol packetizer handle.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPVersion" title="enum GstDPVersion"><span class="type">GstDPVersion</span></a> <em class="structfield"><code><a name="GstDPPacketizer.version"></a>version</code></em>;</span></p></td>
<td>the <a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPVersion" title="enum GstDPVersion"><span class="type">GstDPVersion</span></a> of the protocol to be used</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFromBufferFunction" title="GstDPHeaderFromBufferFunction ()"><span class="type">GstDPHeaderFromBufferFunction</span></a> <em class="structfield"><code><a name="GstDPPacketizer.header-from-buffer"></a>header_from_buffer</code></em>;</span></p></td>
<td>buffer serializer function</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPacketFromCapsFunction" title="GstDPPacketFromCapsFunction ()"><span class="type">GstDPPacketFromCapsFunction</span></a> <em class="structfield"><code><a name="GstDPPacketizer.packet-from-caps"></a>packet_from_caps</code></em>;</span></p></td>
<td>caps serializer function</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPacketFromEventFunction" title="GstDPPacketFromEventFunction ()"><span class="type">GstDPPacketFromEventFunction</span></a> <em class="structfield"><code><a name="GstDPPacketizer.packet-from-event"></a>packet_from_event</code></em>;</span></p></td>
<td>event serializer function</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gst-dp-packetizer-new"></a><h3>gst_dp_packetizer_new ()</h3>
<pre class="programlisting"><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPacketizer" title="GstDPPacketizer"><span class="returnvalue">GstDPPacketizer</span></a> * gst_dp_packetizer_new (<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPVersion" title="enum GstDPVersion"><span class="type">GstDPVersion</span></a> version</code></em>);</pre>
<p>
Creates a new packetizer.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>version</code></em> :</span></p></td>
<td>the <a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPVersion" title="enum GstDPVersion"><span class="type">GstDPVersion</span></a> of the protocol to packetize for.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a newly allocated <a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPacketizer" title="GstDPPacketizer"><span class="type">GstDPPacketizer</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gst-dp-packetizer-free"></a><h3>gst_dp_packetizer_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> gst_dp_packetizer_free (<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPacketizer" title="GstDPPacketizer"><span class="type">GstDPPacketizer</span></a> *packetizer</code></em>);</pre>
<p>
Free the given packetizer.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>packetizer</code></em> :</span></p></td>
<td>the <a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPacketizer" title="GstDPPacketizer"><span class="type">GstDPPacketizer</span></a> to free.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gst-dp-crc"></a><h3>gst_dp_crc ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint16"><span class="returnvalue">guint16</span></a> gst_dp_crc (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *buffer</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> length</code></em>);</pre>
<p>
Calculate a CRC for the given buffer over the given number of bytes.
This is only provided for verification purposes; typical GDP users
will not need this function.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>array of bytes</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>the length of <em class="parameter"><code>buffer</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a two-byte CRC checksum.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gst-dp-header-payload-length"></a><h3>gst_dp_header_payload_length ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> gst_dp_header_payload_length (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>);</pre>
<p>
Get the length of the payload described by <em class="parameter"><code>header</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
<td>the byte header of the packet array</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the length of the payload this header describes.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gst-dp-header-payload-type"></a><h3>gst_dp_header_payload_type ()</h3>
<pre class="programlisting"><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPayloadType" title="enum GstDPPayloadType"><span class="returnvalue">GstDPPayloadType</span></a> gst_dp_header_payload_type (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>);</pre>
<p>
Get the type of the payload described by <em class="parameter"><code>header</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
<td>the byte header of the packet array</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the <a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPayloadType" title="enum GstDPPayloadType"><span class="type">GstDPPayloadType</span></a> the payload this header describes.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gst-dp-buffer-from-header"></a><h3>gst_dp_buffer_from_header ()</h3>
<pre class="programlisting"><a href="../gstreamer-0.11/gstreamer-GstBuffer.html#GstBuffer"><span class="returnvalue">GstBuffer</span></a> * gst_dp_buffer_from_header (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>);</pre>
<p>
Creates a newly allocated <a href="../gstreamer-0.11/gstreamer-GstBuffer.html#GstBuffer"><span class="type">GstBuffer</span></a> from the given header.
The buffer data needs to be copied into it before validating.
</p>
<p>
Use this function if you want to pre-allocate a buffer based on the
packet header to read the packet payload in to.
</p>
<p>
This function does not check the header passed to it, use
<a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-validate-header" title="gst_dp_validate_header ()"><code class="function">gst_dp_validate_header()</code></a> first if the header data is unchecked.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>header_length</code></em> :</span></p></td>
<td>the length of the packet header</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
<td>the byte array of the packet header</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A <a href="../gstreamer-0.11/gstreamer-GstBuffer.html#GstBuffer"><span class="type">GstBuffer</span></a> if the buffer was successfully created, or NULL.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gst-dp-caps-from-packet"></a><h3>gst_dp_caps_from_packet ()</h3>
<pre class="programlisting"><a href="../gstreamer-0.11/gstreamer-GstCaps.html#GstCaps"><span class="returnvalue">GstCaps</span></a> * gst_dp_caps_from_packet (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *payload</code></em>);</pre>
<p>
Creates a newly allocated <a href="../gstreamer-0.11/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a> from the given packet.
</p>
<p>
This function does not check the arguments passed to it, use
<a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-validate-packet" title="gst_dp_validate_packet ()"><code class="function">gst_dp_validate_packet()</code></a> first if the header and payload data are
unchecked.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>header_length</code></em> :</span></p></td>
<td>the length of the packet header</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
<td>the byte array of the packet header</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>payload</code></em> :</span></p></td>
<td>the byte array of the packet payload</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A <a href="../gstreamer-0.11/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a> containing the caps represented in the packet,
or NULL if the packet could not be converted.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gst-dp-event-from-packet"></a><h3>gst_dp_event_from_packet ()</h3>
<pre class="programlisting"><a href="../gstreamer-0.11/gstreamer-GstEvent.html#GstEvent"><span class="returnvalue">GstEvent</span></a> * gst_dp_event_from_packet (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *payload</code></em>);</pre>
<p>
Creates a newly allocated <a href="../gstreamer-0.11/gstreamer-GstEvent.html#GstEvent"><span class="type">GstEvent</span></a> from the given packet.
</p>
<p>
This function does not check the arguments passed to it, use
<a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-validate-packet" title="gst_dp_validate_packet ()"><code class="function">gst_dp_validate_packet()</code></a> first if the header and payload data are
unchecked.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>header_length</code></em> :</span></p></td>
<td>the length of the packet header</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
<td>the byte array of the packet header</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>payload</code></em> :</span></p></td>
<td>the byte array of the packet payload</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A <a href="../gstreamer-0.11/gstreamer-GstEvent.html#GstEvent"><span class="type">GstEvent</span></a> if the event was successfully created,
or NULL if an event could not be read from the payload.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gst-dp-validate-header"></a><h3>gst_dp_validate_header ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_dp_validate_header (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>);</pre>
<p>
Validates the given packet header by checking the CRC checksum.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>header_length</code></em> :</span></p></td>
<td>the length of the packet header</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
<td>the byte array of the packet header</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the CRC matches, or no CRC checksum is present.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gst-dp-validate-payload"></a><h3>gst_dp_validate_payload ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_dp_validate_payload (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *payload</code></em>);</pre>
<p>
Validates the given packet payload using the given packet header
by checking the CRC checksum.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>header_length</code></em> :</span></p></td>
<td>the length of the packet header</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
<td>the byte array of the packet header</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>payload</code></em> :</span></p></td>
<td>the byte array of the packet payload</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the CRC matches, or no CRC checksum is present.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gst-dp-validate-packet"></a><h3>gst_dp_validate_packet ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_dp_validate_packet (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *payload</code></em>);</pre>
<p>
Validates the given packet by checking version information and checksums.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>header_length</code></em> :</span></p></td>
<td>the length of the packet header</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
<td>the byte array of the packet header</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>payload</code></em> :</span></p></td>
<td>the byte array of the packet payload</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the packet validates.</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1">
<a name="gstreamer-libs-gstdataprotocol.see-also"></a><h2>See Also</h2>
<a href="../gstreamer-0.11/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a>, <a href="../gstreamer-0.11/gstreamer-GstEvent.html#GstEvent"><span class="type">GstEvent</span></a>, <a href="../gstreamer-0.11/gstreamer-GstBuffer.html#GstBuffer"><span class="type">GstBuffer</span></a>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.18</div>
</body>
</html>