Commit 583c6553 authored by Sam Hocevar's avatar Sam Hocevar

  * Ported Glide and MGA plugins to the new module API. MGA never worked,
    so this didn't make it work better.
  * Started thinking about built-in modules, and added some code to
    make it easier eventually.
  * Added Oct in the AUTHORS file.
  * Fixed a mistake in configure.in.
  * All your base are belong to us.
  * Fixed a bug in src/misc/modules which prevented loading modules
    when launched from the Tracker.
  * Fixed a similar bug in src/video_output/video_text.c.
  * BeOS CSS support, thanks to Markus Kuespert <ltlBeBoy@beosmail.com>
    who ported the Linux DVD ioctls. We can now read encrypted DVDs
    under BeOS ! Woohoo.
parent 3bb7a537
......@@ -4,6 +4,7 @@
Olivier Pomel <pomel@via.ecp.fr>
Pierre Baillet <oct@zoy.org>
Jean-Philippe Grimaldi <jeanphi@via.ecp.fr>
Andres Krapf <dae@via.ecp.fr>
Christophe Massiot <massiot@via.ecp.fr>
......@@ -12,7 +13,7 @@
Jean-Marc Dressler <polux@via.ecp.fr>
Gal Hendryckx <jimmy@via.ecp.fr>
Samuel Hocevar <sam@zoy.org
Samuel Hocevar <sam@zoy.org>
Brieuc Jeunhomme <bbp@via.ecp.fr>
Michel Kaempf <maxx@via.ecp.fr>
......
......@@ -8,3 +8,8 @@ Arkadiusz Miskiewicz <misiek@pld.ORG.PL>
* Makefile and configure patches.
Markus Kuespert <ltlBeBoy@beosmail.com>
* BeOS port of the DVD ioctls.
......@@ -32,7 +32,7 @@ Here's a shortcut to copy-paste to do a clean build :
make distclean 2>/dev/null ; ./configure --prefix=/usr --enable-gnome \
--enable-fb --with-glide --with-ggi --with-sdl --enable-esd \
--enable-alsa && make
--enable-alsa --enable-mga && make
Installing and running VideoLAN
......
......@@ -19,6 +19,7 @@ PLUGINS=@PLUGINS@
INSTALL=@INSTALL@
ARCH=@ARCH@
exec_prefix=@exec_prefix@
prefix=@prefix@
bindir=@bindir@
datadir=@datadir@
......@@ -298,9 +299,10 @@ PLUGIN_DUMMY = plugins/dummy/dummy.o \
PLUGIN_DVD = plugins/dvd/dvd.o \
plugins/dvd/input_dvd.o \
plugins/dvd/dvd_ioctl.o \
plugins/dvd/dvd_ifo.o \
plugins/dvd/dvd_udf.o \
plugins/dvd/dvd_css.o
plugins/dvd/dvd_css.o
PLUGIN_ESD = plugins/esd/esd.o \
plugins/esd/aout_esd.o
......@@ -312,7 +314,6 @@ PLUGIN_GGI = plugins/ggi/ggi.o \
plugins/ggi/vout_ggi.o
PLUGIN_GLIDE = plugins/glide/glide.o \
plugins/glide/intf_glide.o \
plugins/glide/vout_glide.o
PLUGIN_GNOME = plugins/gnome/gnome.o \
......@@ -334,7 +335,6 @@ PLUGIN_IDCTMMXEXT = plugins/idct/idctmmxext.o \
plugins/idct/idct_common.o
PLUGIN_MGA = plugins/mga/mga.o \
plugins/mga/intf_mga.o \
plugins/mga/vout_mga.o
PLUGIN_MOTION = plugins/motion/motion.o \
......
......@@ -3471,16 +3471,16 @@ if test "${with_sdl+set}" = set; then
PLUGINS=${PLUGINS}"sdl ";
if test "x$withval" != "xyes";
then
LIB_SDL="-l"$withval
LIB_SDL="L/usr/X11R6/lib -l"$withval
else
LIB_SDL="-lSDL"
LIB_SDL="-L/usr/X11R6/lib -lSDL"
fi
fi
if test "x$withval" == "x";
then
PLUGINS=${PLUGINS}"sdl "
LIB_SDL="-lSDL"
LIB_SDL="-L/usr/X11R6/lib -lSDL"
fi
# Check whether --with-glide or --without-glide was given.
if test "${with_glide+set}" = set; then
......
......@@ -171,7 +171,7 @@ AC_ARG_WITH(sdl,
[ PLUGINS=${PLUGINS}"sdl ";
if test "x$withval" != "xyes";
then
LIB_SDL="L /usr/X11R6/lib -l"$withval
LIB_SDL="L/usr/X11R6/lib -l"$withval
else
LIB_SDL="-L/usr/X11R6/lib -lSDL"
fi ])
......
......@@ -2,7 +2,7 @@ Source: vlc
Section: graphics
Priority: optional
Maintainer: Samuel Hocevar <sam@zoy.org>
Build-Depends: debhelper (>=2.2.0), xlib6g-dev, libgnome-dev, libesd0-dev, libsdl1.1-dev, alsa-headers
Build-Depends: debhelper (>=2.2.0), xlib6g-dev, libgnome-dev, libggi2-dev, libglide-dev, libesd0-dev, libsdl1.1-dev, alsa-headers
Standards-Version: 3.0.1
Package: vlc
......@@ -50,3 +50,18 @@ Description: SDL plugin for the VideoLAN Client
This plugin adds support for the Simple DirectMedia Layer library to
the VideoLAN Client.
Package: vlc-ggi
Architecture: any
Depends: vlc (= ${Source-Version}), ${shlibs:Depends}
Description: GGI plugin for the VideoLAN Client
VideoLAN is a free MPEG, MPEG2 and DVD software solution.
.
This is a GGI plugin for the VideoLAN Client.
Package: vlc-glide
Architecture: i386
Depends: vlc (= ${Source-Version}), libglide2
Description: Glide plugin for the VideoLAN Client
VideoLAN is a free MPEG, MPEG2 and DVD software solution.
.
This is a Glide (3dfx) plugin for the VideoLAN Client.
......@@ -12,11 +12,19 @@ build: build-stamp
build-stamp:
dh_testdir
if [ $(DEB_BUILD_ARCH) = i386 ]; then \
./configure --prefix=/usr \
--mandir=\$${prefix}/share/man \
--infodir=\$${prefix}/share/info \
--enable-gnome \
--with-sdl --enable-esd --enable-alsa --disable-ppro ;
--enable-gnome --enable-fb --with-glide --with-ggi \
--with-sdl --enable-esd --enable-alsa --disable-ppro ; \
else \
./configure --prefix=/usr \
--mandir=\$${prefix}/share/man \
--infodir=\$${prefix}/share/info \
--enable-gnome --enable-fb --with-ggi \
--with-sdl --enable-esd --enable-alsa; \
fi
$(MAKE)
......@@ -37,10 +45,10 @@ install: build
dh_clean -k
dh_installdirs
$(MAKE) install prefix=`pwd`/debian/vlc/usr
DESTDIR=`pwd`/debian/vlc/ $(MAKE) install prefix=/usr
# make symlinks for packages
for alias in gnome esd sdl alsa ; do \
for alias in ggi gnome glide esd sdl alsa ; do \
mkdir -p debian/vlc-$$alias/usr/share/doc/ ; \
ln -s vlc debian/vlc-$$alias/usr/share/doc/vlc-$$alias ; \
mkdir -p debian/vlc-$$alias/usr/lib/videolan/vlc/ ; \
......@@ -73,10 +81,10 @@ binary-arch: build install
# dh_installpam
# dh_installinit
dh_installcron
dh_installmanpages -Nvlc-gnome -Nvlc-esd -Nvlc-sdl -Nvlc-alsa
dh_installmanpages -Nvlc-gnome -Nvlc-ggi -Nvlc-glide -Nvlc-esd -Nvlc-sdl -Nvlc-alsa
dh_installinfo
# dh_undocumented
dh_installchangelogs -Nvlc-gnome -Nvlc-esd -Nvlc-sdl -Nvlc-alsa
dh_installchangelogs -Nvlc-gnome -Nvlc-ggi -Nvlc-glide -Nvlc-esd -Nvlc-sdl -Nvlc-alsa
dh_link
dh_strip
dh_compress
......@@ -84,7 +92,7 @@ binary-arch: build install
# dh_makeshlibs
dh_installdeb
# dh_perl
dh_shlibdeps
dh_shlibdeps -Nvlc-glide
dh_gencontrol
dh_md5sums
dh_builddeb
......
AUTHORS
INSTALL
CONTRIBUTORS
README
TODO
......@@ -46,17 +46,31 @@
/* I can't believe I need to do this to change foo to "foo" */
#define UGLY_KLUDGE( z ) NASTY_CROCK( z )
#define NASTY_CROCK( z ) #z
/* And I need to do _this_ to change foo bar to foo_inner_bar ! */
/* And I need to do _this_ to change foo bar to module_foo_bar ! */
#define AWFUL_BRITTLE( y, z ) CRUDE_HACK( y, z )
#define CRUDE_HACK( y, z ) module_##y##_##z
/* Also, I need to do this to change blah to "VLC_MODULE_foo_blah" */
#define MODULE_STRING UGLY_KLUDGE( MODULE_NAME )
#define MODULE_VAR( z ) "VLC_MODULE_" UGLY_KLUDGE( MODULE_NAME ) "_" #z
#define MODULE_VAR( z ) "VLC_MODULE_" #z
/* If the module is built-in, then we need to define foo_InitModule instead
* of InitModule. Same for Activate- and DeactivateModule. */
#define MODULE_FUNC( function ) AWFUL_BRITTLE( MODULE_NAME, function )
#ifdef BUILTIN
# define _M( function ) AWFUL_BRITTLE( MODULE_NAME, function )
# define MODULE_INIT \
int AWFUL_BRITTLE( MODULE_NAME, InitModule ) ( module_t *p_module )
# define MODULE_ACTIVATE \
int AWFUL_BRITTLE( MODULE_NAME, ActivateModule ) ( module_t *p_module )
# define MODULE_DEACTIVATE \
int AWFUL_BRITTLE( MODULE_NAME, DeactivateModule )( module_t *p_module )
#else
# define _M( function ) function
# define MODULE_INIT int InitModule ( module_t *p_module )
# define MODULE_ACTIVATE int ActivateModule ( module_t *p_module )
# define MODULE_DEACTIVATE int DeactivateModule ( module_t *p_module )
#endif
/* Now the real stuff */
#define MODULE_STRING UGLY_KLUDGE( MODULE_NAME )
/*****************************************************************************
* Macros used to build the configuration structure.
......
......@@ -22,6 +22,7 @@
*****************************************************************************/
#define MODULE_NAME alsa
#include "modules_inner.h"
/*****************************************************************************
* Preamble
......@@ -46,7 +47,6 @@
#include "main.h"
#include "modules.h"
#include "modules_inner.h"
/*****************************************************************************
* Build configuration tree.
......@@ -58,7 +58,7 @@ MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
*****************************************************************************/
extern void aout_getfunctions( function_list_t * p_function_list );
void _M( aout_getfunctions )( function_list_t * p_function_list );
/*****************************************************************************
* InitModule: get the module structure and configuration.
......@@ -68,7 +68,7 @@ extern void aout_getfunctions( function_list_t * p_function_list );
* be unloaded later to save memory, and we want to be able to access this
* data even after the module has been unloaded.
*****************************************************************************/
int InitModule( module_t * p_module )
MODULE_INIT
{
p_module->psz_name = MODULE_STRING;
p_module->psz_longname = "Alsa audio module";
......@@ -87,7 +87,7 @@ int InitModule( module_t * p_module )
* be set to 0 and calls to NeedModule() be made to increment it. To unload
* the module, one has to wait until i_usage == 0 and call DeactivateModule().
*****************************************************************************/
int ActivateModule( module_t * p_module )
MODULE_ACTIVATE
{
p_module->p_functions = malloc( sizeof( module_functions_t ) );
if( p_module->p_functions == NULL )
......@@ -95,7 +95,7 @@ int ActivateModule( module_t * p_module )
return( -1 );
}
aout_getfunctions( &p_module->p_functions->aout );
_M( aout_getfunctions )( &p_module->p_functions->aout );
p_module->p_config = p_config;
......@@ -110,9 +110,10 @@ int ActivateModule( module_t * p_module )
* returns, i_usage can be set to -1 and the module unloaded. Be careful to
* lock usage_lock during the whole process.
*****************************************************************************/
int DeactivateModule( module_t * p_module )
MODULE_DEACTIVATE
{
free( p_module->p_functions );
free( p_module->p_functions );
return( 0 );
return( 0 );
}
......@@ -22,6 +22,7 @@
*****************************************************************************/
#define MODULE_NAME alsa
#include "modules_inner.h"
/*****************************************************************************
* Preamble
......@@ -49,9 +50,6 @@
#include "main.h"
#include "modules.h"
#include "modules_inner.h"
typedef struct alsa_device_s
{
......@@ -85,12 +83,11 @@ static void aout_Play ( aout_thread_t *p_aout,
byte_t *buffer, int i_size );
static void aout_Close ( aout_thread_t *p_aout );
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void aout_getfunctions( function_list_t * p_function_list )
void _M( aout_getfunctions )( function_list_t * p_function_list )
{
p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
......@@ -99,7 +96,6 @@ void aout_getfunctions( function_list_t * p_function_list )
p_function_list->functions.aout.pf_play = aout_Play;
p_function_list->functions.aout.pf_close = aout_Close;
}
/*****************************************************************************
* aout_Probe: probes the audio device and return a score
......
......@@ -2,7 +2,7 @@
* aout_beos.cpp: BeOS audio output
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: aout_beos.cpp,v 1.12 2001/02/18 03:32:02 polux Exp $
* $Id: aout_beos.cpp,v 1.13 2001/02/20 07:49:12 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -22,6 +22,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME beos
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
......@@ -88,7 +91,7 @@ static void aout_Close ( aout_thread_t *p_aout );
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void aout_getfunctions( function_list_t * p_function_list )
void _M( aout_getfunctions )( function_list_t * p_function_list )
{
p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
......
......@@ -22,6 +22,7 @@
*****************************************************************************/
#define MODULE_NAME beos
#include "modules_inner.h"
/*****************************************************************************
* Preamble
......@@ -38,7 +39,6 @@ extern "C"
#include "mtime.h"
#include "modules.h"
#include "modules_inner.h"
/*****************************************************************************
* Build configuration tree.
......@@ -51,9 +51,9 @@ MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
*****************************************************************************/
extern void aout_getfunctions( function_list_t * p_function_list );
extern void vout_getfunctions( function_list_t * p_function_list );
extern void intf_getfunctions( function_list_t * p_function_list );
void _M( aout_getfunctions )( function_list_t * p_function_list );
void _M( vout_getfunctions )( function_list_t * p_function_list );
void _M( intf_getfunctions )( function_list_t * p_function_list );
/*****************************************************************************
* InitModule: get the module structure and configuration.
......@@ -63,7 +63,7 @@ extern void intf_getfunctions( function_list_t * p_function_list );
* be unloaded later to save memory, and we want to be able to access this
* data even after the module has been unloaded.
*****************************************************************************/
int InitModule( module_t * p_module )
MODULE_INIT
{
p_module->psz_name = MODULE_STRING;
p_module->psz_longname = "BeOS standard API module";
......@@ -85,7 +85,7 @@ int InitModule( module_t * p_module )
* be set to 0 and calls to NeedModule() be made to increment it. To unload
* the module, one has to wait until i_usage == 0 and call DeactivateModule().
*****************************************************************************/
int ActivateModule( module_t * p_module )
MODULE_ACTIVATE
{
p_module->p_functions =
( module_functions_t * )malloc( sizeof( module_functions_t ) );
......@@ -94,9 +94,9 @@ int ActivateModule( module_t * p_module )
return( -1 );
}
aout_getfunctions( &p_module->p_functions->aout );
vout_getfunctions( &p_module->p_functions->vout );
intf_getfunctions( &p_module->p_functions->intf );
_M( aout_getfunctions )( &p_module->p_functions->aout );
_M( vout_getfunctions )( &p_module->p_functions->vout );
_M( intf_getfunctions )( &p_module->p_functions->intf );
p_module->p_config = p_config;
......@@ -110,7 +110,7 @@ int ActivateModule( module_t * p_module )
* returns, i_usage can be set to -1 and the module unloaded. Be careful to
* lock usage_lock during the whole process.
*****************************************************************************/
int DeactivateModule( module_t * p_module )
MODULE_DEACTIVATE
{
free( p_module->p_functions );
......
......@@ -2,7 +2,7 @@
* intf_beos.cpp: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: intf_beos.cpp,v 1.9 2001/02/19 03:46:27 sam Exp $
* $Id: intf_beos.cpp,v 1.10 2001/02/20 07:49:12 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -22,6 +22,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME beos
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
......@@ -153,7 +156,7 @@ static void intf_Run ( intf_thread_t *p_intf );
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void intf_getfunctions( function_list_t * p_function_list )
void _M( intf_getfunctions )( function_list_t * p_function_list )
{
p_function_list->pf_probe = intf_Probe;
p_function_list->functions.intf.pf_open = intf_Open;
......
......@@ -21,6 +21,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME beos
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
......@@ -365,7 +368,7 @@ static void BeosCloseDisplay( vout_thread_t *p_vout );
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void vout_getfunctions( function_list_t * p_function_list )
void _M( vout_getfunctions )( function_list_t * p_function_list )
{
p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
......
......@@ -21,6 +21,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME dsp
#include "modules_inner.h"
/* TODO:
*
* - an aout_GetFormats() function
......@@ -90,7 +93,7 @@ static void aout_Close ( aout_thread_t *p_aout );
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void aout_getfunctions( function_list_t * p_function_list )
void _M( aout_getfunctions )( function_list_t * p_function_list )
{
p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
......
......@@ -22,6 +22,7 @@
*****************************************************************************/
#define MODULE_NAME dsp
#include "modules_inner.h"
/*****************************************************************************
* Preamble
......@@ -37,7 +38,6 @@
#include "mtime.h"
#include "modules.h"
#include "modules_inner.h"
/*****************************************************************************
* Build configuration tree.
......@@ -51,7 +51,7 @@ MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
*****************************************************************************/
extern void aout_getfunctions( function_list_t * p_function_list );
void _M( aout_getfunctions )( function_list_t * p_function_list );
/*****************************************************************************
* InitModule: get the module structure and configuration.
......@@ -61,7 +61,7 @@ extern void aout_getfunctions( function_list_t * p_function_list );
* be unloaded later to save memory, and we want to be able to access this
* data even after the module has been unloaded.
*****************************************************************************/
int InitModule( module_t * p_module )
MODULE_INIT
{
p_module->psz_name = MODULE_STRING;
p_module->psz_longname = "Linux OSS /dev/dsp module";
......@@ -81,7 +81,7 @@ int InitModule( module_t * p_module )
* be set to 0 and calls to NeedModule() be made to increment it. To unload
* the module, one has to wait until i_usage == 0 and call DeactivateModule().
*****************************************************************************/
int ActivateModule( module_t * p_module )
MODULE_ACTIVATE
{
p_module->p_functions = malloc( sizeof( module_functions_t ) );
if( p_module->p_functions == NULL )
......@@ -89,7 +89,7 @@ int ActivateModule( module_t * p_module )
return( -1 );
}
aout_getfunctions( &p_module->p_functions->aout );
_M( aout_getfunctions )( &p_module->p_functions->aout );
p_module->p_config = p_config;
......@@ -103,7 +103,7 @@ int ActivateModule( module_t * p_module )
* returns, i_usage can be set to -1 and the module unloaded. Be careful to
* lock usage_lock during the whole process.
*****************************************************************************/
int DeactivateModule( module_t * p_module )
MODULE_DEACTIVATE
{
free( p_module->p_functions );
......
......@@ -20,6 +20,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME dummy
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
......@@ -63,7 +66,7 @@ static void aout_Close ( aout_thread_t *p_aout );
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void aout_getfunctions( function_list_t * p_function_list )
void _M( aout_getfunctions )( function_list_t * p_function_list )
{
p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
......
......@@ -21,6 +21,7 @@
*****************************************************************************/
#define MODULE_NAME dummy
#include "modules_inner.h"
/*****************************************************************************
* Preamble
......@@ -35,7 +36,6 @@
#include "mtime.h"
#include "modules.h"
#include "modules_inner.h"
/*****************************************************************************
* Build configuration tree.
......@@ -48,9 +48,9 @@ MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
*****************************************************************************/
extern void aout_getfunctions( function_list_t * p_function_list );
extern void vout_getfunctions( function_list_t * p_function_list );
extern void intf_getfunctions( function_list_t * p_function_list );
void _M( aout_getfunctions )( function_list_t * p_function_list );
void _M( vout_getfunctions )( function_list_t * p_function_list );
void _M( intf_getfunctions )( function_list_t * p_function_list );
/*****************************************************************************
* InitModule: get the module structure and configuration.
......@@ -60,7 +60,7 @@ extern void intf_getfunctions( function_list_t * p_function_list );
* be unloaded later to save memory, and we want to be able to access this
* data even after the module has been unloaded.
*****************************************************************************/
int InitModule( module_t * p_module )
MODULE_INIT
{
p_module->psz_name = MODULE_STRING;
p_module->psz_longname = "dummy functions module";
......@@ -82,7 +82,7 @@ int InitModule( module_t * p_module )
* be set to 0 and calls to NeedModule() be made to increment it. To unload
* the module, one has to wait until i_usage == 0 and call DeactivateModule().
*****************************************************************************/
int ActivateModule( module_t * p_module )
MODULE_ACTIVATE
{
p_module->p_functions = malloc( sizeof( module_functions_t ) );
if( p_module->p_functions == NULL )
......@@ -90,9 +90,9 @@ int ActivateModule( module_t * p_module )
return( -1 );
}
aout_getfunctions( &p_module->p_functions->aout );
vout_getfunctions( &p_module->p_functions->vout );
intf_getfunctions( &p_module->p_functions->intf );
_M( aout_getfunctions )( &p_module->p_functions->aout );
_M( vout_getfunctions )( &p_module->p_functions->vout );
_M( intf_getfunctions )( &p_module->p_functions->intf );
p_module->p_config = p_config;
......@@ -106,7 +106,7 @@ int ActivateModule( module_t * p_module )
* returns, i_usage can be set to -1 and the module unloaded. Be careful to
* lock usage_lock during the whole process.
*****************************************************************************/
int DeactivateModule( module_t * p_module )
MODULE_DEACTIVATE
{
free( p_module->p_functions );
......
......@@ -20,6 +20,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME dummy
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
......@@ -32,11 +35,12 @@
#include "threads.h"
#include "mtime.h"
#include "tests.h"
#include "modules.h"
#include "intf_msg.h"
#include "interface.h"
#include "modules.h"
#include "main.h"
/*****************************************************************************
......@@ -59,7 +63,7 @@ static void intf_Run ( intf_thread_t *p_intf );
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void intf_getfunctions( function_list_t * p_function_list )
void _M( intf_getfunctions )( function_list_t * p_function_list )
{
p_function_list->pf_probe = intf_Probe;
p_function_list->functions.intf.pf_open = intf_Open;
......
......@@ -20,6 +20,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME dummy
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
......@@ -34,13 +37,14 @@
#include "threads.h"
#include "mtime.h"
#include "tests.h"
#include "modules.h"
#include "video.h"
#include "video_output.h"
#include "intf_msg.h"
#include "modules.h"
#define DUMMY_WIDTH 16
#define DUMMY_HEIGHT 16
#define DUMMY_BITS_PER_PLANE 16
......@@ -75,7 +79,7 @@ static void vout_Display ( struct vout_thread_s * );
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void vout_getfunctions( function_list_t * p_function_list )
void _M( vout_getfunctions )( function_list_t * p_function_list )
{
p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
......
......@@ -21,6 +21,7 @@
*****************************************************************************/
#define MODULE_NAME dvd
#include "modules_inner.h"
/*****************************************************************************
* Preamble
......@@ -36,7 +37,6 @@
#include "mtime.h"
#include "modules.h"
#include "modules_inner.h"
/*****************************************************************************
* Build configuration tree.
......@@ -49,7 +49,7 @@ MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
*****************************************************************************/
extern void input_getfunctions( function_list_t * p_function_list );
void _M( input_getfunctions )( function_list_t * p_function_list );
/*****************************************************************************
* InitModule: get the module structure and configuration.
......@@ -59,7 +59,7 @@ extern void input_getfunctions( function_list_t * p_function_list );
* be unloaded later to save memory, and we want to be able to access this
* data even after the module has been unloaded.
*****************************************************************************/
int InitModule( module_t * p_module )
MODULE_INIT
{
p_module->psz_name = MODULE_STRING;
p_module->psz_longname = "DVD input module";
......@@ -79,7 +79,7 @@ int InitModule( module_t * p_module )
* be set to 0 and calls to NeedModule() be made to increment it. To unload
* the module, one has to wait until i_usage == 0 and call DeactivateModule().
*****************************************************************************/
int ActivateModule( module_t * p_module )
MODULE_ACTIVATE
{
p_module->p_functions = malloc( sizeof( module_functions_t ) );
if( p_module->p_functions == NULL )
......@@ -87,7 +87,7 @@ int ActivateModule( module_t * p_module )
return( -1 );
}
input_getfunctions( &p_module->p_functions->input );
_M( input_getfunctions )( &p_module->p_functions->input );
p_module->p_config = p_config;
......@@ -101,7 +101,7 @@ int ActivateModule( module_t * p_module )
* returns, i_usage can be set to -1 and the module unloaded. Be careful to
* lock usage_lock during the whole process.
*****************************************************************************/
int DeactivateModule( module_t * p_module )
MODULE_DEACTIVATE
{
free( p_module->p_functions );
......
......@@ -2,7 +2,7 @@
* dvd_css.c: Functions for DVD authentification and unscrambling
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_css.c,v 1.11 2001/02/20 02:53:13 stef Exp $
* $Id: dvd_css.c,v 1.12 2001/02/20 07:49:12 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -34,7 +34,7 @@
*****************************************************************************/
#include "defs.h"
#if defined( HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD )
#if defined( HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD ) || defined( SYS_BEOS )
#include <stdio.h>
#include <unistd.h>
......@@ -52,9 +52,13 @@
#endif
#include "common.h"
#include "intf_msg.h"
#include "dvd_css.h"
#include "dvd_ioctl.h"
#include "dvd_ifo.h"
#include "input_dvd.h"
/*****************************************************************************
......@@ -428,7 +432,7 @@ static int CSSGetASF( int i_fd )
for( auth_info.lsasf.agid = 0 ; auth_info.lsasf.agid < 4 ;
auth_info.lsasf.agid++ )
{
if( !( ioctl( i_fd, DVD_AUTH, &auth_info ) ) )
if( !( dvd_ioctl( i_fd, DVD_AUTH, &auth_info ) ) )
{
intf_WarnMsg( 3, "CSS: %sAuthenticated",
( auth_info.lsasf.asf ) ? "" : "not " );
......@@ -795,7 +799,7 @@ int CSSTest( int i_fd )
dvd.type = DVD_STRUCT_COPYRIGHT;
dvd.copyright.layer_num = 0;
if( ioctl( i_fd, DVD_READ_STRUCT, &dvd ) < 0 )
if( dvd_ioctl( i_fd, DVD_READ_STRUCT, &dvd ) < 0 )
{
intf_ErrMsg( "DVD ioctl error" );
return -1;
......@@ -844,7 +848,7 @@ css_t CSSInit( int i_fd )
intf_WarnMsg( 3, "CSS: Request AGID %d", i );
auth_info.type = DVD_LU_SEND_AGID;
auth_info.lsa.agid = 0;
i_error = ioctl( i_fd, DVD_AUTH, &auth_info );
i_error = dvd_ioctl( i_fd, DVD_AUTH, &auth_info );
if( i_error != -1 )
{
/* No error during ioctl: we know if device
......@@ -855,7 +859,7 @@ css_t CSSInit( int i_fd )
intf_ErrMsg( "CSS: AGID N/A, invalidating" );
auth_info.type = DVD_INVALIDATE_AGID;
auth_info.lsa.agid = 0;
ioctl( i_fd, DVD_AUTH, &auth_info );
dvd_ioctl( i_fd, DVD_AUTH, &auth_info );
}
/* Unable to authenticate without AGID */
......@@ -883,7 +887,7 @@ css_t CSSInit( int i_fd )
css.i_agid = auth_info.lsa.agid;
/* Send challenge to LU */
if( ioctl( i_fd, DVD_AUTH, &auth_info )<0 )
if( dvd_ioctl( i_fd, DVD_AUTH, &auth_info )<0 )
{
intf_ErrMsg( "CSS: Send challenge to LU failed ");
css.b_error = 1;
......@@ -891,7 +895,7 @@ css_t CSSInit( int i_fd )
}
/* Get key1 from LU */
if( ioctl( i_fd, DVD_AUTH, &auth_info ) < 0)
if( dvd_ioctl( i_fd, DVD_AUTH, &auth_info ) < 0)
{
intf_ErrMsg( "CSS: Get key1 from LU failed ");
css.b_error = 1;
......@@ -928,7 +932,7 @@ css_t CSSInit( int i_fd )
}
/* Get challenge from LU */
if( ioctl( i_fd, DVD_AUTH, &auth_info ) < 0 )
if( dvd_ioctl( i_fd, DVD_AUTH, &auth_info ) < 0 )
{
intf_ErrMsg( "CSS: Get challenge from LU failed ");
css.b_error = 1;
......@@ -953,7 +957,7 @@ css_t CSSInit( int i_fd )
/* Returning data, let LU change state */
/* Send key2 to LU */
if( ioctl( i_fd, DVD_AUTH, &auth_info ) < 0 )
if( dvd_ioctl( i_fd, DVD_AUTH, &auth_info ) < 0 )
{
intf_ErrMsg( "CSS: Send key2 to LU failed (expected)" );
return css;
......@@ -999,7 +1003,7 @@ css_t CSSInit( int i_fd )
dvd.disckey.agid = css.i_agid;
memset( dvd.disckey.value, 0, 2048 );
if( ioctl( i_fd, DVD_READ_STRUCT, &dvd ) < 0 )
if( dvd_ioctl( i_fd, DVD_READ_STRUCT, &dvd ) < 0 )
{
intf_ErrMsg( "CSS: Could not read Disc Key" );
css.b_error = 1;
......
......@@ -2,7 +2,7 @@
* dvd_ifo.c: Functions for ifo parsing
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_ifo.c,v 1.12 2001/02/20 02:56:50 stef Exp $
* $Id: dvd_ifo.c,v 1.13 2001/02/20 07:49:12 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -39,6 +39,7 @@
#include "intf_msg.h"
#include "dvd_ifo.h"
#include "dvd_udf.h"
#include "dvd_css.h"
#include "input_dvd.h"
/*
......
This diff is collapsed.
This diff is collapsed.
......@@ -5,7 +5,7 @@
* contains the basic udf handling functions
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: dvd_udf.c,v 1.2 2001/02/18 01:42:05 stef Exp $
* $Id: dvd_udf.c,v 1.3 2001/02/20 07:49:12 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -26,6 +26,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME dvd
#include "modules_inner.h"
/*
* Preamble
*/
......
......@@ -10,7 +10,7 @@
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_dvd.c,v 1.15 2001/02/20 02:53:13 stef Exp $
* $Id: input_dvd.c,v 1.16 2001/02/20 07:49:12 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -29,6 +29,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME dvd
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
......@@ -78,7 +81,7 @@
*****************************************************************************/
static struct
{
char p_code[3];
char p_code[3];
char p_lang_long[20];
} lang_tbl[] =
{
......@@ -248,7 +251,7 @@ static int DVDRewind ( struct input_thread_s * );
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void input_getfunctions( function_list_t * p_function_list )
void _M( input_getfunctions )( function_list_t * p_function_list )
{
#define input p_function_list->functions.input
p_function_list->pf_probe = DVDProbe;
......@@ -329,7 +332,7 @@ static int DVDProbe( probedata_t *p_data )
*****************************************************************************/
static int DVDCheckCSS( input_thread_t * p_input )
{
#if defined( HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD )
#if defined( HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD ) || defined( SYS_BEOS )
return CSSTest( p_input->i_handle );
#else
/* DVD ioctls unavailable.
......@@ -370,7 +373,7 @@ static int DVDSetArea( input_thread_t * p_input,
IfoReadVTS( &(p_method->ifo) );
intf_WarnMsg( 2, "Ifo: VTS initialized" );
#if defined( HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD )
#if defined( HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD ) || defined( SYS_BEOS )
if( p_method->b_encrypted )
{
p_method->css.i_title = i_title;
......@@ -664,7 +667,7 @@ static void DVDInit( input_thread_t * p_input )
if( p_method->b_encrypted )
{
#if defined( HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD )
#if defined( HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD ) || defined( SYS_BEOS )
p_method->css = CSSInit( p_input->i_handle );
if( ( p_input->b_error = p_method->css.b_error ) )
......@@ -771,7 +774,7 @@ static int DVDRead( input_thread_t * p_input,
/* Reads from DVD */
readv( p_input->i_handle, p_vec, p_method->i_read_once );
#if defined( HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD )
#if defined( HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD ) || defined( SYS_BEOS )
if( p_method->b_encrypted )
{
for( i=0 ; i<p_method->i_read_once ; i++ )
......
......@@ -40,7 +40,7 @@ typedef struct thread_dvd_data_s
int i_end_cell;
/* Scrambling Information */
#if defined( HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD )
#if defined( HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD ) || defined( SYS_BEOS )
struct css_s css;
#endif
......@@ -60,7 +60,7 @@ void IfoEnd( ifo_t * );
/*****************************************************************************
* Prototypes in dvd_css.c
*****************************************************************************/
#if defined( HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD )
#if defined( HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD ) || defined( SYS_BEOS )
int CSSTest ( int );
struct css_s CSSInit ( int );
int CSSGetKey ( struct css_s * );
......
......@@ -20,6 +20,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME esd
#include "modules_inner.h"
/* TODO:
*
* - use the libesd function to get latency when it's not buggy anymore
......@@ -80,7 +83,7 @@ static void aout_Close ( aout_thread_t *p_aout );
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void aout_getfunctions( function_list_t * p_function_list )
void _M( aout_getfunctions )( function_list_t * p_function_list )
{
p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
......
......@@ -21,6 +21,7 @@
*****************************************************************************/
#define MODULE_NAME esd
#include "modules_inner.h"
/*****************************************************************************
* Preamble
......@@ -36,7 +37,6 @@
#include "mtime.h"
#include "modules.h"
#include "modules_inner.h"
/*****************************************************************************
* Build configuration tree.
......@@ -50,7 +50,7 @@ MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
*****************************************************************************/
extern void aout_getfunctions( function_list_t * p_function_list );
void _M( aout_getfunctions )( function_list_t * p_function_list );
/*****************************************************************************
* InitModule: get the module structure and configuration.
......@@ -60,7 +60,7 @@ extern void aout_getfunctions( function_list_t * p_function_list );
* be unloaded later to save memory, and we want to be able to access this
* data even after the module has been unloaded.
*****************************************************************************/
int InitModule( module_t * p_module )
MODULE_INIT
{
p_module->psz_name = MODULE_STRING;
p_module->psz_longname = "EsounD audio module";
......@@ -80,7 +80,7 @@ int InitModule( module_t * p_module )
* be set to 0 and calls to NeedModule() be made to increment it. To unload
* the module, one has to wait until i_usage == 0 and call DeactivateModule().
*****************************************************************************/
int ActivateModule( module_t * p_module )
MODULE_ACTIVATE
{
p_module->p_functions = malloc( sizeof( module_functions_t ) );
if( p_module->p_functions == NULL )
......@@ -88,7 +88,7 @@ int ActivateModule( module_t * p_module )
return( -1 );
}
aout_getfunctions( &p_module->p_functions->aout );
_M( aout_getfunctions )( &p_module->p_functions->aout );
p_module->p_config = p_config;
......@@ -102,7 +102,7 @@ int ActivateModule( module_t * p_module )
* returns, i_usage can be set to -1 and the module unloaded. Be careful to
* lock usage_lock during the whole process.
*****************************************************************************/
int DeactivateModule( module_t * p_module )
MODULE_DEACTIVATE
{
free( p_module->p_functions );
......
......@@ -21,6 +21,7 @@
*****************************************************************************/
#define MODULE_NAME fb
#include "modules_inner.h"
/*****************************************************************************
* Preamble
......@@ -38,7 +39,6 @@
#include "video_output.h"
#include "modules.h"
#include "modules_inner.h"
/*****************************************************************************
* Building configuration tree
......@@ -51,7 +51,7 @@ MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
******************************************************************************/
extern void vout_getfunctions( function_list_t * p_function_list );
void _M( vout_getfunctions )( function_list_t * p_function_list );
/*****************************************************************************
* InitModule: get the module structure and configuration.
......@@ -61,7 +61,7 @@ extern void vout_getfunctions( function_list_t * p_function_list );
* be unloaded later to save memory, and we want to be able to access this
* data even after the module has been unloaded.
*****************************************************************************/
int InitModule( module_t * p_module )
MODULE_INIT
{
p_module->psz_name = MODULE_STRING;
p_module->psz_longname = "Linux console framebuffer module";
......@@ -81,7 +81,7 @@ int InitModule( module_t * p_module )
* be set to 0 and calls to NeedModule() be made to increment it. To unload
* the module, one has to wait until i_usage == 0 and call DeactivateModule().
*****************************************************************************/
int ActivateModule( module_t * p_module )
MODULE_ACTIVATE
{
p_module->p_functions = malloc( sizeof( module_functions_t ) );
if( p_module->p_functions == NULL )
......@@ -89,7 +89,7 @@ int ActivateModule( module_t * p_module )
return( -1 );
}
vout_getfunctions( &p_module->p_functions->vout );
_M( vout_getfunctions )( &p_module->p_functions->vout );
p_module->p_config = p_config;
......@@ -103,7 +103,7 @@ int ActivateModule( module_t * p_module )
* returns, i_usage can be set to -1 and the module unloaded. Be careful to
* lock usage_lock during the whole process.
*****************************************************************************/
int DeactivateModule( module_t * p_module )
MODULE_DEACTIVATE
{
free( p_module->p_functions );
......
......@@ -20,6 +20,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME fb
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
......@@ -107,7 +110,7 @@ static void FBGfxMode ( int i_tty_dev );
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void vout_getfunctions( function_list_t * p_function_list )
void _M( vout_getfunctions )( function_list_t * p_function_list )
{
p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
......
......@@ -21,6 +21,7 @@
*****************************************************************************/
#define MODULE_NAME ggi
#include "modules_inner.h"
/*****************************************************************************
* Preamble
......@@ -38,7 +39,6 @@
#include "video_output.h"
#include "modules.h"
#include "modules_inner.h"
/*****************************************************************************
* Building configuration tree
......@@ -51,7 +51,7 @@ MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
******************************************************************************/
extern void vout_getfunctions( function_list_t * p_function_list );
void _M( vout_getfunctions )( function_list_t * p_function_list );
/*****************************************************************************
* InitModule: get the module structure and configuration.
......@@ -61,7 +61,7 @@ extern void vout_getfunctions( function_list_t * p_function_list );
* be unloaded later to save memory, and we want to be able to access this
* data even after the module has been unloaded.
*****************************************************************************/
int InitModule( module_t * p_module )
MODULE_INIT
{
p_module->psz_name = MODULE_STRING;
p_module->psz_longname = "General Graphics Interface module";
......@@ -81,7 +81,7 @@ int InitModule( module_t * p_module )
* be set to 0 and calls to NeedModule() be made to increment it. To unload
* the module, one has to wait until i_usage == 0 and call DeactivateModule().
*****************************************************************************/
int ActivateModule( module_t * p_module )
MODULE_ACTIVATE
{
p_module->p_functions = malloc( sizeof( module_functions_t ) );
if( p_module->p_functions == NULL )
......@@ -89,7 +89,7 @@ int ActivateModule( module_t * p_module )
return( -1 );
}
vout_getfunctions( &p_module->p_functions->vout );
_M( vout_getfunctions )( &p_module->p_functions->vout );
p_module->p_config = p_config;
......@@ -103,7 +103,7 @@ int ActivateModule( module_t * p_module )
* returns, i_usage can be set to -1 and the module unloaded. Be careful to
* lock usage_lock during the whole process.
*****************************************************************************/
int DeactivateModule( module_t * p_module )
MODULE_DEACTIVATE
{
free( p_module->p_functions );
......
......@@ -21,6 +21,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME ggi
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
......@@ -81,7 +84,7 @@ static void GGICloseDisplay( vout_thread_t *p_vout );
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void vout_getfunctions( function_list_t * p_function_list )
void _M( vout_getfunctions )( function_list_t * p_function_list )
{
p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
......
/*****************************************************************************
* glide.c : 3dfx Glide plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* Copyright (C) 2000, 2001 VideoLAN
*
* Authors:
* 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
......@@ -20,6 +20,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME glide
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
......@@ -27,99 +30,83 @@
#include <stdlib.h> /* malloc(), free() */
#ifndef __linux__
#include <conio.h> /* for glide ? */
#endif
#include <glide.h>
#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"
#include "modules.h"
/*****************************************************************************
* Exported prototypes
* Building configuration tree
*****************************************************************************/
static void vout_GetPlugin( p_vout_thread_t p_vout );
static void intf_GetPlugin( p_intf_thread_t p_intf );
/* Video output */
int vout_GlideCreate ( vout_thread_t *p_vout, char *psz_display,
int i_root_window, void *p_data );
int vout_GlideInit ( p_vout_thread_t p_vout );
void vout_GlideEnd ( p_vout_thread_t p_vout );
void vout_GlideDestroy ( p_vout_thread_t p_vout );
int vout_GlideManage ( p_vout_thread_t p_vout );
void vout_GlideDisplay ( p_vout_thread_t p_vout );
void vout_GlideSetPalette ( p_vout_thread_t p_vout,
u16 *red, u16 *green, u16 *blue, u16 *transp );
/* Interface */
int intf_GlideCreate ( p_intf_thread_t p_intf );
void intf_GlideDestroy ( p_intf_thread_t p_intf );
void intf_GlideManage ( p_intf_thread_t p_intf );
MODULE_CONFIG_START
ADD_WINDOW( "Configuration for Glide module" )
ADD_COMMENT( "For now, the Glide module cannot be configured" )
MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
******************************************************************************/
void _M( vout_getfunctions )( function_list_t * p_function_list );
/*****************************************************************************
* GetConfig: get the plugin structure and configuration
* InitModule: get the module structure and configuration.
*****************************************************************************
* We have to fill psz_name, psz_longname and psz_version. These variables
* will be strdup()ed later by the main application because the module can
* be unloaded later to save memory, and we want to be able to access this
* data even after the module has been unloaded.
*****************************************************************************/
plugin_info_t * GetConfig( void )
MODULE_INIT
{
plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
p_info->psz_name = "3dfx Glide";
p_info->psz_version = VERSION;
p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
p_module->psz_name = MODULE_STRING;
p_module->psz_longname = "3dfx Glide module";
p_module->psz_version = VERSION;
p_info->aout_GetPlugin = NULL;
p_info->vout_GetPlugin = vout_GetPlugin;
p_info->intf_GetPlugin = intf_GetPlugin;
p_info->yuv_GetPlugin = NULL;
p_module->i_capabilities = MODULE_CAPABILITY_NULL
| MODULE_CAPABILITY_VOUT;
/* We could do a grSstQueryBoards( GrHwConfiguration *hwConfig ) at
* this point, but if the user didn't configure his 3dfx card, we
* have great chances to segfault here. So we'd better assume
* everything is fine and worry only if we really need to use Glide */
p_info->i_score = 0x100;
return( 0 );
}
if( TestProgram( "glidevlc" ) )
/*****************************************************************************
* ActivateModule: set the module to an usable state.
*****************************************************************************
* This function fills the capability functions and the configuration
* structure. Once ActivateModule() has been called, the i_usage can
* be set to 0 and calls to NeedModule() be made to increment it. To unload
* the module, one has to wait until i_usage == 0 and call DeactivateModule().
*****************************************************************************/
MODULE_ACTIVATE
{
p_module->p_functions = malloc( sizeof( module_functions_t ) );
if( p_module->p_functions == NULL )
{
p_info->i_score += 0x180;
return( -1 );
}
/* If this plugin was requested, score it higher */
if( TestMethod( VOUT_METHOD_VAR, "glide" ) )
{
p_info->i_score += 0x200;
}
_M( vout_getfunctions )( &p_module->p_functions->vout );
p_module->p_config = p_config;
return( p_info );
return( 0 );
}
/*****************************************************************************
* Following functions are only called through the p_info structure
* DeactivateModule: make sure the module can be unloaded.
*****************************************************************************
* This function must only be called when i_usage == 0. If it successfully
* returns, i_usage can be set to -1 and the module unloaded. Be careful to
* lock usage_lock during the whole process.
*****************************************************************************/
static void vout_GetPlugin( p_vout_thread_t p_vout )
MODULE_DEACTIVATE
{
p_vout->p_sys_create = vout_GlideCreate;
p_vout->p_sys_init = vout_GlideInit;
p_vout->p_sys_end = vout_GlideEnd;
p_vout->p_sys_destroy = vout_GlideDestroy;
p_vout->p_sys_manage = vout_GlideManage;
p_vout->p_sys_display = vout_GlideDisplay;
}
free( p_module->p_functions );
static void intf_GetPlugin( p_intf_thread_t p_intf )
{
p_intf->p_sys_create = intf_GlideCreate;
p_intf->p_sys_destroy = intf_GlideDestroy;
p_intf->p_sys_manage = intf_GlideManage;
return( 0 );
}
/*****************************************************************************
* intf_glide.c: 3dfx interface plugin
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: intf_glide.c,v 1.6 2001/01/05 18:46:43 massiot Exp $
*
* 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 <linutil.h> /* Glide kbhit() and getch() */
#include "config.h"
#include "common.h"
#include "threads.h"
#include "mtime.h"
#include "plugins.h"
#include "stream_control.h"
#include "input_ext-intf.h"
#include "video.h"
#include "video_output.h"
#include "intf_msg.h"
#include "interface.h"
#include "main.h"
/*****************************************************************************
* intf_sys_t: description and status of 3dfx interface
*****************************************************************************/
typedef struct intf_sys_s
{
} intf_sys_t;
/*****************************************************************************
* intf_GlideCreate: initialize 3dfx interface
*****************************************************************************/
int intf_GlideCreate( intf_thread_t *p_intf )
{
/* Allocate instance and initialize some members */
p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
if( p_intf->p_sys == NULL )
{
return( 1 );
};
/* Spawn video output thread */
if( p_main->b_video )
{
p_intf->p_vout = vout_CreateThread( NULL, 0, 0, 0, NULL, 0, NULL );
if( p_intf->p_vout == NULL ) /* error */
{
intf_ErrMsg("intf error: can't create output thread" );
return( 1 );
}
}
/* bind keys */
intf_AssignNormalKeys( p_intf );
return( 0 );
}
/*****************************************************************************
* intf_GlideDestroy: destroy 3dfx interface
*****************************************************************************/
void intf_GlideDestroy( 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 */
free( p_intf->p_sys );
}
/*****************************************************************************
* intf_GlideManage: event loop
*****************************************************************************/
void intf_GlideManage( intf_thread_t *p_intf )
{
unsigned int buf;
/* very Linux specific - see tlib.c in Glide for other versions */
while( kbhit() )
{
if( intf_ProcessKey(p_intf, (int)buf = getch()) )
{
intf_ErrMsg( "unhandled key '%c' (%i)", (char) buf, buf );
}
}
}
/*****************************************************************************
* vout_glide.c: 3dfx video output display method for 3dfx cards
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* Copyright (C) 2000, 2001 VideoLAN
*
* Authors:
* 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
......@@ -20,6 +20,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME glide
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
......@@ -33,23 +36,27 @@
#include <conio.h> /* for glide ? */
#endif
#include <glide.h>
#include <linutil.h> /* Glide kbhit() and getch() */
#include "config.h"
#include "common.h"
#include "threads.h"
#include "mtime.h"
#include "plugins.h"
#include "tests.h"
#include "modules.h"
#include "video.h"
#include "video_output.h"
#include "intf_msg.h"
#include "interface.h"
#include "main.h"
#define WIDTH 800
#define HEIGHT 600
#define BITS_PER_PLANE 16
#define BYTES_PER_PIXEL 2
#define GLIDE_WIDTH 800
#define GLIDE_HEIGHT 600
#define GLIDE_BITS_PER_PLANE 16
#define GLIDE_BYTES_PER_PIXEL 2
/*****************************************************************************
* vout_sys_t: Glide video output method descriptor
......@@ -68,18 +75,61 @@ typedef struct vout_sys_s
} vout_sys_t;
/*****************************************************************************
* Local prototypes
* Local prototypes.
*****************************************************************************/
static int vout_Probe ( probedata_t *p_data );
static int vout_Create ( struct vout_thread_s * );
static int vout_Init ( struct vout_thread_s * );
static void vout_End ( struct vout_thread_s * );
static void vout_Destroy ( struct vout_thread_s * );
static int vout_Manage ( struct vout_thread_s * );
static void vout_Display ( struct vout_thread_s * );
static int GlideOpenDisplay ( vout_thread_t *p_vout );
static void GlideCloseDisplay ( vout_thread_t *p_vout );
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
static int GlideOpenDisplay ( vout_thread_t *p_vout );
static void GlideCloseDisplay ( vout_thread_t *p_vout );
void _M( vout_getfunctions )( function_list_t * p_function_list )
{
p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
p_function_list->functions.vout.pf_init = vout_Init;
p_function_list->functions.vout.pf_end = vout_End;
p_function_list->functions.vout.pf_destroy = vout_Destroy;
p_function_list->functions.vout.pf_manage = vout_Manage;
p_function_list->functions.vout.pf_display = vout_Display;
p_function_list->functions.vout.pf_setpalette = NULL;
}
/*****************************************************************************
* vout_GlideCreate: allocates Glide video thread output method
* vout_Probe: probe the video driver and return a score
*****************************************************************************
* This function tries to initialize SDL and returns a score to the
* plugin manager so that it can select the best plugin.
*****************************************************************************/
static int vout_Probe( probedata_t *p_data )
{
if( TestMethod( VOUT_METHOD_VAR, "glide" ) )
{
return( 999 );
}
/* We could do a grSstQueryBoards( GrHwConfiguration *hwConfig ) at
* this point, but if the user didn't configure his 3dfx card, we
* have great chances to segfault here. So we'd better assume
* everything is fine and worry only if we really need to use Glide */
return( 20 );
}
/*****************************************************************************
* vout_Create: allocates Glide video thread output method
*****************************************************************************
* This function allocates and initializes a Glide vout method.
*****************************************************************************/
int vout_GlideCreate( vout_thread_t *p_vout, char *psz_display,
int i_root_window, void *p_data )
int vout_Create( vout_thread_t *p_vout )
{
/* Allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
......@@ -101,50 +151,68 @@ int vout_GlideCreate( vout_thread_t *p_vout, char *psz_display,
}
/*****************************************************************************
* vout_GlideInit: initialize Glide video thread output method
* vout_Init: initialize Glide video thread output method
*****************************************************************************/
int vout_GlideInit( vout_thread_t *p_vout )
int vout_Init( vout_thread_t *p_vout )
{
return( 0 );
}
/*****************************************************************************
* vout_GlideEnd: terminate Glide video thread output method
* vout_End: terminate Glide video thread output method
*****************************************************************************/
void vout_GlideEnd( vout_thread_t *p_vout )
void vout_End( vout_thread_t *p_vout )
{
;
}
/*****************************************************************************
* vout_GlideDestroy: destroy Glide video thread output method
* vout_Destroy: destroy Glide video thread output method
*****************************************************************************
* Terminate an output method created by vout_CreateOutputMethod
*****************************************************************************/
void vout_GlideDestroy( vout_thread_t *p_vout )
void vout_Destroy( vout_thread_t *p_vout )
{
GlideCloseDisplay( p_vout );
free( p_vout->p_sys );
}
/*****************************************************************************
* vout_GlideManage: handle Glide events
* vout_Manage: handle Glide events
*****************************************************************************
* This function should be called regularly by video output thread. It manages
* console events. It returns a non null value on error.
*****************************************************************************/
int vout_GlideManage( vout_thread_t *p_vout )
int vout_Manage( vout_thread_t *p_vout )
{
int buf;
/* very Linux specific - see tlib.c in Glide for other versions */
while( kbhit() )
{
buf = getch();
switch( (char)buf )
{
case 'q':
p_main->p_intf->b_die = 1;
break;
default:
break;
}
}
return 0;
}
/*****************************************************************************
* vout_GlideDisplay: displays previously rendered output
* vout_Display: displays previously rendered output
*****************************************************************************
* This function send the currently rendered image to Glide image, waits until
* it is displayed and switch the two rendering buffers, preparing next frame.
*****************************************************************************/
void vout_GlideDisplay( vout_thread_t *p_vout )
void vout_Display( vout_thread_t *p_vout )
{
grLfbUnlock( GR_LFB_WRITE_ONLY, GR_BUFFER_BACKBUFFER );
......@@ -171,14 +239,15 @@ static int GlideOpenDisplay( vout_thread_t *p_vout )
GrScreenResolution_t resolution = GR_RESOLUTION_800x600;
GrLfbInfo_t p_front_buffer_info; /* front buffer info */
p_vout->i_width = WIDTH;
p_vout->i_height = HEIGHT;
p_vout->i_screen_depth = BITS_PER_PLANE;
p_vout->i_bytes_per_pixel = BYTES_PER_PIXEL;
p_vout->i_width = GLIDE_WIDTH;
p_vout->i_height = GLIDE_HEIGHT;
p_vout->i_screen_depth = GLIDE_BITS_PER_PLANE;
p_vout->i_bytes_per_pixel = GLIDE_BYTES_PER_PIXEL;
/* bytes per line value overriden later */
p_vout->i_bytes_per_line = 1024 * BYTES_PER_PIXEL;
p_vout->i_bytes_per_line = 1024 * GLIDE_BYTES_PER_PIXEL;
p_vout->p_sys->i_page_size = WIDTH * HEIGHT * BYTES_PER_PIXEL;
p_vout->p_sys->i_page_size = GLIDE_WIDTH * GLIDE_HEIGHT
* GLIDE_BYTES_PER_PIXEL;
p_vout->i_red_mask = 0xf800;
p_vout->i_green_mask = 0x07e0;
......
......@@ -21,6 +21,7 @@
*****************************************************************************/
#define MODULE_NAME gnome
#include "modules_inner.h"
/*****************************************************************************
* Preamble
......@@ -35,7 +36,6 @@
#include "mtime.h"
#include "modules.h"
#include "modules_inner.h"
/*****************************************************************************
* Building configuration tree
......@@ -48,7 +48,7 @@ MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
******************************************************************************/
extern void intf_getfunctions( function_list_t * p_function_list );
void _M( intf_getfunctions )( function_list_t * p_function_list );
/*****************************************************************************
* InitModule: get the module structure and configuration.
......@@ -58,7 +58,7 @@ extern void intf_getfunctions( function_list_t * p_function_list );
* be unloaded later to save memory, and we want to be able to access this
* data even after the module has been unloaded.
*****************************************************************************/
int InitModule( module_t * p_module )
MODULE_INIT
{
p_module->psz_name = MODULE_STRING;
p_module->psz_longname = "Gnome interface module";
......@@ -78,7 +78,7 @@ int InitModule( module_t * p_module )
* be set to 0 and calls to NeedModule() be made to increment it. To unload
* the module, one has to wait until i_usage == 0 and call DeactivateModule().
*****************************************************************************/
int ActivateModule( module_t * p_module )
MODULE_ACTIVATE
{
p_module->p_functions = malloc( sizeof( module_functions_t ) );
if( p_module->p_functions == NULL )
......@@ -86,7 +86,7 @@ int ActivateModule( module_t * p_module )
return( -1 );
}
intf_getfunctions( &p_module->p_functions->intf );
_M( intf_getfunctions )( &p_module->p_functions->intf );
p_module->p_config = p_config;
......@@ -100,7 +100,7 @@ int ActivateModule( module_t * p_module )
* returns, i_usage can be set to -1 and the module unloaded. Be careful to
* lock usage_lock during the whole process.
*****************************************************************************/
int DeactivateModule( module_t * p_module )
MODULE_DEACTIVATE
{
free( p_module->p_functions );
......
......@@ -20,6 +20,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME gnome
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
......
......@@ -2,9 +2,9 @@
* intf_gnome.c: Gnome interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gnome.c,v 1.14 2001/02/20 02:53:13 stef Exp $
* $Id: intf_gnome.c,v 1.15 2001/02/20 07:49:13 sam Exp $
*
* Authors:
* 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
......@@ -21,6 +21,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME gnome
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
......@@ -90,7 +93,7 @@ void g_atexit( GVoidFunc func )
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void intf_getfunctions( function_list_t * p_function_list )
void _M( intf_getfunctions )( function_list_t * p_function_list )
{
p_function_list->pf_probe = intf_Probe;
p_function_list->functions.intf.pf_open = intf_Open;
......
......@@ -2,7 +2,7 @@
* idct.c : IDCT module
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: idct.c,v 1.6 2001/01/18 05:13:22 sam Exp $
* $Id: idct.c,v 1.7 2001/02/20 07:49:13 sam Exp $
*
* Authors: Gaël Hendryckx <jimmy@via.ecp.fr>
*
......@@ -22,6 +22,7 @@
*****************************************************************************/
#define MODULE_NAME idct
#include "modules_inner.h"
/*****************************************************************************
* Preamble
......@@ -42,7 +43,6 @@
#include "video_decoder.h"
#include "modules.h"
#include "modules_inner.h"
#include "idct.h"
......@@ -70,7 +70,7 @@ MODULE_CONFIG_END
* be unloaded later to save memory, and we want to be able to access this
* data even after the module has been unloaded.
*****************************************************************************/
int InitModule( module_t * p_module )
MODULE_INIT
{
p_module->psz_name = MODULE_STRING;
p_module->psz_longname = "IDCT module";
......@@ -90,7 +90,7 @@ int InitModule( module_t * p_module )
* be set to 0 and calls to NeedModule() be made to increment it. To unload
* the module, one has to wait until i_usage == 0 and call DeactivateModule().
*****************************************************************************/
int ActivateModule( module_t * p_module )
MODULE_ACTIVATE
{
p_module->p_functions = malloc( sizeof( module_functions_t ) );
if( p_module->p_functions == NULL )
......@@ -112,7 +112,7 @@ int ActivateModule( module_t * p_module )
* returns, i_usage can be set to -1 and the module unloaded. Be careful to
* lock usage_lock during the whole process.
*****************************************************************************/
int DeactivateModule( module_t * p_module )
MODULE_DEACTIVATE
{
free( p_module->p_functions );
......
......@@ -2,7 +2,7 @@
* idctclassic.c : Classic IDCT module
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: idctclassic.c,v 1.6 2001/01/18 05:13:22 sam Exp $
* $Id: idctclassic.c,v 1.7 2001/02/20 07:49:13 sam Exp $
*
* Authors: Gaël Hendryckx <jimmy@via.ecp.fr>
*
......@@ -70,7 +70,7 @@ MODULE_CONFIG_END
* be unloaded later to save memory, and we want to be able to access this
* data even after the module has been unloaded.
*****************************************************************************/
int InitModule( module_t * p_module )
MODULE_INIT
{
p_module->psz_name = MODULE_STRING;
p_module->psz_longname = "classic IDCT module";
......@@ -90,7 +90,7 @@ int InitModule( module_t * p_module )
* be set to 0 and calls to NeedModule() be made to increment it. To unload
* the module, one has to wait until i_usage == 0 and call DeactivateModule().
*****************************************************************************/
int ActivateModule( module_t * p_module )
MODULE_ACTIVATE
{
p_module->p_functions = malloc( sizeof( module_functions_t ) );
if( p_module->p_functions == NULL )
......@@ -112,7 +112,7 @@ int ActivateModule( module_t * p_module )
* returns, i_usage can be set to -1 and the module unloaded. Be careful to
* lock usage_lock during the whole process.
*****************************************************************************/
int DeactivateModule( module_t * p_module )
MODULE_DEACTIVATE
{
free( p_module->p_functions );
......
......@@ -2,7 +2,7 @@
* idctmmx.c : MMX IDCT module
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: idctmmx.c,v 1.7 2001/01/18 05:13:22 sam Exp $
* $Id: idctmmx.c,v 1.8 2001/02/20 07:49:13 sam Exp $
*
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Michel Lespinasse <walken@zoy.org>
......@@ -77,7 +77,7 @@ MODULE_CONFIG_END
* be unloaded later to save memory, and we want to be able to access this
* data even after the module has been unloaded.
*****************************************************************************/
int InitModule( module_t * p_module )
MODULE_INIT
{
p_module->psz_name = MODULE_STRING;
p_module->psz_longname = "MMX IDCT module";
......@@ -97,7 +97,7 @@ int InitModule( module_t * p_module )
* be set to 0 and calls to NeedModule() be made to increment it. To unload
* the module, one has to wait until i_usage == 0 and call DeactivateModule().
*****************************************************************************/
int ActivateModule( module_t * p_module )
MODULE_ACTIVATE
{
p_module->p_functions = malloc( sizeof( module_functions_t ) );
if( p_module->p_functions == NULL )
......@@ -119,7 +119,7 @@ int ActivateModule( module_t * p_module )
* returns, i_usage can be set to -1 and the module unloaded. Be careful to
* lock usage_lock during the whole process.
*****************************************************************************/
int DeactivateModule( module_t * p_module )
MODULE_DEACTIVATE
{
free( p_module->p_functions );
......
......@@ -2,7 +2,7 @@
* idctmmxext.c : MMX EXT IDCT module
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: idctmmxext.c,v 1.4 2001/01/17 18:17:30 massiot Exp $
* $Id: idctmmxext.c,v 1.5 2001/02/20 07:49:13 sam Exp $
*
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Michel Lespinasse <walken@zoy.org>
......@@ -77,7 +77,7 @@ MODULE_CONFIG_END
* be unloaded later to save memory, and we want to be able to access this
* data even after the module has been unloaded.
*****************************************************************************/
int InitModule( module_t * p_module )
MODULE_INIT
{
p_module->psz_name = MODULE_STRING;
p_module->psz_longname = "MMX EXT IDCT module";
......@@ -97,7 +97,7 @@ int InitModule( module_t * p_module )
* be set to 0 and calls to NeedModule() be made to increment it. To unload
* the module, one has to wait until i_usage == 0 and call DeactivateModule().
*****************************************************************************/
int ActivateModule( module_t * p_module )
MODULE_ACTIVATE
{
p_module->p_functions = malloc( sizeof( module_functions_t ) );
if( p_module->p_functions == NULL )
......@@ -119,7 +119,7 @@ int ActivateModule( module_t * p_module )
* returns, i_usage can be set to -1 and the module unloaded. Be careful to
* lock usage_lock during the whole process.
*****************************************************************************/
int DeactivateModule( module_t * p_module )
MODULE_DEACTIVATE
{
free( p_module->p_functions );
......
This diff is collapsed.
/*****************************************************************************
* mga.c : Matrox Graphic Array plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* Copyright (C) 2000, 2001 VideoLAN
*
* Authors:
* 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
......@@ -20,6 +20,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME mga
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
......@@ -31,75 +34,79 @@
#include "common.h" /* boolean_t, byte_t */
#include "threads.h"
#include "mtime.h"
#include "plugins.h"
#include "interface.h"
#include "audio_output.h"
#include "video.h"
#include "video_output.h"
#include "modules.h"
/*****************************************************************************
* Exported prototypes
* Building configuration tree
*****************************************************************************/
static void vout_GetPlugin( p_vout_thread_t p_vout );
static void intf_GetPlugin( p_intf_thread_t p_intf );
/* Video output */
int vout_MGACreate ( vout_thread_t *p_vout, char *psz_display,
int i_root_window, void *p_data );
int vout_MGAInit ( p_vout_thread_t p_vout );
void vout_MGAEnd ( p_vout_thread_t p_vout );
void vout_MGADestroy ( p_vout_thread_t p_vout );
int vout_MGAManage ( p_vout_thread_t p_vout );
void vout_MGADisplay ( p_vout_thread_t p_vout );
void vout_SetPalette ( p_vout_thread_t p_vout,
u16 *red, u16 *green, u16 *blue, u16 *transp );
/* Interface */
int intf_MGACreate ( p_intf_thread_t p_intf );
void intf_MGADestroy ( p_intf_thread_t p_intf );
void intf_MGAManage ( p_intf_thread_t p_intf );
MODULE_CONFIG_START
ADD_WINDOW( "Configuration for MGA module" )
ADD_COMMENT( "For now, the MGA module cannot be configured" )
MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
******************************************************************************/
void _M( vout_getfunctions )( function_list_t * p_function_list );
/*****************************************************************************
* GetConfig: get the plugin structure and configuration
* InitModule: get the module structure and configuration.
*****************************************************************************
* We have to fill psz_name, psz_longname and psz_version. These variables
* will be strdup()ed later by the main application because the module can
* be unloaded later to save memory, and we want to be able to access this
* data even after the module has been unloaded.
*****************************************************************************/
plugin_info_t * GetConfig( void )
MODULE_INIT
{
plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
p_info->psz_name = "Matrox Acceleration";
p_info->psz_version = VERSION;
p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
p_module->psz_name = MODULE_STRING;
p_module->psz_longname = "Matrox Graphic Array module";
p_module->psz_version = VERSION;
p_info->aout_GetPlugin = NULL;
p_info->vout_GetPlugin = vout_GetPlugin;
p_info->intf_GetPlugin = intf_GetPlugin;
p_info->yuv_GetPlugin = NULL;
p_module->i_capabilities = MODULE_CAPABILITY_NULL
| MODULE_CAPABILITY_VOUT;
/* The MGA module does not work yet */
p_info->i_score = 0x0;
return( p_info );
return( 0 );
}
/*****************************************************************************
* Following functions are only called through the p_info structure
* ActivateModule: set the module to an usable state.
*****************************************************************************
* This function fills the capability functions and the configuration
* structure. Once ActivateModule() has been called, the i_usage can
* be set to 0 and calls to NeedModule() be made to increment it. To unload
* the module, one has to wait until i_usage == 0 and call DeactivateModule().
*****************************************************************************/
static void vout_GetPlugin( p_vout_thread_t p_vout )
MODULE_ACTIVATE
{
p_vout->p_sys_create = vout_MGACreate;
p_vout->p_sys_init = vout_MGAInit;
p_vout->p_sys_end = vout_MGAEnd;
p_vout->p_sys_destroy = vout_MGADestroy;
p_vout->p_sys_manage = vout_MGAManage;
p_vout->p_sys_display = vout_MGADisplay;
p_module->p_functions = malloc( sizeof( module_functions_t ) );
if( p_module->p_functions == NULL )
{
return( -1 );
}
_M( vout_getfunctions )( &p_module->p_functions->vout );
p_module->p_config = p_config;
return( 0 );
}
static void intf_GetPlugin( p_intf_thread_t p_intf )
/*****************************************************************************
* DeactivateModule: make sure the module can be unloaded.
*****************************************************************************
* This function must only be called when i_usage == 0. If it successfully
* returns, i_usage can be set to -1 and the module unloaded. Be careful to
* lock usage_lock during the whole process.
*****************************************************************************/
MODULE_DEACTIVATE
{
p_intf->p_sys_create = intf_MGACreate;
p_intf->p_sys_destroy = intf_MGADestroy;
p_intf->p_sys_manage = intf_MGAManage;
free( p_module->p_functions );
return( 0 );
}
This diff is collapsed.
/*****************************************************************************
* vout_mga.h: MGA video output display method headers
*****************************************************************************
* Copyright (C) 1999 Aaron Holtzman
* Copyright (C) 2000 VideoLAN
* Copyright (C) 1999 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Copyright (C) 2000, 2001 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
......@@ -49,52 +48,3 @@ typedef struct mga_vid_config_s
#endif
/*****************************************************************************
* vout_sys_t: video output X11 method descriptor
*****************************************************************************
* This structure is part of the video output thread descriptor.
* It describes the X11 specific properties of an output thread. X11 video
* output is performed through regular resizable windows. Windows can be
* dynamically resized to adapt to the size of the streams.
*****************************************************************************/
typedef struct vout_sys_s
{
/* User settings */
boolean_t b_shm; /* shared memory extension flag */
/* Internal settings and properties */
Display * p_display; /* display pointer */
Visual * p_visual; /* visual pointer */
int i_screen; /* screen number */
Window root_window; /* root window */
Window window; /* window instance handler */
GC gc; /* graphic context instance handler */
Colormap colormap; /* colormap used (8bpp only) */
/* Display buffers and shared memory information */
XImage * p_ximage[2]; /* XImage pointer */
XShmSegmentInfo shm_info[2]; /* shared memory zone information */
/* MGA specific variables */
int i_fd;
int i_size;
mga_vid_config_t * p_mga;
byte_t * p_mga_vid_base;
boolean_t b_g400;
} vout_sys_t;
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static int X11OpenDisplay ( vout_thread_t *p_vout, char *psz_display, Window root_window );
static void X11CloseDisplay ( vout_thread_t *p_vout );
static int X11CreateWindow ( vout_thread_t *p_vout );
static void X11DestroyWindow ( vout_thread_t *p_vout );
static int X11CreateImage ( vout_thread_t *p_vout, XImage **pp_ximage );
static void X11DestroyImage ( XImage *p_ximage );
static int X11CreateShmImage ( vout_thread_t *p_vout, XImage **pp_ximage,
XShmSegmentInfo *p_shm_info );
static void X11DestroyShmImage ( vout_thread_t *p_vout, XImage *p_ximage,
XShmSegmentInfo *p_shm_info );
......@@ -21,6 +21,7 @@
*****************************************************************************/
#define MODULE_NAME motion
#include "modules_inner.h"
/*****************************************************************************
* Preamble
......@@ -38,12 +39,11 @@
#include "video.h"
#include "modules.h"
#include "modules_inner.h"
/*****************************************************************************
* Local and extern prototypes.
*****************************************************************************/
extern void motion_getfunctions( function_list_t * p_function_list );
void motion_getfunctions( function_list_t * p_function_list );
/*****************************************************************************
* Build configuration tree.
......@@ -61,7 +61,7 @@ MODULE_CONFIG_END
* be unloaded later to save memory, and we want to be able to access this
* data even after the module has been unloaded.
*****************************************************************************/
int InitModule( module_t * p_module )
MODULE_INIT
{
p_module->psz_name = MODULE_STRING;
p_module->psz_longname = "motion compensation module";
......@@ -81,7 +81,7 @@ int InitModule( module_t * p_module )
* be set to 0 and calls to NeedModule() be made to increment it. To unload
* the module, one has to wait until i_usage == 0 and call DeactivateModule().
*****************************************************************************/
int ActivateModule( module_t * p_module )
MODULE_ACTIVATE
{
p_module->p_functions = malloc( sizeof( module_functions_t ) );
if( p_module->p_functions == NULL )
......@@ -103,7 +103,7 @@ int ActivateModule( module_t * p_module )
* returns, i_usage can be set to -1 and the module unloaded. Be careful to
* lock usage_lock during the whole process.
*****************************************************************************/
int DeactivateModule( module_t * p_module )
MODULE_DEACTIVATE
{
free( p_module->p_functions );
......
......@@ -21,6 +21,7 @@
*****************************************************************************/
#define MODULE_NAME motionmmx
#include "modules_inner.h"
/*****************************************************************************
* Preamble
......@@ -38,12 +39,11 @@
#include "video.h"
#include "modules.h"
#include "modules_inner.h"
/*****************************************************************************
* Local and extern prototypes.
*****************************************************************************/
extern void motion_getfunctions( function_list_t * p_function_list );
void motion_getfunctions( function_list_t * p_function_list );
/*****************************************************************************
* Build configuration tree.
......@@ -61,7 +61,7 @@ MODULE_CONFIG_END
* be unloaded later to save memory, and we want to be able to access this
* data even after the module has been unloaded.
*****************************************************************************/
int InitModule( module_t * p_module )
MODULE_INIT
{
p_module->psz_name = MODULE_STRING;
p_module->psz_longname = "MMX motion compensation module";
......@@ -81,7 +81,7 @@ int InitModule( module_t * p_module )
* be set to 0 and calls to NeedModule() be made to increment it. To unload
* the module, one has to wait until i_usage == 0 and call DeactivateModule().
*****************************************************************************/
int ActivateModule( module_t * p_module )
MODULE_ACTIVATE
{
p_module->p_functions = malloc( sizeof( module_functions_t ) );
if( p_module->p_functions == NULL )
......@@ -103,7 +103,7 @@ int ActivateModule( module_t * p_module )
* returns, i_usage can be set to -1 and the module unloaded. Be careful to
* lock usage_lock during the whole process.
*****************************************************************************/
int DeactivateModule( module_t * p_module )
MODULE_DEACTIVATE
{
free( p_module->p_functions );
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* input_ps.c: PS demux and packet management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input_ps.c,v 1.7 2001/02/20 02:53:13 stef Exp $
* $Id: input_ps.c,v 1.8 2001/02/20 07:49:13 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -21,6 +21,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME ps
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
......@@ -76,7 +79,7 @@ static void DeletePES ( void *, struct pes_packet_s * );
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void input_getfunctions( function_list_t * p_function_list )
void _M( input_getfunctions )( function_list_t * p_function_list )
{
#define input p_function_list->functions.input
p_function_list->pf_probe = PSProbe;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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