Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > 6d445a7e34cab500c4a729b1f6c7a5fd > files > 108

lib64gstreamer-plugins-base0.10-devel-0.10.17-3mdv2008.1.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>gstaudio</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.72.0">
<link rel="start" href="index.html" title="GStreamer Base Plugins 0.10 Library Reference Manual">
<link rel="up" href="gstreamer-audio.html" title="Audio Library">
<link rel="prev" href="gstreamer-audio.html" title="Audio Library">
<link rel="next" href="gst-plugins-base-libs-gstaudioclock.html" title="gstaudioclock">
<meta name="generator" content="GTK-Doc V1.8 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="part" href="gstreamer-plugins-base.html" title="Part&#160;I.&#160;GStreamer Base Plugins Libraries">
<link rel="chapter" href="gstreamer-audio.html" title="Audio Library">
<link rel="chapter" href="gstreamer-cdda.html" title="CDDA Library">
<link rel="chapter" href="gstreamer-ffft.html" title="FFT Library">
<link rel="chapter" href="gstreamer-floatcast.html" title="FloatCast Library">
<link rel="chapter" href="gstreamer-interfaces.html" title="Interfaces Library">
<link rel="chapter" href="gstreamer-netbuffer.html" title="Network Buffer Library">
<link rel="chapter" href="gstreamer-riff.html" title="Riff Media Library">
<link rel="chapter" href="gstreamer-rtp.html" title="RTP Library">
<link rel="chapter" href="gstreamer-rtsp.html" title="RTSP Library">
<link rel="chapter" href="gstreamer-sdp.html" title="SDP Library">
<link rel="chapter" href="gstreamer-tag.html" title="Tag Support Library">
<link rel="chapter" href="gstreamer-base-utils.html" title="Base Utils Library">
<link rel="chapter" href="gstreamer-video.html" title="Video Library">
<link rel="part" href="gstreamer-libs-hierarchy.html" title="Part&#160;II.&#160;Object Hierarchy">
<link rel="index" href="api-index.html" title="Index">
</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-audio.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="gstreamer-audio.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 Base Plugins 0.10 Library Reference Manual</th>
<td><a accesskey="n" href="gst-plugins-base-libs-gstaudioclock.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2511396" class="shortcut">Top</a>
                  &#160;|&#160;
                  <a href="#id2556574" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="gst-plugins-base-libs-gstaudio"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id2511396"></a><span class="refentrytitle">gstaudio</span>
</h2>
<p>gstaudio &#8212; Support library for audio elements</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">

#include &lt;gst/audio/audio.h&gt;


enum                <a href="gst-plugins-base-libs-gstaudio.html#GstAudioFieldFlag">GstAudioFieldFlag</a>;
#define             <a href="gst-plugins-base-libs-gstaudio.html#GST-FRAMES-TO-CLOCK-TIME:CAPS">GST_FRAMES_TO_CLOCK_TIME</a>            (frames, rate)
#define             <a href="gst-plugins-base-libs-gstaudio.html#GST-CLOCK-TIME-TO-FRAMES:CAPS">GST_CLOCK_TIME_TO_FRAMES</a>            (clocktime, rate)
#define             <a href="gst-plugins-base-libs-gstaudio.html#GST-AUDIO-DEF-RATE:CAPS">GST_AUDIO_DEF_RATE</a>
#define             <a href="gst-plugins-base-libs-gstaudio.html#GST-AUDIO-FLOAT-PAD-TEMPLATE-CAPS:CAPS">GST_AUDIO_FLOAT_PAD_TEMPLATE_CAPS</a>
#define             <a href="gst-plugins-base-libs-gstaudio.html#GST-AUDIO-FLOAT-STANDARD-PAD-TEMPLATE-CAPS:CAPS">GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS</a>
#define             <a href="gst-plugins-base-libs-gstaudio.html#GST-AUDIO-INT-PAD-TEMPLATE-CAPS:CAPS">GST_AUDIO_INT_PAD_TEMPLATE_CAPS</a>
#define             <a href="gst-plugins-base-libs-gstaudio.html#GST-AUDIO-INT-STANDARD-PAD-TEMPLATE-CAPS:CAPS">GST_AUDIO_INT_STANDARD_PAD_TEMPLATE_CAPS</a>
int                 <a href="gst-plugins-base-libs-gstaudio.html#gst-audio-frame-byte-size">gst_audio_frame_byte_size</a>           (GstPad *pad);
long                <a href="gst-plugins-base-libs-gstaudio.html#gst-audio-frame-length">gst_audio_frame_length</a>              (GstPad *pad,
                                                         GstBuffer *buf);
GstClockTime        <a href="gst-plugins-base-libs-gstaudio.html#gst-audio-duration-from-pad-buffer">gst_audio_duration_from_pad_buffer</a>  (GstPad *pad,
                                                         GstBuffer *buf);
gboolean            <a href="gst-plugins-base-libs-gstaudio.html#gst-audio-is-buffer-framed">gst_audio_is_buffer_framed</a>          (GstPad *pad,
                                                         GstBuffer *buf);
void                <a href="gst-plugins-base-libs-gstaudio.html#gst-audio-structure-set-int">gst_audio_structure_set_int</a>         (GstStructure *structure,
                                                         <a href="gst-plugins-base-libs-gstaudio.html#GstAudioFieldFlag">GstAudioFieldFlag</a> flag);
GstBuffer*          <a href="gst-plugins-base-libs-gstaudio.html#gst-audio-buffer-clip">gst_audio_buffer_clip</a>               (GstBuffer *buffer,
                                                         GstSegment *segment,
                                                         gint rate,
                                                         gint frame_size);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2556574"></a><h2>Description</h2>
<p>
This library contains some helper functions for audio elements.</p>
<p>

</p>
</div>
<div class="refsect1" lang="en">
<a name="id2556593"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2556603"></a><h3>
<a name="GstAudioFieldFlag"></a>enum GstAudioFieldFlag</h3>
<a class="indexterm" name="id2556619"></a><pre class="programlisting">typedef enum {
  GST_AUDIO_FIELD_RATE          = (1 &lt;&lt; 0),
  GST_AUDIO_FIELD_CHANNELS      = (1 &lt;&lt; 1),
  GST_AUDIO_FIELD_ENDIANNESS    = (1 &lt;&lt; 2),
  GST_AUDIO_FIELD_WIDTH         = (1 &lt;&lt; 3),
  GST_AUDIO_FIELD_DEPTH         = (1 &lt;&lt; 4),
  GST_AUDIO_FIELD_SIGNED        = (1 &lt;&lt; 5),
} GstAudioFieldFlag;
</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">GstAudioFieldFlag</code> is deprecated and should not be used in newly-written code. use <code class="function">gst_structure_set()</code> directly</p>
</div>
<p>
Do not use anymore.</p>
<p>

</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2556672"></a><h3>
<a name="GST-FRAMES-TO-CLOCK-TIME:CAPS"></a>GST_FRAMES_TO_CLOCK_TIME()</h3>
<a class="indexterm" name="id2556686"></a><pre class="programlisting">#define             GST_FRAMES_TO_CLOCK_TIME(frames, rate)</pre>
<p>
Calculate clocktime from sample <em class="parameter"><code>frames</code></em> and <em class="parameter"><code>rate</code></em>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>frames</code></em>&#160;:</span></td>
<td> sample frames
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>rate</code></em>&#160;:</span></td>
<td> sampling rate
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2556749"></a><h3>
<a name="GST-CLOCK-TIME-TO-FRAMES:CAPS"></a>GST_CLOCK_TIME_TO_FRAMES()</h3>
<a class="indexterm" name="id2556762"></a><pre class="programlisting">#define             GST_CLOCK_TIME_TO_FRAMES(clocktime, rate)</pre>
<p>
Calculate frames from <em class="parameter"><code>clocktime</code></em> and sample <em class="parameter"><code>rate</code></em>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>clocktime</code></em>&#160;:</span></td>
<td> clock time
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>rate</code></em>&#160;:</span></td>
<td> sampling rate
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2556830"></a><h3>
<a name="GST-AUDIO-DEF-RATE:CAPS"></a>GST_AUDIO_DEF_RATE</h3>
<a class="indexterm" name="id2556843"></a><pre class="programlisting">#define GST_AUDIO_DEF_RATE 44100
</pre>
<p>
Standard sampling rate used in consumer audio.</p>
<p>

</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2556862"></a><h3>
<a name="GST-AUDIO-FLOAT-PAD-TEMPLATE-CAPS:CAPS"></a>GST_AUDIO_FLOAT_PAD_TEMPLATE_CAPS</h3>
<a class="indexterm" name="id2556873"></a><pre class="programlisting">#define             GST_AUDIO_FLOAT_PAD_TEMPLATE_CAPS</pre>
<p>

</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2556889"></a><h3>
<a name="GST-AUDIO-FLOAT-STANDARD-PAD-TEMPLATE-CAPS:CAPS"></a>GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS</h3>
<a class="indexterm" name="id2556902"></a><pre class="programlisting">#define             GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS</pre>
<p>

</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2556918"></a><h3>
<a name="GST-AUDIO-INT-PAD-TEMPLATE-CAPS:CAPS"></a>GST_AUDIO_INT_PAD_TEMPLATE_CAPS</h3>
<a class="indexterm" name="id2556933"></a><pre class="programlisting">#define             GST_AUDIO_INT_PAD_TEMPLATE_CAPS</pre>
<p>

</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2556949"></a><h3>
<a name="GST-AUDIO-INT-STANDARD-PAD-TEMPLATE-CAPS:CAPS"></a>GST_AUDIO_INT_STANDARD_PAD_TEMPLATE_CAPS</h3>
<a class="indexterm" name="id2556962"></a><pre class="programlisting">#define             GST_AUDIO_INT_STANDARD_PAD_TEMPLATE_CAPS</pre>
<p>

</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2556978"></a><h3>
<a name="gst-audio-frame-byte-size"></a>gst_audio_frame_byte_size ()</h3>
<a class="indexterm" name="id2556991"></a><pre class="programlisting">int                 gst_audio_frame_byte_size           (GstPad *pad);</pre>
<p>
Calculate byte size of an audio frame.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>pad</code></em>&#160;:</span></td>
<td> the <span class="type">GstPad</span> to get the caps from
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> the byte size, or 0 if there was an error
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2557060"></a><h3>
<a name="gst-audio-frame-length"></a>gst_audio_frame_length ()</h3>
<a class="indexterm" name="id2557073"></a><pre class="programlisting">long                gst_audio_frame_length              (GstPad *pad,
                                                         GstBuffer *buf);</pre>
<p>
Calculate length of buffer in frames.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>pad</code></em>&#160;:</span></td>
<td> the <span class="type">GstPad</span> to get the caps from
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>buf</code></em>&#160;:</span></td>
<td> the <span class="type">GstBuffer</span>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> 0 if there's an error, or the number of frames if everything's ok
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2557172"></a><h3>
<a name="gst-audio-duration-from-pad-buffer"></a>gst_audio_duration_from_pad_buffer ()</h3>
<a class="indexterm" name="id2557186"></a><pre class="programlisting">GstClockTime        gst_audio_duration_from_pad_buffer  (GstPad *pad,
                                                         GstBuffer *buf);</pre>
<p>
Calculate length in nanoseconds of audio buffer <em class="parameter"><code>buf</code></em> based on capabilities of
<em class="parameter"><code>pad</code></em>.
</p>
<p>
Return: the length.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>pad</code></em>&#160;:</span></td>
<td> the <span class="type">GstPad</span> to get the caps from
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>buf</code></em>&#160;:</span></td>
<td> the <span class="type">GstBuffer</span>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td>


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2557299"></a><h3>
<a name="gst-audio-is-buffer-framed"></a>gst_audio_is_buffer_framed ()</h3>
<a class="indexterm" name="id2557312"></a><pre class="programlisting">gboolean            gst_audio_is_buffer_framed          (GstPad *pad,
                                                         GstBuffer *buf);</pre>
<p>
Check if the buffer size is a whole multiple of the frame size.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>pad</code></em>&#160;:</span></td>
<td> the <span class="type">GstPad</span> to get the caps from
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>buf</code></em>&#160;:</span></td>
<td> the <span class="type">GstBuffer</span>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> <code class="literal">TRUE</code> if buffer size is multiple.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2557421"></a><h3>
<a name="gst-audio-structure-set-int"></a>gst_audio_structure_set_int ()</h3>
<a class="indexterm" name="id2557437"></a><pre class="programlisting">void                gst_audio_structure_set_int         (GstStructure *structure,
                                                         <a href="gst-plugins-base-libs-gstaudio.html#GstAudioFieldFlag">GstAudioFieldFlag</a> flag);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gst_audio_structure_set_int</code> is deprecated and should not be used in newly-written code. use <code class="function">gst_structure_set()</code></p>
</div>
<p>
Do not use anymore.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>structure</code></em>&#160;:</span></td>
<td> a <span class="type">GstStructure</span>
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>flag</code></em>&#160;:</span></td>
<td> a set of <a href="gst-plugins-base-libs-gstaudio.html#GstAudioFieldFlag"><span class="type">GstAudioFieldFlag</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2557547"></a><h3>
<a name="gst-audio-buffer-clip"></a>gst_audio_buffer_clip ()</h3>
<a class="indexterm" name="id2557562"></a><pre class="programlisting">GstBuffer*          gst_audio_buffer_clip               (GstBuffer *buffer,
                                                         GstSegment *segment,
                                                         gint rate,
                                                         gint frame_size);</pre>
<p>
Clip the the buffer to the given <code class="literal">GstSegment</code>.
</p>
<p>
After calling this function the caller does not own a reference to 
<em class="parameter"><code>buffer</code></em> anymore.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>buffer</code></em>&#160;:</span></td>
<td> The buffer to clip.
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>segment</code></em>&#160;:</span></td>
<td> Segment in <code class="literal">GST_FORMAT_TIME</code> or <code class="literal">GST_FORMAT_DEFAULT</code> to which the buffer should be clipped.
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>rate</code></em>&#160;:</span></td>
<td> sample rate.
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>frame_size</code></em>&#160;:</span></td>
<td> size of one audio frame in bytes.
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> <code class="literal">NULL</code> if the buffer is completely outside the configured segment,
otherwise the clipped buffer is returned.

If the buffer has no timestamp, it is assumed to be inside the segment and
is not clipped 

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since  0.10.14
</p>
</div>
</div>
</div>
</body>
</html>