1 /*****************************************************************************
2 * dummy.c : dummy 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 );
46 static void vout_GetPlugin( p_vout_thread_t p_vout );
47 static void intf_GetPlugin( p_intf_thread_t p_intf );
50 int aout_DummyOpen ( aout_thread_t *p_aout );
51 int aout_DummyReset ( aout_thread_t *p_aout );
52 int aout_DummySetFormat ( aout_thread_t *p_aout );
53 int aout_DummySetChannels ( aout_thread_t *p_aout );
54 int aout_DummySetRate ( aout_thread_t *p_aout );
55 long aout_DummyGetBufInfo ( aout_thread_t *p_aout, long l_buffer_info );
56 void aout_DummyPlaySamples ( aout_thread_t *p_aout, byte_t *buffer,
58 void aout_DummyClose ( aout_thread_t *p_aout );
61 int vout_DummyCreate ( vout_thread_t *p_vout, char *psz_display,
62 int i_root_window, void *p_data );
63 int vout_DummyInit ( p_vout_thread_t p_vout );
64 void vout_DummyEnd ( p_vout_thread_t p_vout );
65 void vout_DummyDestroy ( p_vout_thread_t p_vout );
66 int vout_DummyManage ( p_vout_thread_t p_vout );
67 void vout_DummyDisplay ( p_vout_thread_t p_vout );
68 void vout_DummySetPalette ( p_vout_thread_t p_vout,
69 u16 *red, u16 *green, u16 *blue, u16 *transp );
72 int intf_DummyCreate ( p_intf_thread_t p_intf );
73 void intf_DummyDestroy ( p_intf_thread_t p_intf );
74 void intf_DummyManage ( p_intf_thread_t p_intf );
76 /*****************************************************************************
77 * GetConfig: get the plugin structure and configuration
78 *****************************************************************************/
79 plugin_info_t * GetConfig( void )
81 plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
83 p_info->psz_name = "Dummy";
84 p_info->psz_version = VERSION;
85 p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
87 p_info->aout_GetPlugin = aout_GetPlugin;
88 p_info->vout_GetPlugin = vout_GetPlugin;
89 p_info->intf_GetPlugin = intf_GetPlugin;
90 p_info->yuv_GetPlugin = NULL;
92 /* The dummy plugin always works, but should have low priority */
93 p_info->i_score = 0x1;
95 /* If this plugin was requested, score it higher */
96 if( TestMethod( VOUT_METHOD_VAR, "dummy" ) )
98 p_info->i_score += 0x200;
101 /* If this plugin was requested, score it higher */
102 if( TestMethod( AOUT_METHOD_VAR, "dummy" ) )
104 p_info->i_score += 0x200;
111 /*****************************************************************************
112 * Following functions are only called through the p_info structure
113 *****************************************************************************/
115 static void aout_GetPlugin( p_aout_thread_t p_aout )
117 p_aout->p_sys_open = aout_DummyOpen;
118 p_aout->p_sys_reset = aout_DummyReset;
119 p_aout->p_sys_setformat = aout_DummySetFormat;
120 p_aout->p_sys_setchannels = aout_DummySetChannels;
121 p_aout->p_sys_setrate = aout_DummySetRate;
122 p_aout->p_sys_getbufinfo = aout_DummyGetBufInfo;
123 p_aout->p_sys_playsamples = aout_DummyPlaySamples;
124 p_aout->p_sys_close = aout_DummyClose;
127 static void vout_GetPlugin( p_vout_thread_t p_vout )
129 p_vout->p_sys_create = vout_DummyCreate;
130 p_vout->p_sys_init = vout_DummyInit;
131 p_vout->p_sys_end = vout_DummyEnd;
132 p_vout->p_sys_destroy = vout_DummyDestroy;
133 p_vout->p_sys_manage = vout_DummyManage;
134 p_vout->p_sys_display = vout_DummyDisplay;
137 static void intf_GetPlugin( p_intf_thread_t p_intf )
139 p_intf->p_sys_create = intf_DummyCreate;
140 p_intf->p_sys_destroy = intf_DummyDestroy;
141 p_intf->p_sys_manage = intf_DummyManage;