]> git.sesse.net Git - vlc/blob - modules/misc/dummy/aout.c
Audio output 3. Expect major breakages.
[vlc] / modules / misc / dummy / aout.c
1 /*****************************************************************************
2  * aout_dummy.c : dummy audio output plugin
3  *****************************************************************************
4  * Copyright (C) 2002 VideoLAN
5  * $Id: aout.c,v 1.2 2002/08/07 21:36:56 massiot Exp $
6  *
7  * Authors: Christophe Massiot <massiot@via.ecp.fr>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  * 
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24 /*****************************************************************************
25  * Preamble
26  *****************************************************************************/
27 #include <string.h>
28 #include <stdlib.h>
29
30 #include <vlc/vlc.h>
31 #include <vlc/aout.h>
32
33 #include "aout_internal.h"
34
35 /*****************************************************************************
36  * Local prototypes.
37  *****************************************************************************/
38 static int     SetFormat   ( aout_instance_t * );
39 static void    Play        ( aout_instance_t *, aout_buffer_t * );
40
41 /*****************************************************************************
42  * OpenAudio: open a dummy audio device
43  *****************************************************************************/
44 int E_(OpenAudio) ( vlc_object_t * p_this )
45 {
46     aout_instance_t * p_aout = (aout_instance_t *)p_this;
47
48     p_aout->output.pf_setformat = SetFormat;
49     p_aout->output.pf_play = Play;
50
51     return VLC_SUCCESS;
52 }
53
54 /*****************************************************************************
55  * SetFormat: pretend to set the dsp output format
56  *****************************************************************************/
57 static int SetFormat( aout_instance_t * p_aout )
58 {
59     p_aout->output.i_nb_samples = 2048;
60     return 0;
61 }
62
63 /*****************************************************************************
64  * Play: pretend to play a sound
65  *****************************************************************************/
66 static void Play( aout_instance_t * p_aout, aout_buffer_t * p_buffer )
67 {
68     aout_BufferFree( p_buffer );
69 }
70