]> git.sesse.net Git - vlc/blob - plugins/dummy/intf_dummy.c
Removed flooding debug info :)
[vlc] / plugins / dummy / intf_dummy.c
1 /*****************************************************************************
2  * intf_dummy.c: dummy interface plugin
3  *****************************************************************************
4  * Copyright (C) 2000, 2001 VideoLAN
5  *
6  * Authors: Samuel Hocevar <sam@zoy.org>
7  *
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.
12  * 
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.
17  *
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  *****************************************************************************/
22
23 /*****************************************************************************
24  * Preamble
25  *****************************************************************************/
26 #include "defs.h"
27
28 #include <stdlib.h>                                      /* malloc(), free() */
29
30 #include "config.h"
31 #include "common.h"
32 #include "threads.h"
33 #include "mtime.h"
34 #include "tests.h"
35 #include "modules.h"
36
37 #include "intf_msg.h"
38 #include "interface.h"
39
40 #include "main.h"
41
42 /*****************************************************************************
43  * intf_sys_t: description and status of FB interface
44  *****************************************************************************/
45 typedef struct intf_sys_s
46 {
47
48 } intf_sys_t;
49
50 /*****************************************************************************
51  * Local prototypes.
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 );
57
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 )
63 {
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;
68 }
69
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 )
77 {
78     if( TestMethod( INTF_METHOD_VAR, "dummy" ) )
79     {
80         return( 999 );
81     }
82
83     return( 1 );
84 }
85
86 /*****************************************************************************
87  * intf_Open: initialize dummy interface
88  *****************************************************************************/
89 static int intf_Open( intf_thread_t *p_intf )
90 {
91     /* Allocate instance and initialize some members */
92     p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
93     if( p_intf->p_sys == NULL )
94     {
95         return( 1 );
96     };
97
98     return( 0 );
99 }
100
101 /*****************************************************************************
102  * intf_Close: destroy dummy interface
103  *****************************************************************************/
104 static void intf_Close( intf_thread_t *p_intf )
105 {
106     /* Destroy structure */
107     free( p_intf->p_sys );
108 }
109
110
111 /*****************************************************************************
112  * intf_Run: main loop
113  *****************************************************************************/
114 static void intf_Run( intf_thread_t *p_intf )
115 {
116     while( !p_intf->b_die )
117     {
118         /* Manage core vlc functions through the callback */
119         p_intf->pf_manage( p_intf );
120
121         /* Wait a bit */
122         msleep( INTF_IDLE_SLEEP );
123     }
124 }
125