1 /*****************************************************************************
2 * aout_dummy.c : dummy audio output plugin
3 *****************************************************************************
4 * Copyright (C) 2000, 2001 VideoLAN
5 * $Id: aout_dummy.c,v 1.22 2002/07/20 18:01:42 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 /*****************************************************************************
33 * vout_dummy_t: dummy video output method descriptor
34 *****************************************************************************
35 * This structure is part of the video output thread descriptor.
36 * It describes the dummy specific properties of an output thread.
37 *****************************************************************************/
40 /* Prevent malloc(0) */
44 /*****************************************************************************
46 *****************************************************************************/
47 static int aout_Open ( aout_thread_t *p_aout );
48 static int aout_SetFormat ( aout_thread_t *p_aout );
49 static int aout_GetBufInfo ( aout_thread_t *p_aout, int i_buffer_info );
50 static void aout_Play ( aout_thread_t *p_aout,
51 byte_t *buffer, int i_size );
52 static void aout_Close ( aout_thread_t *p_aout );
54 /*****************************************************************************
55 * Functions exported as capabilities. They are declared as static so that
56 * we don't pollute the namespace too much.
57 *****************************************************************************/
58 void _M( aout_getfunctions )( function_list_t * p_function_list )
60 p_function_list->functions.aout.pf_open = aout_Open;
61 p_function_list->functions.aout.pf_setformat = aout_SetFormat;
62 p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
63 p_function_list->functions.aout.pf_play = aout_Play;
64 p_function_list->functions.aout.pf_close = aout_Close;
67 /*****************************************************************************
68 * aout_Open: opens a dummy audio device
69 *****************************************************************************/
70 static int aout_Open( aout_thread_t *p_aout )
75 /*****************************************************************************
76 * aout_SetFormat: pretends to set the dsp output format
77 *****************************************************************************/
78 static int aout_SetFormat( aout_thread_t *p_aout )
83 /*****************************************************************************
84 * aout_GetBufInfo: returns available bytes in buffer
85 *****************************************************************************/
86 static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
88 return( sizeof(s16) * i_buffer_limit + 1 ); /* value big enough to sleep */
91 /*****************************************************************************
92 * aout_Play: pretends to play a sound
93 *****************************************************************************/
94 static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
99 /*****************************************************************************
100 * aout_Close: closes the dummy audio device
101 *****************************************************************************/
102 static void aout_Close( aout_thread_t *p_aout )