]> git.sesse.net Git - vlc/blob - plugins/dummy/aout_dummy.c
* ALL: new module API. Makes a few things a lot simpler, and we gain
[vlc] / plugins / dummy / aout_dummy.c
1 /*****************************************************************************
2  * aout_dummy.c : dummy audio output plugin
3  *****************************************************************************
4  * Copyright (C) 2000, 2001 VideoLAN
5  * $Id: aout_dummy.c,v 1.23 2002/07/31 20:56:51 sam Exp $
6  *
7  * Authors: Samuel Hocevar <sam@zoy.org>
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
29 #include <vlc/vlc.h>
30 #include <vlc/aout.h>
31
32 /*****************************************************************************
33  * Local prototypes.
34  *****************************************************************************/
35 static int     SetFormat   ( aout_thread_t * );
36 static int     GetBufInfo  ( aout_thread_t *, int );
37 static void    Play        ( aout_thread_t *, byte_t *, int );
38
39 /*****************************************************************************
40  * OpenAudio: opens a dummy audio device
41  *****************************************************************************/
42 int E_(OpenAudio) ( vlc_object_t *p_this )
43 {
44     aout_thread_t * p_aout = (aout_thread_t *)p_this;
45
46     p_aout->pf_setformat = SetFormat;
47     p_aout->pf_getbufinfo = GetBufInfo;
48     p_aout->pf_play = Play;
49
50     return VLC_SUCCESS;
51 }
52
53 /*****************************************************************************
54  * SetFormat: pretends to set the dsp output format
55  *****************************************************************************/
56 static int SetFormat( aout_thread_t *p_aout )
57 {
58     return( 0 );
59 }
60
61 /*****************************************************************************
62  * GetBufInfo: returns available bytes in buffer
63  *****************************************************************************/
64 static int GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
65 {
66     return( sizeof(s16) * i_buffer_limit + 1 ); /* value big enough to sleep */
67 }
68
69 /*****************************************************************************
70  * Play: pretends to play a sound
71  *****************************************************************************/
72 static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
73 {
74     ;
75 }
76