/*****************************************************************************
* svgalib.c : SVGAlib plugin for vlc
*****************************************************************************
- * Copyright (C) 2002 VideoLAN
- * $Id: svgalib.c,v 1.1 2002/08/21 15:10:33 sam Exp $
+ * Copyright (C) 2002 the VideoLAN team
+ * $Id$
*
* Authors: Samuel Hocevar <sam@zoy.org>
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <stdlib.h>
-#include <vlc/vlc.h>
-#include <vlc/vout.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
+#include <vlc_vout.h>
+#include <vlc_interface.h>
#include <vga.h>
#include <vgagl.h>
static int Manage ( vout_thread_t * );
static void Display ( vout_thread_t *, picture_t * );
-static void SetPalette( vout_thread_t *, u16 *, u16 *, u16 * );
+static void SetPalette( vout_thread_t *, uint16_t *, uint16_t *, uint16_t * );
/*****************************************************************************
* Module descriptor
*****************************************************************************/
-vlc_module_begin();
- set_description( _("SVGAlib module") );
- set_capability( "video output", 0 );
- set_callbacks( Create, Destroy );
-vlc_module_end();
+vlc_module_begin ()
+ set_shortname( "SVGAlib" )
+ set_category( CAT_VIDEO )
+ set_subcategory( SUBCAT_VIDEO_VOUT )
+ set_description( N_("SVGAlib video output") )
+ set_capability( "video output", 0 )
+ set_callbacks( Create, Destroy )
+ cannot_unload_broken_library () /* SVGAlib uses atexit() */
+vlc_module_end ()
/*****************************************************************************
* vout_sys_t: video output descriptor
/* Initialize the output structure: RGB with square pixels, whatever
* the input format is, since it's the only format we know */
- p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2');
+ p_vout->output.i_chroma = VLC_CODEC_RGB8;
p_vout->output.pf_setpalette = SetPalette;
p_vout->output.i_width = vga_getxdim();
p_vout->output.i_height = vga_getydim();
break;
}
}
-
+
/* Allocate the picture */
if( p_pic == NULL )
{
return VLC_SUCCESS;
}
- vout_AllocatePicture( p_vout, p_pic, p_vout->output.i_width,
- p_vout->output.i_height,
- p_vout->output.i_chroma );
+ vout_AllocatePicture( p_vout, p_pic, p_vout->output.i_chroma,
+ p_vout->output.i_width, p_vout->output.i_height,
+ p_vout->output.i_aspect * p_vout->output.i_height,
+ VOUT_ASPECT_FACTOR * p_vout->output.i_width );
if( p_pic->i_planes == 0 )
{
if( keyboard_keypressed(SCANCODE_ESCAPE)
|| keyboard_keypressed(SCANCODE_Q ) )
{
- p_vout->p_vlc->b_die = VLC_TRUE;
+ libvlc_Quit( p_vout->p_libvlc );
}
return VLC_SUCCESS;
*****************************************************************************
* TODO: support 8 bits clut (for Mach32 cards and others).
*****************************************************************************/
-static void SetPalette( vout_thread_t *p_vout, u16 *red, u16 *green, u16 *blue )
+static void SetPalette( vout_thread_t *p_vout,
+ uint16_t *red, uint16_t *green, uint16_t *blue )
{
int i = 256;