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>rawaudioparse: GStreamer Base Plugins 1.0 Plugins Reference Manual</title> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="index.html" title="GStreamer Base Plugins 1.0 Plugins Reference Manual"> 8<link rel="up" href="ch01.html" title="gst-plugins-base Elements"> 9<link rel="prev" href="gst-plugins-base-plugins-playsink.html" title="playsink"> 10<link rel="next" href="gst-plugins-base-plugins-rawvideoparse.html" title="rawvideoparse"> 11<meta name="generator" content="GTK-Doc V1.28 (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="5"><tr valign="middle"> 16<td width="100%" align="left" class="shortcuts"> 17<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> 18 <a href="#gst-plugins-base-plugins-rawaudioparse.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span> 19 <a href="#gst-plugins-base-plugins-rawaudioparse.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_properties"> <span class="dim">|</span> 20 <a href="#gst-plugins-base-plugins-rawaudioparse.properties" class="shortcut">Properties</a></span> 21</td> 22<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> 23<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> 24<td><a accesskey="p" href="gst-plugins-base-plugins-playsink.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> 25<td><a accesskey="n" href="gst-plugins-base-plugins-rawvideoparse.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> 26</tr></table> 27<div class="refentry"> 28<a name="gst-plugins-base-plugins-rawaudioparse"></a><div class="titlepage"></div> 29<div class="refnamediv"><table width="100%"><tr> 30<td valign="top"> 31<h2><span class="refentrytitle"><a name="gst-plugins-base-plugins-rawaudioparse.top_of_page"></a>rawaudioparse</span></h2> 32<p>rawaudioparse</p> 33</td> 34<td class="gallery_image" valign="top" align="right"></td> 35</tr></table></div> 36<div class="refsect1"> 37<a name="gst-plugins-base-plugins-rawaudioparse.properties"></a><h2>Properties</h2> 38<div class="informaltable"><table class="informaltable" border="0"> 39<colgroup> 40<col width="150px" class="properties_type"> 41<col width="300px" class="properties_name"> 42<col width="200px" class="properties_flags"> 43</colgroup> 44<tbody> 45<tr> 46<td class="property_type"> 47<a href="/usr/share/gtk-doc/html/gobject/gobject-Value-arrays.html#GValueArray-struct"><span class="type">GValueArray</span></a> *</td> 48<td class="property_name"><a class="link" href="gst-plugins-base-plugins-rawaudioparse.html#GstRawAudioParse--channel-positions" title="The “channel-positions” property">channel-positions</a></td> 49<td class="property_flags">Read / Write</td> 50</tr> 51<tr> 52<td class="property_type"><span class="type">GstRawAudioParseFormat</span></td> 53<td class="property_name"><a class="link" href="gst-plugins-base-plugins-rawaudioparse.html#GstRawAudioParse--format" title="The “format” property">format</a></td> 54<td class="property_flags">Read / Write</td> 55</tr> 56<tr> 57<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td> 58<td class="property_name"><a class="link" href="gst-plugins-base-plugins-rawaudioparse.html#GstRawAudioParse--interleaved" title="The “interleaved” property">interleaved</a></td> 59<td class="property_flags">Read / Write</td> 60</tr> 61<tr> 62<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td> 63<td class="property_name"><a class="link" href="gst-plugins-base-plugins-rawaudioparse.html#GstRawAudioParse--num-channels" title="The “num-channels” property">num-channels</a></td> 64<td class="property_flags">Read / Write</td> 65</tr> 66<tr> 67<td class="property_type"><a href="../html/gst-plugins-base-libs-GstAudio.html#GstAudioFormat"><span class="type">GstAudioFormat</span></a></td> 68<td class="property_name"><a class="link" href="gst-plugins-base-plugins-rawaudioparse.html#GstRawAudioParse--pcm-format" title="The “pcm-format” property">pcm-format</a></td> 69<td class="property_flags">Read / Write</td> 70</tr> 71<tr> 72<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td> 73<td class="property_name"><a class="link" href="gst-plugins-base-plugins-rawaudioparse.html#GstRawAudioParse--sample-rate" title="The “sample-rate” property">sample-rate</a></td> 74<td class="property_flags">Read / Write</td> 75</tr> 76</tbody> 77</table></div> 78</div> 79<a name="GstRawAudioParse"></a><div class="refsect1"> 80<a name="gst-plugins-base-plugins-rawaudioparse.other"></a><h2>Types and Values</h2> 81<div class="informaltable"><table class="informaltable" width="100%" border="0"> 82<colgroup> 83<col width="150px" class="name"> 84<col class="description"> 85</colgroup> 86<tbody><tr> 87<td class="datatype_keyword">struct</td> 88<td class="function_name"><a class="link" href="gst-plugins-base-plugins-rawaudioparse.html#GstRawAudioParse-struct" title="struct GstRawAudioParse">GstRawAudioParse</a></td> 89</tr></tbody> 90</table></div> 91</div> 92<div class="refsect1"> 93<a name="gst-plugins-base-plugins-rawaudioparse.object-hierarchy"></a><h2>Object Hierarchy</h2> 94<pre class="screen"> <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct">GObject</a> 95 <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a> 96 <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstObject.html#GstObject-struct">GstObject</a> 97 <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstElement.html#GstElement-struct">GstElement</a> 98 <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-libs-1.0/GstBaseParse.html#GstBaseParse-struct">GstBaseParse</a> 99 <span class="lineart">╰──</span> GstRawBaseParse 100 <span class="lineart">╰──</span> GstRawAudioParse 101</pre> 102</div> 103<div class="refsect1"> 104<a name="gst-plugins-base-plugins-rawaudioparse.description"></a><h2>Description</h2> 105<p>This element parses incoming data as raw audio samples and timestamps it. 106It also handles seek queries in said raw audio data, and ensures that output 107buffers contain an integer number of samples, even if the input buffers don't. 108For example, with sample format S16LE and 2 channels, an input buffer of 411 109bytes contains 102.75 samples. rawaudioparse will then output 102 samples 110(= 408 bytes) and keep the remaining 3 bytes. These will then be prepended to 111the next input data.</p> 112<p>The element implements the properties and sink caps configuration as specified 113in the <span class="type">GstRawBaseParse</span> documentation. The properties configuration can be 114modified by using the sample-rate, num-channels, channel-positions, format, 115and pcm-format properties.</p> 116<p>Currently, this parser supports raw data in a-law, mu-law, or linear PCM format.</p> 117<p>To facilitate operation with the unalignedaudioparse element, rawaudioparse 118supports the "audio/x-unaligned-raw" media type. This is treated identically to 119"audio/x-raw", except that it is used by source elements which do not guarantee 120that the buffers they push out are timestamped and contain an integer amount of 121samples (see the 411 bytes example above). By using a different media type, it 122is guaranteed that unalignedaudioparse is autoplugged, making sure that the 123autoplugged chain does not push unparsed content downstream. The source caps' 124media type with linear PCM data is always "audio/x-raw", even if the sink caps 125use "audio/x-unaligned-raw".</p> 126<p>The channel-positions property can be used to set explicit position information 127for each channel. If the array that is passed to this property does not match 128the number of channels indicated by num-channels, then said number of channels 129is updated to the array length. If channel-positions is NULL, then the default 130GStreamer positioning is used. This property is also useful for swapping left 131and right in a stereo signal for example.</p> 132<div class="refsect3"> 133<a name="id-1.2.86.7.7"></a><h4>Example pipelines</h4> 134<div class="informalexample"> 135 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> 136 <tbody> 137 <tr> 138 <td class="listing_lines" align="right"><pre>1 1392</pre></td> 140 <td class="listing_code"><pre class="programlisting">gst<span class="gtkdoc opt">-</span>launch<span class="gtkdoc opt">-</span><span class="number">1.0</span> souphttpsrc http<span class="gtkdoc opt">:</span><span class="gtkdoc slc">//my-dlna-server/track.l16 \</span> 141 rawaudioparse <span class="gtkdoc opt">!</span> audioconvert <span class="gtkdoc opt">!</span> audioresample <span class="gtkdoc opt">!</span> autoaudiosink</pre></td> 142 </tr> 143 </tbody> 144 </table> 145</div> 146 147<p> 148 Receive L16 data from a DLNA server, parse and timestamp it with 149rawaudioparse, and play it. use-sink-caps is set to true since souphttpsrc 150will set its source pad's caps to audio/x-unaligned-raw for the L16 stream.</p> 151<div class="informalexample"> 152 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> 153 <tbody> 154 <tr> 155 <td class="listing_lines" align="right"><pre>1 1562 1573</pre></td> 158 <td class="listing_code"><pre class="programlisting">gst<span class="gtkdoc opt">-</span>launch<span class="gtkdoc opt">-</span><span class="number">1.0</span> filesrc location<span class="gtkdoc opt">=</span>audio<span class="gtkdoc opt">.</span>raw <span class="gtkdoc opt">!</span> rawaudioparse use<span class="gtkdoc opt">-</span>sink<span class="gtkdoc opt">-</span>caps<span class="gtkdoc opt">=</span><span class="keyword">false</span> \ 159 format<span class="gtkdoc opt">=</span>pcm pcm<span class="gtkdoc opt">-</span>format<span class="gtkdoc opt">=</span>s16le sample<span class="gtkdoc opt">-</span>rate<span class="gtkdoc opt">=</span><span class="number">48000</span> num<span class="gtkdoc opt">-</span>channels<span class="gtkdoc opt">=</span><span class="number">2</span> \ 160 audioconvert <span class="gtkdoc opt">!</span> audioresample <span class="gtkdoc opt">!</span> autoaudiosink</pre></td> 161 </tr> 162 </tbody> 163 </table> 164</div> 165 166<p> 167 Read raw data from a local file and parse it as PCM data with 48000 Hz sample 168rate, signed 16 bit integer samples, and 2 channels. use-sink-caps is set to 169false to ensure the property information is used and the parser does not expect 170audio/x-raw or audio/x-unaligned-raw caps.</p> 171</div> 172<div class="refsynopsisdiv"> 173<h2>Synopsis</h2> 174<div class="refsect2"> 175<a name="id-1.2.86.7.8.1"></a><h3>Element Information</h3> 176<div class="variablelist"><table border="0" class="variablelist"> 177<colgroup> 178<col align="left" valign="top"> 179<col> 180</colgroup> 181<tbody> 182<tr> 183<td><p><span class="term">plugin</span></p></td> 184<td> 185 <a class="link" href="gst-plugins-base-plugins-plugin-rawparse.html#plugin-rawparse">rawparse</a> 186 </td> 187</tr> 188<tr> 189<td><p><span class="term">author</span></p></td> 190<td>Carlos Rafael Giani <dv@pseudoterminal.org></td> 191</tr> 192<tr> 193<td><p><span class="term">class</span></p></td> 194<td>Codec/Parser/Audio</td> 195</tr> 196</tbody> 197</table></div> 198</div> 199<hr> 200<div class="refsect2"> 201<a name="id-1.2.86.7.8.2"></a><h3>Element Pads</h3> 202<div class="variablelist"><table border="0" class="variablelist"> 203<colgroup> 204<col align="left" valign="top"> 205<col> 206</colgroup> 207<tbody> 208<tr> 209<td><p><span class="term">name</span></p></td> 210<td>sink</td> 211</tr> 212<tr> 213<td><p><span class="term">direction</span></p></td> 214<td>sink</td> 215</tr> 216<tr> 217<td><p><span class="term">presence</span></p></td> 218<td>always</td> 219</tr> 220<tr> 221<td><p><span class="term">details</span></p></td> 222<td>audio/x-unaligned-raw, format=(string){ S8, U8, S16LE, S16BE, U16LE, U16BE, S24_32LE, S24_32BE, U24_32LE, U24_32BE, S32LE, S32BE, U32LE, U32BE, S24LE, S24BE, U24LE, U24BE, S20LE, S20BE, U20LE, U20BE, S18LE, S18BE, U18LE, U18BE, F32LE, F32BE, F64LE, F64BE }, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ], layout=(string){ interleaved, non-interleaved }</td> 223</tr> 224<tr> 225<td><p><span class="term"></span></p></td> 226<td> audio/x-raw, format=(string){ S8, U8, S16LE, S16BE, U16LE, U16BE, S24_32LE, S24_32BE, U24_32LE, U24_32BE, S32LE, S32BE, U32LE, U32BE, S24LE, S24BE, U24LE, U24BE, S20LE, S20BE, U20LE, U20BE, S18LE, S18BE, U18LE, U18BE, F32LE, F32BE, F64LE, F64BE }, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ], layout=(string){ interleaved, non-interleaved }</td> 227</tr> 228<tr> 229<td><p><span class="term"></span></p></td> 230<td> audio/x-alaw, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ]</td> 231</tr> 232<tr> 233<td><p><span class="term"></span></p></td> 234<td> audio/x-mulaw, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ]</td> 235</tr> 236</tbody> 237</table></div> 238<div class="variablelist"><table border="0" class="variablelist"> 239<colgroup> 240<col align="left" valign="top"> 241<col> 242</colgroup> 243<tbody> 244<tr> 245<td><p><span class="term">name</span></p></td> 246<td>src</td> 247</tr> 248<tr> 249<td><p><span class="term">direction</span></p></td> 250<td>source</td> 251</tr> 252<tr> 253<td><p><span class="term">presence</span></p></td> 254<td>always</td> 255</tr> 256<tr> 257<td><p><span class="term">details</span></p></td> 258<td>audio/x-raw, format=(string){ S8, U8, S16LE, S16BE, U16LE, U16BE, S24_32LE, S24_32BE, U24_32LE, U24_32BE, S32LE, S32BE, U32LE, U32BE, S24LE, S24BE, U24LE, U24BE, S20LE, S20BE, U20LE, U20BE, S18LE, S18BE, U18LE, U18BE, F32LE, F32BE, F64LE, F64BE }, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ], layout=(string){ interleaved, non-interleaved }</td> 259</tr> 260<tr> 261<td><p><span class="term"></span></p></td> 262<td> audio/x-alaw, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ]</td> 263</tr> 264<tr> 265<td><p><span class="term"></span></p></td> 266<td> audio/x-mulaw, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ]</td> 267</tr> 268</tbody> 269</table></div> 270</div> 271</div> 272</div> 273<div class="refsect1"> 274<a name="gst-plugins-base-plugins-rawaudioparse.functions_details"></a><h2>Functions</h2> 275<p></p> 276</div> 277<div class="refsect1"> 278<a name="gst-plugins-base-plugins-rawaudioparse.other_details"></a><h2>Types and Values</h2> 279<div class="refsect2"> 280<a name="GstRawAudioParse-struct"></a><h3>struct GstRawAudioParse</h3> 281<pre class="programlisting">struct GstRawAudioParse;</pre> 282</div> 283</div> 284<div class="refsect1"> 285<a name="gst-plugins-base-plugins-rawaudioparse.property-details"></a><h2>Property Details</h2> 286<div class="refsect2"> 287<a name="GstRawAudioParse--channel-positions"></a><h3>The <code class="literal">“channel-positions”</code> property</h3> 288<pre class="programlisting"> “channel-positions” <a href="/usr/share/gtk-doc/html/gobject/gobject-Value-arrays.html#GValueArray-struct"><span class="type">GValueArray</span></a> *</pre> 289<p>Channel positions used on the output.</p> 290<p>Flags: Read / Write</p> 291</div> 292<hr> 293<div class="refsect2"> 294<a name="GstRawAudioParse--format"></a><h3>The <code class="literal">“format”</code> property</h3> 295<pre class="programlisting"> “format” <span class="type">GstRawAudioParseFormat</span></pre> 296<p>Format of the raw audio stream.</p> 297<p>Flags: Read / Write</p> 298<p>Default value: PCM</p> 299</div> 300<hr> 301<div class="refsect2"> 302<a name="GstRawAudioParse--interleaved"></a><h3>The <code class="literal">“interleaved”</code> property</h3> 303<pre class="programlisting"> “interleaved” <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre> 304<p>True if audio has interleaved layout.</p> 305<p>Flags: Read / Write</p> 306<p>Default value: TRUE</p> 307</div> 308<hr> 309<div class="refsect2"> 310<a name="GstRawAudioParse--num-channels"></a><h3>The <code class="literal">“num-channels”</code> property</h3> 311<pre class="programlisting"> “num-channels” <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a></pre> 312<p>Number of channels in raw stream.</p> 313<p>Flags: Read / Write</p> 314<p>Allowed values: >= 1</p> 315<p>Default value: 2</p> 316</div> 317<hr> 318<div class="refsect2"> 319<a name="GstRawAudioParse--pcm-format"></a><h3>The <code class="literal">“pcm-format”</code> property</h3> 320<pre class="programlisting"> “pcm-format” <a href="../html/gst-plugins-base-libs-GstAudio.html#GstAudioFormat"><span class="type">GstAudioFormat</span></a></pre> 321<p>Format of audio samples in PCM stream (ignored if format property is not set to pcm).</p> 322<p>Flags: Read / Write</p> 323<p>Default value: GST_AUDIO_FORMAT_UNKNOWN</p> 324</div> 325<hr> 326<div class="refsect2"> 327<a name="GstRawAudioParse--sample-rate"></a><h3>The <code class="literal">“sample-rate”</code> property</h3> 328<pre class="programlisting"> “sample-rate” <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a></pre> 329<p>Rate of audio samples in raw stream.</p> 330<p>Flags: Read / Write</p> 331<p>Allowed values: >= 1</p> 332<p>Default value: 44100</p> 333</div> 334</div> 335</div> 336<div class="footer"> 337<hr>Generated by GTK-Doc V1.28</div> 338</body> 339</html>