Commit 81292683 authored by Pierre Baillet's avatar Pierre Baillet

My first contribution.

* Added SDL plugin
	* support fullscreen display with --display fullscreen
	* complete keyboard handling
* Added --enable_sdl to configure

Octplane.
parent 617bd4db
Thu Aug 18 00:21:33 BST 2000
0.1.99g :
* added support for the SDL vout : the --display fullscreen allows
fullscreen when possible. Disabled by default.
* added sdlvlc (which probably should start in fullscreen, no ?)
Wed Aug 16 01:07:14 CEST 2000 Wed Aug 16 01:07:14 CEST 2000
0.1.99g : 0.1.99g :
......
...@@ -286,6 +286,10 @@ PLUGIN_GGI = plugins/ggi/ggi.o \ ...@@ -286,6 +286,10 @@ PLUGIN_GGI = plugins/ggi/ggi.o \
plugins/ggi/intf_ggi.o \ plugins/ggi/intf_ggi.o \
plugins/ggi/vout_ggi.o plugins/ggi/vout_ggi.o
PLUGIN_SDL = plugins/sdl/sdl.o \
plugins/sdl/intf_sdl.o \
plugins/sdl/vout_sdl.o
PLUGIN_GLIDE = plugins/glide/glide.o \ PLUGIN_GLIDE = plugins/glide/glide.o \
plugins/glide/intf_glide.o \ plugins/glide/intf_glide.o \
plugins/glide/vout_glide.o plugins/glide/vout_glide.o
...@@ -323,7 +327,8 @@ PLUGIN_YUVMMX = plugins/yuvmmx/yuvmmx.o \ ...@@ -323,7 +327,8 @@ PLUGIN_YUVMMX = plugins/yuvmmx/yuvmmx.o \
PLUGIN_OBJ = $(PLUGIN_BEOS) $(PLUGIN_DSP) $(PLUGIN_DUMMY) $(PLUGIN_ESD) \ PLUGIN_OBJ = $(PLUGIN_BEOS) $(PLUGIN_DSP) $(PLUGIN_DUMMY) $(PLUGIN_ESD) \
$(PLUGIN_FB) $(PLUGIN_GGI) $(PLUGIN_GLIDE) $(PLUGIN_GNOME) \ $(PLUGIN_FB) $(PLUGIN_GGI) $(PLUGIN_GLIDE) $(PLUGIN_GNOME) \
$(PLUGIN_MGA) $(PLUGIN_X11) $(PLUGIN_YUV) $(PLUGIN_YUVMMX) $(PLUGIN_MGA) $(PLUGIN_X11) $(PLUGIN_YUV) $(PLUGIN_YUVMMX) \
$(PLUGIN_SDL)
# #
# Other lists of files # Other lists of files
# #
...@@ -404,7 +409,7 @@ else ...@@ -404,7 +409,7 @@ else
$(CC) $(CCFLAGS) $(LCFLAGS) $(CFLAGS) --export-dynamic -rdynamic -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(CC) $(CCFLAGS) $(LCFLAGS) $(CFLAGS) --export-dynamic -rdynamic -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
endif endif
gvlc xvlc fbvlc: vlc sdlvlc gvlc xvlc fbvlc: vlc
rm -f $@ && ln -s vlc $@ rm -f $@ && ln -s vlc $@
plugins: $(PLUGINS) plugins: $(PLUGINS)
...@@ -484,6 +489,11 @@ lib/ggi.so: $(PLUGIN_GGI) ...@@ -484,6 +489,11 @@ lib/ggi.so: $(PLUGIN_GGI)
$(PLUGIN_GGI): %.o: %.c $(PLUGIN_GGI): %.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $< $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
lib/sdl.so: $(PLUGIN_SDL)
ld -shared -lSDL -o $@ $^
$(PLUGIN_SDL): %.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
lib/yuv.so: $(PLUGIN_YUV) lib/yuv.so: $(PLUGIN_YUV)
ifeq ($(SYS),beos) ifeq ($(SYS),beos)
$(CC) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_ $(CC) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
......
This diff is collapsed.
...@@ -93,6 +93,9 @@ AC_ARG_ENABLE(fb, ...@@ -93,6 +93,9 @@ AC_ARG_ENABLE(fb,
AC_ARG_ENABLE(ggi, AC_ARG_ENABLE(ggi,
[ --enable-ggi GGI support (default disabled)], [ --enable-ggi GGI support (default disabled)],
[if test x$enable_ggi = xyes; then PLUGINS=${PLUGINS}"ggi "; fi]) [if test x$enable_ggi = xyes; then PLUGINS=${PLUGINS}"ggi "; fi])
AC_ARG_ENABLE(sdl,
[ --enable-sdl SDL support (default disabled)],
[if test x$enable_sdl = xyes; then PLUGINS=${PLUGINS}"sdl "; ALIASES=${ALIASES}"sdlvlc ";fi])
AC_ARG_ENABLE(glide, AC_ARG_ENABLE(glide,
[ --enable-glide Glide (3dfx) support (default disabled)], [ --enable-glide Glide (3dfx) support (default disabled)],
[if test x$enable_glide = xyes; then PLUGINS=${PLUGINS}"glide "; fi]) [if test x$enable_glide = xyes; then PLUGINS=${PLUGINS}"glide "; fi])
......
/*****************************************************************************
* intf_sdl.c: SDL interface plugin
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
*
* Authors:
*
* 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
* GNU General Public License for more details.
*
* 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.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "defs.h"
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <SDL/SDL.h> /* for all the SDL stuff */
#include <sys/types.h> /* on BSD, uio.h needs types.h */
#include <sys/uio.h> /* for input.h */
#include "config.h"
#include "common.h"
#include "threads.h"
#include "mtime.h"
#include "plugins.h"
#include "input.h"
#include "video.h"
#include "video_output.h"
#include "interface.h"
#include "intf_msg.h"
#include "main.h"
/*****************************************************************************
* intf_sys_t: description and status of SDL interface
*****************************************************************************/
typedef struct intf_sys_s
{
/* SDL system information */
SDL_Surface * p_display; /* display */
} intf_sys_t;
/*****************************************************************************
* intf_SDLCreate: initialize and create SDL interface
*****************************************************************************/
int intf_SDLCreate( intf_thread_t *p_intf )
{
/* Check that b_video is set */
if( !p_main->b_video )
{
intf_ErrMsg("error: SDL interface require a video output thread\n");
return( 1 );
}
/* Allocate instance and initialize some members */
p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
if( p_intf->p_sys == NULL )
{
intf_ErrMsg("error: %s\n", strerror(ENOMEM) );
return( 1 );
}
/* Spawn video output thread */
p_intf->p_vout = vout_CreateThread( main_GetPszVariable( VOUT_DISPLAY_VAR,
NULL), 0,
main_GetIntVariable( VOUT_WIDTH_VAR,
VOUT_WIDTH_DEFAULT ),
main_GetIntVariable( VOUT_HEIGHT_VAR,
VOUT_HEIGHT_DEFAULT ),
NULL, 0,
(void *)&p_intf->p_sys->p_display );
if( p_intf->p_vout == NULL ) /* error */
{
intf_ErrMsg("error: can't create video output thread\n" );
free( p_intf->p_sys );
return( 1 );
}
return( 0 );
}
/*****************************************************************************
* intf_SDLDestroy: destroy interface
*****************************************************************************/
void intf_SDLDestroy( intf_thread_t *p_intf )
{
/* Close input thread, if any (blocking) */
if( p_intf->p_input )
{
input_DestroyThread( p_intf->p_input, NULL );
}
/* Close video output thread, if any (blocking) */
if( p_intf->p_vout )
{
vout_DestroyThread( p_intf->p_vout, NULL );
}
/* Destroy structure */
SDL_FreeSurface( p_intf->p_sys->p_display ); /* destroy the "screen" */
SDL_Quit();
free( p_intf->p_sys );
}
/*****************************************************************************
* intf_SDLManage: event loop
*****************************************************************************/
void intf_SDLManage( intf_thread_t *p_intf )
{
SDL_Event event; /* SDL event */
Uint8 i_key;
while ( SDL_PollEvent(&event) ) {
switch (event.type) {
case SDL_KEYDOWN: /* if a key is pressed */
i_key = event.key.keysym.sym; /* forward it */
if( intf_ProcessKey( p_intf, (char ) i_key ) )
{
intf_DbgMsg("unhandled key '%c' (%i)\n",
(char) i_key, i_key );
}
break;
case SDL_QUIT:
intf_ProcessKey( p_intf, 'Q' );
break;
default:
break;
}
}
}
/*****************************************************************************
* sdl.c : SDL plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
*
* Authors:
*
* 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
* GNU General Public License for more details.
*
* 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.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "defs.h"
#include <stdlib.h> /* malloc(), free() */
#include "config.h"
#include "common.h" /* boolean_t, byte_t */
#include "threads.h"
#include "mtime.h"
#include "tests.h"
#include "plugins.h"
#include "interface.h"
#include "audio_output.h"
#include "video.h"
#include "video_output.h"
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
static void vout_GetPlugin( p_vout_thread_t p_vout );
static void intf_GetPlugin( p_intf_thread_t p_intf );
/* Video output */
int vout_SDLCreate ( vout_thread_t *p_vout, char *psz_display,
int i_root_window, void *p_data );
int vout_SDLInit ( p_vout_thread_t p_vout );
void vout_SDLEnd ( p_vout_thread_t p_vout );
void vout_SDLDestroy ( p_vout_thread_t p_vout );
int vout_SDLManage ( p_vout_thread_t p_vout );
void vout_SDLDisplay ( p_vout_thread_t p_vout );
void vout_SDLSetPalette ( p_vout_thread_t p_vout,
u16 *red, u16 *green, u16 *blue, u16 *transp );
/* Interface */
int intf_SDLCreate ( p_intf_thread_t p_intf );
void intf_SDLDestroy ( p_intf_thread_t p_intf );
void intf_SDLManage ( p_intf_thread_t p_intf );
/*****************************************************************************
* GetConfig: get the plugin structure and configuration
*****************************************************************************/
plugin_info_t * GetConfig( void )
{
plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
p_info->psz_name = "SDL";
p_info->psz_version = VERSION;
p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
p_info->aout_GetPlugin = NULL;
p_info->vout_GetPlugin = vout_GetPlugin;
p_info->intf_GetPlugin = intf_GetPlugin;
p_info->yuv_GetPlugin = NULL;
/* if the SDL libraries are there, assume we can enter the
* initialization part at least, even if we fail afterwards */
p_info->i_score = 0x100;
if( TestProgram( "sdlvlc" ) )
{
p_info->i_score += 0x180;
}
/* If this plugin was requested, score it higher */
if( TestMethod( VOUT_METHOD_VAR, "sdl" ) )
{
p_info->i_score += 0x200;
}
return( p_info );
}
/*****************************************************************************
* Following functions are only called through the p_info structure
*****************************************************************************/
static void vout_GetPlugin( p_vout_thread_t p_vout )
{
p_vout->p_sys_create = vout_SDLCreate;
p_vout->p_sys_init = vout_SDLInit;
p_vout->p_sys_end = vout_SDLEnd;
p_vout->p_sys_destroy = vout_SDLDestroy;
p_vout->p_sys_manage = vout_SDLManage;
p_vout->p_sys_display = vout_SDLDisplay;
}
static void intf_GetPlugin( p_intf_thread_t p_intf )
{
p_intf->p_sys_create = intf_SDLCreate;
p_intf->p_sys_destroy = intf_SDLDestroy;
p_intf->p_sys_manage = intf_SDLManage;
}
This diff is collapsed.
...@@ -86,17 +86,29 @@ void bank_Init( plugin_bank_t * p_bank ) ...@@ -86,17 +86,29 @@ void bank_Init( plugin_bank_t * p_bank )
psz_filename = TestPlugin( &tmp, name ); \ psz_filename = TestPlugin( &tmp, name ); \
if( psz_filename ) AllocatePlugin( tmp, p_bank, psz_filename ); if( psz_filename ) AllocatePlugin( tmp, p_bank, psz_filename );
/* Arch plugins */
SEEK_PLUGIN( "beos" ); SEEK_PLUGIN( "beos" );
SEEK_PLUGIN( "x11" );
SEEK_PLUGIN( "dsp" ); /* High level Video */
SEEK_PLUGIN( "esd" );
SEEK_PLUGIN( "gnome" ); SEEK_PLUGIN( "gnome" );
SEEK_PLUGIN( "ggi" ); SEEK_PLUGIN( "ggi" );
SEEK_PLUGIN( "sdl" );
/* Low level Video */
SEEK_PLUGIN( "x11" );
SEEK_PLUGIN( "fb" ); SEEK_PLUGIN( "fb" );
SEEK_PLUGIN( "glide" ); SEEK_PLUGIN( "glide" );
SEEK_PLUGIN( "mga" ); SEEK_PLUGIN( "mga" );
/* Video calculus */
SEEK_PLUGIN( "yuvmmx" ); SEEK_PLUGIN( "yuvmmx" );
SEEK_PLUGIN( "yuv" ); SEEK_PLUGIN( "yuv" );
/* Audio pluins */
SEEK_PLUGIN( "dsp" );
SEEK_PLUGIN( "esd" );
/* Dummy plugin */
SEEK_PLUGIN( "dummy" ); SEEK_PLUGIN( "dummy" );
#undef SEEK_PLUGIN #undef SEEK_PLUGIN
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment