1 /*****************************************************************************
2 * intf_dummy.c: dummy interface plugin
3 *****************************************************************************
4 * Copyright (C) 2000, 2001 VideoLAN
6 * Authors: Samuel Hocevar <sam@zoy.org>
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 #define MODULE_NAME dummy
24 #include "modules_inner.h"
26 /*****************************************************************************
28 *****************************************************************************/
31 #include <stdlib.h> /* malloc(), free() */
40 #include "interface.h"
46 /*****************************************************************************
47 * intf_sys_t: description and status of FB interface
48 *****************************************************************************/
49 typedef struct intf_sys_s
54 /*****************************************************************************
56 *****************************************************************************/
57 static int intf_Probe ( probedata_t *p_data );
58 static int intf_Open ( intf_thread_t *p_intf );
59 static void intf_Close ( intf_thread_t *p_intf );
60 static void intf_Run ( intf_thread_t *p_intf );
62 /*****************************************************************************
63 * Functions exported as capabilities. They are declared as static so that
64 * we don't pollute the namespace too much.
65 *****************************************************************************/
66 void _M( intf_getfunctions )( function_list_t * p_function_list )
68 p_function_list->pf_probe = intf_Probe;
69 p_function_list->functions.intf.pf_open = intf_Open;
70 p_function_list->functions.intf.pf_close = intf_Close;
71 p_function_list->functions.intf.pf_run = intf_Run;
74 /*****************************************************************************
75 * intf_Probe: probe the interface and return a score
76 *****************************************************************************
77 * This function tries to initialize Gnome and returns a score to the
78 * plugin manager so that it can select the best plugin.
79 *****************************************************************************/
80 static int intf_Probe( probedata_t *p_data )
82 if( TestMethod( INTF_METHOD_VAR, "dummy" ) )
90 /*****************************************************************************
91 * intf_Open: initialize dummy interface
92 *****************************************************************************/
93 static int intf_Open( intf_thread_t *p_intf )
95 /* Allocate instance and initialize some members */
96 p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
97 if( p_intf->p_sys == NULL )
105 /*****************************************************************************
106 * intf_Close: destroy dummy interface
107 *****************************************************************************/
108 static void intf_Close( intf_thread_t *p_intf )
110 /* Destroy structure */
111 free( p_intf->p_sys );
115 /*****************************************************************************
116 * intf_Run: main loop
117 *****************************************************************************/
118 static void intf_Run( intf_thread_t *p_intf )
120 while( !p_intf->b_die )
122 /* Manage core vlc functions through the callback */
123 p_intf->pf_manage( p_intf );
126 msleep( INTF_IDLE_SLEEP );