1 /*****************************************************************************
2 * glide.c : 3dfx Glide plugin for vlc
3 *****************************************************************************
4 * Copyright (C) 2000 VideoLAN
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() */
31 #include <conio.h> /* for glide ? */
36 #include "common.h" /* boolean_t, byte_t */
42 #include "interface.h"
43 #include "audio_output.h"
45 #include "video_output.h"
47 /*****************************************************************************
49 *****************************************************************************/
50 static void vout_GetPlugin( p_vout_thread_t p_vout );
51 static void intf_GetPlugin( p_intf_thread_t p_intf );
54 int vout_GlideCreate ( vout_thread_t *p_vout, char *psz_display,
55 int i_root_window, void *p_data );
56 int vout_GlideInit ( p_vout_thread_t p_vout );
57 void vout_GlideEnd ( p_vout_thread_t p_vout );
58 void vout_GlideDestroy ( p_vout_thread_t p_vout );
59 int vout_GlideManage ( p_vout_thread_t p_vout );
60 void vout_GlideDisplay ( p_vout_thread_t p_vout );
61 void vout_GlideSetPalette ( p_vout_thread_t p_vout,
62 u16 *red, u16 *green, u16 *blue, u16 *transp );
65 int intf_GlideCreate ( p_intf_thread_t p_intf );
66 void intf_GlideDestroy ( p_intf_thread_t p_intf );
67 void intf_GlideManage ( p_intf_thread_t p_intf );
69 /*****************************************************************************
70 * GetConfig: get the plugin structure and configuration
71 *****************************************************************************/
72 plugin_info_t * GetConfig( void )
74 plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
76 p_info->psz_name = "3dfx Glide";
77 p_info->psz_version = VERSION;
78 p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
80 p_info->aout_GetPlugin = NULL;
81 p_info->vout_GetPlugin = vout_GetPlugin;
82 p_info->intf_GetPlugin = intf_GetPlugin;
83 p_info->yuv_GetPlugin = NULL;
85 /* We could do a grSstQueryBoards( GrHwConfiguration *hwConfig ) at
86 * this point, but if the user didn't configure his 3dfx card, we
87 * have great chances to segfault here. So we'd better assume
88 * everything is fine and worry only if we really need to use Glide */
89 p_info->i_score = 0x100;
91 if( TestProgram( "glidevlc" ) )
93 p_info->i_score += 0x180;
96 /* If this plugin was requested, score it higher */
97 if( TestMethod( VOUT_METHOD_VAR, "glide" ) )
99 p_info->i_score += 0x200;
105 /*****************************************************************************
106 * Following functions are only called through the p_info structure
107 *****************************************************************************/
109 static void vout_GetPlugin( p_vout_thread_t p_vout )
111 p_vout->p_sys_create = vout_GlideCreate;
112 p_vout->p_sys_init = vout_GlideInit;
113 p_vout->p_sys_end = vout_GlideEnd;
114 p_vout->p_sys_destroy = vout_GlideDestroy;
115 p_vout->p_sys_manage = vout_GlideManage;
116 p_vout->p_sys_display = vout_GlideDisplay;
119 static void intf_GetPlugin( p_intf_thread_t p_intf )
121 p_intf->p_sys_create = intf_GlideCreate;
122 p_intf->p_sys_destroy = intf_GlideDestroy;
123 p_intf->p_sys_manage = intf_GlideManage;