]> git.sesse.net Git - vlc/blob - doc/developer/audio_output.xml
* Added IDEALX developer documentation into main CVS - PLEASE UPDATE
[vlc] / doc / developer / audio_output.xml
1 <chapter> <title> The audio output layer </title>
2
3   <sect1> <title> Data exchanges between a decoder and the audio output
4   </title>
5
6     <para>
7 The audio output basically takes audio samples from one or several
8 FIFOs, mixes and resamples them, and plays them through the audio
9 chip. Data exchanges are simple and described in <filename>
10 src/audio_output/audio_output.c.</filename> A decoder needs to open
11 a channel FIFO with <function> aout_CreateFifo </function>, and
12 then write the data to the buffer. The buffer is in <parameter>
13 p_aout_fifo-&gt;buffer + p_aout_fifo-&gt;l_end_frame </parameter>
14 * <constant> ADEC_FRAME_SIZE</constant>.
15     </para>
16
17   </sect1>
18
19   <sect1> <title> How to write an audio output plugin </title>
20
21     <para>
22 [This API is subject to change in the very near future.] Have a look at
23 <filename> plugins/dsp/aout_dsp.c</filename>. You need to write six
24 functions :
25     </para>
26
27     <itemizedlist>
28
29       <listitem> <para> <type> int </type> <function> aout_Probe </function>
30       <parameter> ( probedata_t *p_data ) </parameter> :
31       Returns a score between 0 and 999 to tell whether the plugin
32       can be used. <parameter> p_data </parameter> is currently
33       unused.
34       </para> </listitem>
35
36       <listitem> <para> <type> int </type> <function> aout_Open </function>
37       <parameter> ( aout_thread_t *p_aout ) </parameter> :
38       Opens the audio device.
39       </para> </listitem>
40
41       <listitem> <para> <type> int </type> <function> aout_SetFormat
42       </function> <parameter> ( aout_thread_t *p_aout ) </parameter> :
43       Sets the output format, the number of channels, and the output
44       rate.
45       </para> </listitem>
46
47       <listitem> <para> <type> long </type> <function> aout_GetBufInfo
48       </function> <parameter> ( aout_thread_t *p_aout,
49       long l_buffer_limit ) </parameter> :
50       Gets the status of the audio buffer.
51       </para> </listitem>
52
53       <listitem> <para> <function> aout_Play </function> <parameter>
54       ( aout_thread_t *p_aout, byte_t *buffer, int i_size )
55       </parameter> :
56       Writes the audio output buffer to the audio device.
57       </para> </listitem>
58
59       <listitem> <para> <function> aout_Close </function> <parameter>
60       ( aout_thread_t *p_aout ) </parameter> :
61       Closes the audio device.
62       </para> </listitem>
63
64     </itemizedlist>
65
66   </sect1>
67
68 </chapter>