1 /*****************************************************************************
2 * intf_dummy.c: dummy interface plugin
3 *****************************************************************************
4 * Copyright (C) 2000, 2001 VideoLAN
5 * $Id: intf_dummy.c,v 1.13 2001/12/30 07:09:55 sam Exp $
7 * Authors: Samuel Hocevar <sam@zoy.org>
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.
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.
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 *****************************************************************************/
24 /*****************************************************************************
26 *****************************************************************************/
27 #include <stdlib.h> /* malloc(), free() */
30 #include <videolan/vlc.h>
33 #include "interface.h"
35 /*****************************************************************************
36 * intf_sys_t: description and status of FB interface
37 *****************************************************************************/
38 typedef struct intf_sys_s
40 /* Prevent malloc(0) */
45 /*****************************************************************************
47 *****************************************************************************/
48 static int intf_Probe ( probedata_t *p_data );
49 static int intf_Open ( intf_thread_t *p_intf );
50 static void intf_Close ( intf_thread_t *p_intf );
51 static void intf_Run ( intf_thread_t *p_intf );
53 /*****************************************************************************
54 * Functions exported as capabilities. They are declared as static so that
55 * we don't pollute the namespace too much.
56 *****************************************************************************/
57 void _M( intf_getfunctions )( function_list_t * p_function_list )
59 p_function_list->pf_probe = intf_Probe;
60 p_function_list->functions.intf.pf_open = intf_Open;
61 p_function_list->functions.intf.pf_close = intf_Close;
62 p_function_list->functions.intf.pf_run = intf_Run;
65 /*****************************************************************************
66 * intf_Probe: probe the interface and return a score
67 *****************************************************************************
68 * This function tries to initialize Gnome and returns a score to the
69 * plugin manager so that it can select the best plugin.
70 *****************************************************************************/
71 static int intf_Probe( probedata_t *p_data )
76 /*****************************************************************************
77 * intf_Open: initialize dummy interface
78 *****************************************************************************/
79 static int intf_Open( intf_thread_t *p_intf )
81 /* Allocate instance and initialize some members */
82 p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
83 if( p_intf->p_sys == NULL )
91 /*****************************************************************************
92 * intf_Close: destroy dummy interface
93 *****************************************************************************/
94 static void intf_Close( intf_thread_t *p_intf )
96 /* Destroy structure */
97 free( p_intf->p_sys );
101 /*****************************************************************************
102 * intf_Run: main loop
103 *****************************************************************************/
104 static void intf_Run( intf_thread_t *p_intf )
106 while( !p_intf->b_die )
108 /* Manage core vlc functions through the callback */
109 p_intf->pf_manage( p_intf );
112 msleep( INTF_IDLE_SLEEP );