]> git.sesse.net Git - vlc/blob - plugins/dummy/aout_dummy.c
Fixed a typo in aspect ratio calculation
[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.19 2002/02/15 13:32:53 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 <videolan/vlc.h>
30
31 #include "audio_output.h"                                   /* aout_thread_t */
32
33 /*****************************************************************************
34  * vout_dummy_t: dummy video output method descriptor
35  *****************************************************************************
36  * This structure is part of the video output thread descriptor.
37  * It describes the dummy specific properties of an output thread.
38  *****************************************************************************/
39 typedef struct aout_sys_s
40 {
41     /* Prevent malloc(0) */
42     int i_dummy;
43
44 } aout_sys_t;
45
46 /*****************************************************************************
47  * Local prototypes.
48  *****************************************************************************/
49 static int     aout_Open        ( aout_thread_t *p_aout );
50 static int     aout_SetFormat   ( aout_thread_t *p_aout );
51 static long    aout_GetBufInfo  ( aout_thread_t *p_aout, long l_buffer_info );
52 static void    aout_Play        ( aout_thread_t *p_aout,
53                                   byte_t *buffer, int i_size );
54 static void    aout_Close       ( aout_thread_t *p_aout );
55
56 /*****************************************************************************
57  * Functions exported as capabilities. They are declared as static so that
58  * we don't pollute the namespace too much.
59  *****************************************************************************/
60 void _M( aout_getfunctions )( function_list_t * p_function_list )
61 {
62     p_function_list->functions.aout.pf_open = aout_Open;
63     p_function_list->functions.aout.pf_setformat = aout_SetFormat;
64     p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
65     p_function_list->functions.aout.pf_play = aout_Play;
66     p_function_list->functions.aout.pf_close = aout_Close;
67 }
68
69 /*****************************************************************************
70  * aout_Open: opens a dummy audio device
71  *****************************************************************************/
72 static int aout_Open( aout_thread_t *p_aout )
73 {
74     return( 0 );
75 }
76
77 /*****************************************************************************
78  * aout_SetFormat: pretends to set the dsp output format
79  *****************************************************************************/
80 static int aout_SetFormat( aout_thread_t *p_aout )
81 {
82     return( 0 );
83 }
84
85 /*****************************************************************************
86  * aout_GetBufInfo: returns available bytes in buffer
87  *****************************************************************************/
88 static long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
89 {
90     return( sizeof(s16) * l_buffer_limit + 1 ); /* value big enough to sleep */
91 }
92
93 /*****************************************************************************
94  * aout_Play: pretends to play a sound
95  *****************************************************************************/
96 static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
97 {
98     ;
99 }
100
101 /*****************************************************************************
102  * aout_Close: closes the dummy audio device
103  *****************************************************************************/
104 static void aout_Close( aout_thread_t *p_aout )
105 {
106     ;
107 }
108