1 /*****************************************************************************
2 * intf_glide.c: 3dfx interface plugin
3 *****************************************************************************
4 * Copyright (C) 2000 VideoLAN
5 * $Id: intf_glide.c,v 1.6 2001/01/05 18:46:43 massiot Exp $
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 *****************************************************************************/
29 #include <stdlib.h> /* malloc(), free() */
30 #include <linutil.h> /* Glide kbhit() and getch() */
38 #include "stream_control.h"
39 #include "input_ext-intf.h"
42 #include "video_output.h"
45 #include "interface.h"
49 /*****************************************************************************
50 * intf_sys_t: description and status of 3dfx interface
51 *****************************************************************************/
52 typedef struct intf_sys_s
57 /*****************************************************************************
58 * intf_GlideCreate: initialize 3dfx interface
59 *****************************************************************************/
60 int intf_GlideCreate( intf_thread_t *p_intf )
62 /* Allocate instance and initialize some members */
63 p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
64 if( p_intf->p_sys == NULL )
69 /* Spawn video output thread */
72 p_intf->p_vout = vout_CreateThread( NULL, 0, 0, 0, NULL, 0, NULL );
73 if( p_intf->p_vout == NULL ) /* error */
75 intf_ErrMsg("intf error: can't create output thread" );
81 intf_AssignNormalKeys( p_intf );
86 /*****************************************************************************
87 * intf_GlideDestroy: destroy 3dfx interface
88 *****************************************************************************/
89 void intf_GlideDestroy( intf_thread_t *p_intf )
91 /* Close input thread, if any (blocking) */
94 input_DestroyThread( p_intf->p_input, NULL );
97 /* Close video output thread, if any (blocking) */
100 vout_DestroyThread( p_intf->p_vout, NULL );
103 /* Destroy structure */
104 free( p_intf->p_sys );
108 /*****************************************************************************
109 * intf_GlideManage: event loop
110 *****************************************************************************/
111 void intf_GlideManage( intf_thread_t *p_intf )
115 /* very Linux specific - see tlib.c in Glide for other versions */
118 if( intf_ProcessKey(p_intf, (int)buf = getch()) )
120 intf_ErrMsg( "unhandled key '%c' (%i)", (char) buf, buf );