1 /*****************************************************************************
2 * esd.c : Esound plugin for vlc
3 *****************************************************************************
4 * Copyright (C) 2000 VideoLAN
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
21 *****************************************************************************/
23 /*****************************************************************************
25 *****************************************************************************/
28 #include <stdlib.h> /* malloc(), free() */
31 #include "common.h" /* boolean_t, byte_t */
37 #include "interface.h"
38 #include "audio_output.h"
40 #include "video_output.h"
42 /*****************************************************************************
44 *****************************************************************************/
45 static void aout_GetPlugin( p_aout_thread_t p_aout );
48 int aout_EsdOpen ( aout_thread_t *p_aout );
49 int aout_EsdReset ( aout_thread_t *p_aout );
50 int aout_EsdSetFormat ( aout_thread_t *p_aout );
51 int aout_EsdSetChannels ( aout_thread_t *p_aout );
52 int aout_EsdSetRate ( aout_thread_t *p_aout );
53 long aout_EsdGetBufInfo ( aout_thread_t *p_aout, long l_buffer_info );
54 void aout_EsdPlaySamples ( aout_thread_t *p_aout, byte_t *buffer,
56 void aout_EsdClose ( aout_thread_t *p_aout );
58 /*****************************************************************************
59 * GetConfig: get the plugin structure and configuration
60 *****************************************************************************/
61 plugin_info_t * GetConfig( void )
63 plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
65 p_info->psz_name = "Esound";
66 p_info->psz_version = VERSION;
67 p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
69 p_info->aout_GetPlugin = aout_GetPlugin;
70 p_info->vout_GetPlugin = NULL;
71 p_info->intf_GetPlugin = NULL;
72 p_info->yuv_GetPlugin = NULL;
74 /* esound should always work, but score it lower than DSP */
75 p_info->i_score = 0x100;
77 /* If this plugin was requested, score it higher */
78 if( TestMethod( AOUT_METHOD_VAR, "esd" ) )
80 p_info->i_score += 0x200;
86 /*****************************************************************************
87 * Following functions are only called through the p_info structure
88 *****************************************************************************/
90 static void aout_GetPlugin( p_aout_thread_t p_aout )
92 p_aout->p_sys_open = aout_EsdOpen;
93 p_aout->p_sys_reset = aout_EsdReset;
94 p_aout->p_sys_setformat = aout_EsdSetFormat;
95 p_aout->p_sys_setchannels = aout_EsdSetChannels;
96 p_aout->p_sys_setrate = aout_EsdSetRate;
97 p_aout->p_sys_getbufinfo = aout_EsdGetBufInfo;
98 p_aout->p_sys_playsamples = aout_EsdPlaySamples;
99 p_aout->p_sys_close = aout_EsdClose;