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 $
7 * Authors: Samuel Hocevar <sam@zoy.org>
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.
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.
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 *****************************************************************************/
24 /*****************************************************************************
26 *****************************************************************************/
32 /*****************************************************************************
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 );
39 /*****************************************************************************
40 * OpenAudio: opens a dummy audio device
41 *****************************************************************************/
42 int E_(OpenAudio) ( vlc_object_t *p_this )
44 aout_thread_t * p_aout = (aout_thread_t *)p_this;
46 p_aout->pf_setformat = SetFormat;
47 p_aout->pf_getbufinfo = GetBufInfo;
48 p_aout->pf_play = Play;
53 /*****************************************************************************
54 * SetFormat: pretends to set the dsp output format
55 *****************************************************************************/
56 static int SetFormat( aout_thread_t *p_aout )
61 /*****************************************************************************
62 * GetBufInfo: returns available bytes in buffer
63 *****************************************************************************/
64 static int GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
66 return( sizeof(s16) * i_buffer_limit + 1 ); /* value big enough to sleep */
69 /*****************************************************************************
70 * Play: pretends to play a sound
71 *****************************************************************************/
72 static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )