Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > main-release > by-pkgid > fba57c789abf4ed3484c767370e6ce0d > files > 130

lib64pulseaudio-devel-0.9.9-7mdv2008.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=UTF-8">
<title>PulseAudio: sample.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.5 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="classes.html"><span>Data&nbsp;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
<h1>sample.h</h1><a href="sample_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef foosamplehfoo</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define foosamplehfoo</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="comment">/* $Id: sample.h 2042 2007-11-09 18:24:09Z lennart $ */</span>
<a name="l00005"></a>00005 
<a name="l00006"></a>00006 <span class="comment">/***</span>
<a name="l00007"></a>00007 <span class="comment">  This file is part of PulseAudio.</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment">  Copyright 2004-2006 Lennart Poettering</span>
<a name="l00010"></a>00010 <span class="comment">  Copyright 2006 Pierre Ossman &lt;ossman@cendio.se&gt; for Cendio AB</span>
<a name="l00011"></a>00011 <span class="comment"></span>
<a name="l00012"></a>00012 <span class="comment">  PulseAudio is free software; you can redistribute it and/or modify</span>
<a name="l00013"></a>00013 <span class="comment">  it under the terms of the GNU Lesser General Public License as published</span>
<a name="l00014"></a>00014 <span class="comment">  by the Free Software Foundation; either version 2 of the License,</span>
<a name="l00015"></a>00015 <span class="comment">  or (at your option) any later version.</span>
<a name="l00016"></a>00016 <span class="comment"></span>
<a name="l00017"></a>00017 <span class="comment">  PulseAudio is distributed in the hope that it will be useful, but</span>
<a name="l00018"></a>00018 <span class="comment">  WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00019"></a>00019 <span class="comment">  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>
<a name="l00020"></a>00020 <span class="comment">  General Public License for more details.</span>
<a name="l00021"></a>00021 <span class="comment"></span>
<a name="l00022"></a>00022 <span class="comment">  You should have received a copy of the GNU Lesser General Public License</span>
<a name="l00023"></a>00023 <span class="comment">  along with PulseAudio; if not, write to the Free Software</span>
<a name="l00024"></a>00024 <span class="comment">  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307</span>
<a name="l00025"></a>00025 <span class="comment">  USA.</span>
<a name="l00026"></a>00026 <span class="comment">***/</span>
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;inttypes.h&gt;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &lt;sys/types.h&gt;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;math.h&gt;</span>
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;pulse/cdecl.h&gt;</span>
<a name="l00033"></a>00033 
<a name="l00105"></a>00105 PA_C_DECL_BEGIN
<a name="l00106"></a>00106 
<a name="l00108"></a><a class="code" href="sample_8h.html#4c6778fd8a093f9984ce0448f81d9dcf">00108</a> <span class="preprocessor">#define PA_CHANNELS_MAX 32</span>
<a name="l00109"></a>00109 <span class="preprocessor"></span>
<a name="l00111"></a><a class="code" href="sample_8h.html#3a7f31e73acc7e833fe0d49290adf839">00111</a> <span class="preprocessor">#define PA_RATE_MAX (48000*4)</span>
<a name="l00112"></a>00112 <span class="preprocessor"></span>
<a name="l00114"></a><a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05f">00114</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> <a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05f" title="Sample format.">pa_sample_format</a> {
<a name="l00115"></a><a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05f40e5414deb5fbd486c2929e6993a5544">00115</a>     <a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05f40e5414deb5fbd486c2929e6993a5544" title="Unsigned 8 Bit PCM.">PA_SAMPLE_U8</a>,              
<a name="l00116"></a><a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05f267f6542eb6f66ca61c4cccf61326522">00116</a>     <a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05f267f6542eb6f66ca61c4cccf61326522" title="8 Bit a-Law">PA_SAMPLE_ALAW</a>,            
<a name="l00117"></a><a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05f83116fc70f8577fdcf694474a60c2e1f">00117</a>     <a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05f83116fc70f8577fdcf694474a60c2e1f" title="8 Bit mu-Law">PA_SAMPLE_ULAW</a>,            
<a name="l00118"></a><a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05f50e4a2b43c258e559fa9d252275131ce">00118</a>     <a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05f50e4a2b43c258e559fa9d252275131ce" title="Signed 16 Bit PCM, little endian (PC).">PA_SAMPLE_S16LE</a>,           
<a name="l00119"></a><a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05f783cb88f5021ff01fa7ba6d1c2bee84c">00119</a>     <a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05f783cb88f5021ff01fa7ba6d1c2bee84c" title="Signed 16 Bit PCM, big endian.">PA_SAMPLE_S16BE</a>,           
<a name="l00120"></a><a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05fd2f6c96c4f0cd2a841fbe4840488b548">00120</a>     <a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05fd2f6c96c4f0cd2a841fbe4840488b548" title="32 Bit IEEE floating point, little endian, range -1 to 1">PA_SAMPLE_FLOAT32LE</a>,       
<a name="l00121"></a><a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05f3550123d5ef697b349edea2ddf61d6b4">00121</a>     <a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05f3550123d5ef697b349edea2ddf61d6b4" title="32 Bit IEEE floating point, big endian, range -1 to 1">PA_SAMPLE_FLOAT32BE</a>,       
<a name="l00122"></a><a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05f3eb5213ed7a0887b5dcd28cfc97e3457">00122</a>     <a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05f3eb5213ed7a0887b5dcd28cfc97e3457" title="Signed 32 Bit PCM, little endian (PC).">PA_SAMPLE_S32LE</a>,           
<a name="l00123"></a><a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05ff81ba0a2b599c490228f619e2a8d3b0e">00123</a>     <a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05ff81ba0a2b599c490228f619e2a8d3b0e" title="Signed 32 Bit PCM, big endian (PC).">PA_SAMPLE_S32BE</a>,           
<a name="l00124"></a><a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05fa6fe0e0623f9e2204c63c293f13597a1">00124</a>     <a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05fa6fe0e0623f9e2204c63c293f13597a1" title="Upper limit of valid sample types.">PA_SAMPLE_MAX</a>,             
<a name="l00125"></a><a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05ffe8a3cc049d2c9820efd8fea80e01e10">00125</a>     <a class="code" href="sample_8h.html#3c622fc51f4fc6ebfdcc7b454ac9c05ffe8a3cc049d2c9820efd8fea80e01e10" title="An invalid value.">PA_SAMPLE_INVALID</a> = -1     
<a name="l00126"></a>00126 } <a class="code" href="sample_8h.html#41051ceaa5cfbe60c9b176deb7bfed0e">pa_sample_format_t</a>;
<a name="l00127"></a>00127 
<a name="l00128"></a>00128 <span class="preprocessor">#ifdef WORDS_BIGENDIAN</span>
<a name="l00129"></a>00129 <span class="preprocessor"></span>
<a name="l00130"></a>00130 <span class="preprocessor">#define PA_SAMPLE_S16NE PA_SAMPLE_S16BE</span>
<a name="l00131"></a>00131 <span class="preprocessor"></span>
<a name="l00132"></a>00132 <span class="preprocessor">#define PA_SAMPLE_FLOAT32NE PA_SAMPLE_FLOAT32BE</span>
<a name="l00133"></a>00133 <span class="preprocessor"></span>
<a name="l00134"></a>00134 <span class="preprocessor">#define PA_SAMPLE_S32NE PA_SAMPLE_S32BE</span>
<a name="l00135"></a>00135 <span class="preprocessor"></span>
<a name="l00136"></a>00136 <span class="preprocessor">#define PA_SAMPLE_S16RE PA_SAMPLE_S16LE</span>
<a name="l00137"></a>00137 <span class="preprocessor"></span>
<a name="l00138"></a>00138 <span class="preprocessor">#define PA_SAMPLE_FLOAT32RE PA_SAMPLE_FLOAT32LE</span>
<a name="l00139"></a>00139 <span class="preprocessor"></span>
<a name="l00140"></a>00140 <span class="preprocessor">#define PA_SAMPLE_S32RE PA_SAMPLE_S32LE</span>
<a name="l00141"></a>00141 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00142"></a>00142 <span class="preprocessor"></span>
<a name="l00143"></a><a class="code" href="sample_8h.html#292c1d8ebd4ca0de1d5d5379ee7be38a">00143</a> <span class="preprocessor">#define PA_SAMPLE_S16NE PA_SAMPLE_S16LE</span>
<a name="l00144"></a>00144 <span class="preprocessor"></span>
<a name="l00145"></a><a class="code" href="sample_8h.html#25befbdbf9fdc57012ce00dcc1756eac">00145</a> <span class="preprocessor">#define PA_SAMPLE_FLOAT32NE PA_SAMPLE_FLOAT32LE</span>
<a name="l00146"></a>00146 <span class="preprocessor"></span>
<a name="l00147"></a><a class="code" href="sample_8h.html#f5b3efe108944c746a07128d9f24c889">00147</a> <span class="preprocessor">#define PA_SAMPLE_S32NE PA_SAMPLE_S32LE</span>
<a name="l00148"></a>00148 <span class="preprocessor"></span>
<a name="l00149"></a><a class="code" href="sample_8h.html#688b20beba239784f7d92b79a626267a">00149</a> <span class="preprocessor">#define PA_SAMPLE_S16RE PA_SAMPLE_S16BE</span>
<a name="l00150"></a>00150 <span class="preprocessor"></span>
<a name="l00151"></a><a class="code" href="sample_8h.html#a07717de5712b215af265b35d9daee78">00151</a> <span class="preprocessor">#define PA_SAMPLE_FLOAT32RE PA_SAMPLE_FLOAT32BE</span>
<a name="l00152"></a>00152 <span class="preprocessor"></span>
<a name="l00153"></a><a class="code" href="sample_8h.html#c9bfd0ece22174acad5eb021ff159a61">00153</a> <span class="preprocessor">#define PA_SAMPLE_S32RE PA_SAMPLE_S32BE</span>
<a name="l00154"></a>00154 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00155"></a>00155 <span class="preprocessor"></span>
<a name="l00157"></a><a class="code" href="sample_8h.html#dce65a384a3af05a2481aff5fd2632fb">00157</a> <span class="preprocessor">#define PA_SAMPLE_FLOAT32 PA_SAMPLE_FLOAT32NE</span>
<a name="l00158"></a>00158 <span class="preprocessor"></span>
<a name="l00160"></a><a class="code" href="structpa__sample__spec.html">00160</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structpa__sample__spec.html" title="A sample format and attribute specification.">pa_sample_spec</a> {
<a name="l00161"></a><a class="code" href="structpa__sample__spec.html#6f37954f1b7ac9d9bff4683171a10a99">00161</a>     <a class="code" href="sample_8h.html#41051ceaa5cfbe60c9b176deb7bfed0e">pa_sample_format_t</a> <a class="code" href="structpa__sample__spec.html#6f37954f1b7ac9d9bff4683171a10a99" title="The sample format.">format</a>;     
<a name="l00162"></a><a class="code" href="structpa__sample__spec.html#4fd5a1ef48c1cbea95a94b20a5cc02b0">00162</a>     uint32_t <a class="code" href="structpa__sample__spec.html#4fd5a1ef48c1cbea95a94b20a5cc02b0" title="The sample rate.">rate</a>;                 
<a name="l00163"></a><a class="code" href="structpa__sample__spec.html#625155d20d7e50a3808b889e314d25fa">00163</a>     uint8_t <a class="code" href="structpa__sample__spec.html#625155d20d7e50a3808b889e314d25fa" title="Audio channels.">channels</a>;              
<a name="l00164"></a>00164 } <a class="code" href="structpa__sample__spec.html" title="A sample format and attribute specification.">pa_sample_spec</a>;
<a name="l00165"></a>00165 
<a name="l00167"></a><a class="code" href="sample_8h.html#885df3b973773f0dccbbec6bc6777f89">00167</a> <span class="keyword">typedef</span> uint64_t <a class="code" href="sample_8h.html#885df3b973773f0dccbbec6bc6777f89" title="Type for usec specifications (unsigned).">pa_usec_t</a>;
<a name="l00168"></a>00168 
<a name="l00170"></a>00170 <span class="keywordtype">size_t</span> <a class="code" href="sample_8h.html#674c3449416e97b71a75feb64ca59ad4" title="Return the amount of bytes playback of a second of audio with the specified sample...">pa_bytes_per_second</a>(<span class="keyword">const</span> <a class="code" href="structpa__sample__spec.html" title="A sample format and attribute specification.">pa_sample_spec</a> *spec) PA_GCC_PURE;
<a name="l00171"></a>00171 
<a name="l00173"></a>00173 <span class="keywordtype">size_t</span> <a class="code" href="sample_8h.html#035d79171e183f6315e6e65436f5e939" title="Return the size of a frame with the specific sample type.">pa_frame_size</a>(<span class="keyword">const</span> <a class="code" href="structpa__sample__spec.html" title="A sample format and attribute specification.">pa_sample_spec</a> *spec) PA_GCC_PURE;
<a name="l00174"></a>00174 
<a name="l00176"></a>00176 <span class="keywordtype">size_t</span> <a class="code" href="sample_8h.html#ae286d84c2975248f65f804d4c24ef39" title="Return the size of a sample with the specific sample type.">pa_sample_size</a>(<span class="keyword">const</span> <a class="code" href="structpa__sample__spec.html" title="A sample format and attribute specification.">pa_sample_spec</a> *spec) PA_GCC_PURE;
<a name="l00177"></a>00177 
<a name="l00179"></a>00179 <a class="code" href="sample_8h.html#885df3b973773f0dccbbec6bc6777f89" title="Type for usec specifications (unsigned).">pa_usec_t</a> <a class="code" href="sample_8h.html#b3c5f4af357686fdc7df46c9581154bd" title="Calculate the time the specified bytes take to play with the specified sample type...">pa_bytes_to_usec</a>(uint64_t length, <span class="keyword">const</span> <a class="code" href="structpa__sample__spec.html" title="A sample format and attribute specification.">pa_sample_spec</a> *spec) PA_GCC_PURE;
<a name="l00180"></a>00180 
<a name="l00182"></a>00182 <span class="keywordtype">size_t</span> <a class="code" href="sample_8h.html#a941cbdb65f1f0265a1d165bc14db034" title="Calculates the number of bytes that are required for the specified time.">pa_usec_to_bytes</a>(<a class="code" href="sample_8h.html#885df3b973773f0dccbbec6bc6777f89" title="Type for usec specifications (unsigned).">pa_usec_t</a> t, <span class="keyword">const</span> <a class="code" href="structpa__sample__spec.html" title="A sample format and attribute specification.">pa_sample_spec</a> *spec) PA_GCC_PURE;
<a name="l00183"></a>00183 
<a name="l00185"></a>00185 <span class="keywordtype">int</span> <a class="code" href="sample_8h.html#0d9ad972ee71ef6bff8aaafd44fdb229" title="Return non-zero when the sample type specification is valid.">pa_sample_spec_valid</a>(<span class="keyword">const</span> <a class="code" href="structpa__sample__spec.html" title="A sample format and attribute specification.">pa_sample_spec</a> *spec) PA_GCC_PURE;
<a name="l00186"></a>00186 
<a name="l00188"></a>00188 <span class="keywordtype">int</span> <a class="code" href="sample_8h.html#c4c2262bf88bd90fc68767e69fb6810c" title="Return non-zero when the two sample type specifications match.">pa_sample_spec_equal</a>(<span class="keyword">const</span> <a class="code" href="structpa__sample__spec.html" title="A sample format and attribute specification.">pa_sample_spec</a>*a, <span class="keyword">const</span> <a class="code" href="structpa__sample__spec.html" title="A sample format and attribute specification.">pa_sample_spec</a>*b) PA_GCC_PURE;
<a name="l00189"></a>00189 
<a name="l00191"></a>00191 <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="sample_8h.html#70804b50d5507f9a7680d4e809e337ed" title="Return a descriptive string for the specified sample format.">pa_sample_format_to_string</a>(<a class="code" href="sample_8h.html#41051ceaa5cfbe60c9b176deb7bfed0e">pa_sample_format_t</a> f) PA_GCC_PURE;
<a name="l00192"></a>00192 
<a name="l00194"></a>00194 <a class="code" href="sample_8h.html#41051ceaa5cfbe60c9b176deb7bfed0e">pa_sample_format_t</a> <a class="code" href="sample_8h.html#2819db448dd45edb5d777b7568dd3236" title="Parse a sample format text.">pa_parse_sample_format</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *format) PA_GCC_PURE;
<a name="l00195"></a>00195 
<a name="l00197"></a><a class="code" href="sample_8h.html#61844a6fa4a5a91bbeca1049c4969bb8">00197</a> <span class="preprocessor">#define PA_SAMPLE_SPEC_SNPRINT_MAX 32</span>
<a name="l00198"></a>00198 <span class="preprocessor"></span>
<a name="l00200"></a>00200 <span class="keywordtype">char</span>* <a class="code" href="sample_8h.html#3dd4815bbd51d5467b40e28d05ad948d" title="Pretty print a sample type specification to a string.">pa_sample_spec_snprint</a>(<span class="keywordtype">char</span> *s, <span class="keywordtype">size_t</span> l, <span class="keyword">const</span> <a class="code" href="structpa__sample__spec.html" title="A sample format and attribute specification.">pa_sample_spec</a> *spec);
<a name="l00201"></a>00201 
<a name="l00203"></a>00203 <span class="keywordtype">char</span>* <a class="code" href="sample_8h.html#4992ec70d79de601c6f8f6cc5cab8e59" title="Pretty print a byte size value.">pa_bytes_snprint</a>(<span class="keywordtype">char</span> *s, <span class="keywordtype">size_t</span> l, <span class="keywordtype">unsigned</span> v);
<a name="l00204"></a>00204 
<a name="l00205"></a>00205 PA_C_DECL_END
<a name="l00206"></a>00206 
<a name="l00207"></a>00207 <span class="preprocessor">#endif</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Wed Mar 26 12:02:40 2008 for PulseAudio by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
</body>
</html>