]> git.sesse.net Git - vlc/blob - plugins/dummy/intf_dummy.c
. no need to add "\n" at the end of intf_*Msg() messages anymore.
[vlc] / plugins / dummy / intf_dummy.c
1 /*****************************************************************************
2  * intf_dummy.c: dummy interface plugin
3  *****************************************************************************
4  * Copyright (C) 2000 VideoLAN
5  *
6  * Authors:
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 "plugins.h"
35
36 #include "stream_control.h"
37 #include "input_ext-intf.h"
38
39 #include "video.h"
40 #include "video_output.h"
41
42 #include "intf_msg.h"
43 #include "interface.h"
44
45 #include "main.h"
46
47 /*****************************************************************************
48  * intf_sys_t: description and status of FB interface
49  *****************************************************************************/
50 typedef struct intf_sys_s
51 {
52
53 } intf_sys_t;
54
55 /*****************************************************************************
56  * intf_DummyCreate: initialize dummy interface
57  *****************************************************************************/
58 int intf_DummyCreate( intf_thread_t *p_intf )
59 {
60     /* Allocate instance and initialize some members */
61     p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
62     if( p_intf->p_sys == NULL )
63     {
64         return( 1 );
65     };
66
67     /* Spawn video output thread */
68     if( p_main->b_video )
69     {
70         p_intf->p_vout = vout_CreateThread( NULL, 0, 0, 0, NULL, 0, NULL );
71         if( p_intf->p_vout == NULL )                                /* error */
72         {
73             intf_ErrMsg("intf error: can't create output thread" );
74             return( 1 );
75         }
76     }
77     return( 0 );
78 }
79
80 /*****************************************************************************
81  * intf_DummyDestroy: destroy dummy interface
82  *****************************************************************************/
83 void intf_DummyDestroy( intf_thread_t *p_intf )
84 {
85     /* Close input thread, if any (blocking) */
86     if( p_intf->p_input )
87     {
88         input_DestroyThread( p_intf->p_input, NULL );
89     }
90
91     /* Close video output thread, if any (blocking) */
92     if( p_intf->p_vout )
93     {
94         vout_DestroyThread( p_intf->p_vout, NULL );
95     }
96
97     /* Destroy structure */
98     free( p_intf->p_sys );
99 }
100
101
102 /*****************************************************************************
103  * intf_DummyManage: event loop
104  *****************************************************************************/
105 void intf_DummyManage( intf_thread_t *p_intf )
106 {
107     ;
108 }
109