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 /*****************************************************************************
25 *****************************************************************************/
28 #include <stdlib.h> /* malloc(), free() */
38 #include "interface.h"
42 /*****************************************************************************
43 * intf_sys_t: description and status of FB interface
44 *****************************************************************************/
45 typedef struct intf_sys_s
50 /*****************************************************************************
52 *****************************************************************************/
53 static int intf_Probe ( probedata_t *p_data );
54 static int intf_Open ( intf_thread_t *p_intf );
55 static void intf_Close ( intf_thread_t *p_intf );
56 static void intf_Run ( intf_thread_t *p_intf );
58 /*****************************************************************************
59 * Functions exported as capabilities. They are declared as static so that
60 * we don't pollute the namespace too much.
61 *****************************************************************************/
62 void intf_getfunctions( function_list_t * p_function_list )
64 p_function_list->pf_probe = intf_Probe;
65 p_function_list->functions.intf.pf_open = intf_Open;
66 p_function_list->functions.intf.pf_close = intf_Close;
67 p_function_list->functions.intf.pf_run = intf_Run;
70 /*****************************************************************************
71 * intf_Probe: probe the interface and return a score
72 *****************************************************************************
73 * This function tries to initialize Gnome and returns a score to the
74 * plugin manager so that it can select the best plugin.
75 *****************************************************************************/
76 static int intf_Probe( probedata_t *p_data )
78 if( TestMethod( INTF_METHOD_VAR, "dummy" ) )
86 /*****************************************************************************
87 * intf_Open: initialize dummy interface
88 *****************************************************************************/
89 static int intf_Open( intf_thread_t *p_intf )
91 /* Allocate instance and initialize some members */
92 p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
93 if( p_intf->p_sys == NULL )
101 /*****************************************************************************
102 * intf_Close: destroy dummy interface
103 *****************************************************************************/
104 static void intf_Close( intf_thread_t *p_intf )
106 /* Destroy structure */
107 free( p_intf->p_sys );
111 /*****************************************************************************
112 * intf_Run: main loop
113 *****************************************************************************/
114 static void intf_Run( intf_thread_t *p_intf )
116 while( !p_intf->b_die )
118 /* Manage core vlc functions through the callback */
119 p_intf->pf_manage( p_intf );
122 msleep( INTF_IDLE_SLEEP );