Commit 26ee312a authored by Sam Hocevar's avatar Sam Hocevar

 . the IDCT functions are now located in modules : the classic IDCT,
   our optimized IDCT, and MMX IDCT.
 . cosmetic changes for modules (pf_* instead of p_*)
 . fixes to the BeOS and dummy modules

   WARNING: a new directory has been added, which means you have to
   use `cvs update -dP' to update ; files have been removed , which means
   you either have to run `make distclean' or remove the .deps directory,
   and the configure script has changed, which means you have to run it
   again. Don't complain before having checked this :)

   Note about the IDCT modules: there is no way to choose the one we
   use, but you may remove the module in lib/ to prevent it from being
   loaded. The preference order is : MMX, Optimized, Classic.
parent a558a9bb
......@@ -238,7 +238,6 @@ endif
VIDEO_DECODER = src/video_decoder/video_decoder.o \
src/video_decoder/vdec_motion.o \
src/video_decoder/vdec_idct.o \
$(vdec_motion_inner)
MISC = src/misc/mtime.o \
......@@ -276,8 +275,8 @@ endif
#
ifneq (,$(findstring 86,$(ARCH)))
ifneq (,$(findstring mmx,$(ARCH)))
ASM_OBJ = src/video_decoder/vdec_idctmmx.o \
src/video_output/video_yuv_mmx.o
ASM_OBJ = src/video_output/video_yuv_mmx.o
PLUGIN_IDCTMMX_ASM = plugins/idct/idctmmx_asm.o
endif
endif
......@@ -351,6 +350,15 @@ PLUGIN_YUVMMX = plugins/yuvmmx/yuvmmx.o \
plugins/yuvmmx/video_yuv24.o \
plugins/yuvmmx/video_yuv32.o
PLUGIN_IDCT = plugins/idct/idct.o \
plugins/idct/idct_common.o
PLUGIN_IDCTCLASSIC = plugins/idct/idctclassic.o \
plugins/idct/idct_common.o
PLUGIN_IDCTMMX = plugins/idct/idctmmx.o \
plugins/idct/idct_common.o
PLUGIN_ALSA = plugins/alsa/alsa.o \
plugins/alsa/aout_alsa.o
......@@ -364,14 +372,23 @@ STD_PLUGIN_OBJ =$(PLUGIN_BEOS) \
$(PLUGIN_X11) \
$(PLUGIN_YUV) \
$(PLUGIN_YUVMMX) \
$(PLUGIN_IDCT) \
$(PLUGIN_IDCTMMX) \
$(PLUGIN_SDL) \
$(PLUGIN_ALSA) \
$(PLUGIN_NULL)
STD_PLUGIN_ASM =$(PLUGIN_IDCTMMX_ASM)
STD_PLUGIN_COMMON = plugins/idct/idct_common.o
# filter out duplicates from the plugin object lists
STD_PLUGIN_OBJ := $(filter-out $(STD_PLUGIN_COMMON), $(STD_PLUGIN_OBJ)) \
$(STD_PLUGIN_COMMON)
#
# Other lists of files
#
objects := $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ)
objects := $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ) $(STD_PLUGIN_ASM)
dependancies := $(objects:%.o=.dep/%.d)
# All symbols must be exported
......@@ -467,6 +484,10 @@ $(STD_PLUGIN_OBJ): %.o: .dep/%.d
$(STD_PLUGIN_OBJ): %.o: %.c
$(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
$(STD_PLUGIN_ASM): %.o: Makefile.dep
$(STD_PLUGIN_ASM): %.o: %.S
$(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
$(PLUGIN_GNOME): %.o: Makefile.dep
$(PLUGIN_GNOME): %.o: %.c
$(CC) $(CFLAGS) $(PCFLAGS) `gnome-config --cflags gnomeui` -c -o $@ $<
......@@ -535,17 +556,35 @@ lib/ggi.so: $(PLUGIN_GGI)
lib/sdl.so: $(PLUGIN_SDL)
$(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_SDL)
lib/yuv.so: $(PLUGIN_YUV)
ifeq ($(SYS),beos)
lib/idct.so: $(PLUGIN_IDCT)
$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
lib/yuv.so: $(PLUGIN_YUV)
$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
else
$(CC) $(PCFLAGS) -shared -o $@ $^
endif
lib/yuvmmx.so: $(PLUGIN_YUVMMX)
ifeq ($(SYS),beos)
$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC)
$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
lib/idctmmx.so: $(PLUGIN_IDCTMMX) $(PLUGIN_IDCTMMX_ASM)
$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
else
lib/yuv.so: $(PLUGIN_YUV)
$(CC) $(PCFLAGS) -shared -o $@ $^
lib/yuvmmx.so: $(PLUGIN_YUVMMX)
$(CC) $(PCFLAGS) -shared -o $@ $^
lib/idct.so: $(PLUGIN_IDCT)
$(CC) $(PCFLAGS) -shared -o $@ $^
lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC)
$(CC) $(PCFLAGS) -shared -o $@ $^
lib/idctmmx.so: $(PLUGIN_IDCTMMX) $(PLUGIN_IDCTMMX_ASM)
$(CC) $(PCFLAGS) -shared -o $@ $^
endif
......
......@@ -3296,7 +3296,7 @@ EOF
fi
PLUGINS=${PLUGINS}"yuv ";
PLUGINS=${PLUGINS}"yuv idct idctclassic ";
ARCH=${host_cpu}
# Check whether --enable-ppro or --disable-ppro was given.
......@@ -3310,9 +3310,9 @@ fi
# Check whether --enable-mmx or --disable-mmx was given.
if test "${enable_mmx+set}" = set; then
enableval="$enable_mmx"
if test x$enableval = xyes; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx "; fi
if test x$enableval = xyes; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx idctmmx "; fi
else
if test x${host_cpu} = xi686 -o x${host_cpu} = xi586; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx "; fi
if test x${host_cpu} = xi686 -o x${host_cpu} = xi586; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx idctmmx "; fi
fi
# Check whether --enable-debug or --disable-debug was given.
......
......@@ -108,7 +108,7 @@ AC_TYPE_SIZE_T
AC_HEADER_TIME
dnl default plugins
PLUGINS=${PLUGINS}"yuv ";
PLUGINS=${PLUGINS}"yuv idct idctclassic ";
ARCH=${host_cpu}
AC_ARG_ENABLE(ppro,
......@@ -117,8 +117,8 @@ AC_ARG_ENABLE(ppro,
[ if test x${host_cpu} = xi686; then ARCH=${ARCH}" ppro"; fi ])
AC_ARG_ENABLE(mmx,
[ --disable-mmx Disable MMX optimizations (default enabled for x86)],
[ if test x$enableval = xyes; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx "; fi ],
[ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx "; fi ])
[ if test x$enableval = xyes; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx idctmmx "; fi ],
[ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx idctmmx "; fi ])
AC_ARG_ENABLE(debug,
[ --enable-debug Enable debug mode (default disabled)],
[ if test x$enableval = xyes; then DEBUG=1; fi ])
......
......@@ -139,11 +139,11 @@ typedef struct aout_thread_s
/* Plugin used and shortcuts to access its capabilities */
struct module_s * p_module;
aout_open_t * p_open;
aout_setformat_t * p_setformat;
aout_getbufinfo_t * p_getbufinfo;
aout_play_t * p_play;
aout_close_t * p_close;
aout_open_t * pf_open;
aout_setformat_t * pf_setformat;
aout_getbufinfo_t * pf_getbufinfo;
aout_play_t * pf_play;
aout_close_t * pf_close;
void * buffer;
/* The s32 buffer is used to mix all the audio fifos together before
......
......@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: common.h,v 1.23 2001/01/11 15:35:35 sam Exp $
* $Id: common.h,v 1.24 2001/01/13 12:57:19 sam Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -61,6 +61,13 @@ typedef int ptrdiff_t;
/* Counter for statistics and profiling */
typedef unsigned long count_t;
/* DCT elements types */
#ifndef VDEC_DFT
typedef short dctelem_t;
#else
typedef int dctelem_t;
#endif
/*****************************************************************************
* Classes declaration
*****************************************************************************/
......
......@@ -2,7 +2,7 @@
* input_ext-dec.h: structures exported to the VideoLAN decoders
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-dec.h,v 1.13 2001/01/12 17:33:18 massiot Exp $
* $Id: input_ext-dec.h,v 1.14 2001/01/13 12:57:19 sam Exp $
*
* Authors:
*
......@@ -66,7 +66,7 @@ typedef struct pes_packet_s
/* Pointers to packets (packets are then linked by the p_prev and
p_next fields of the data_packet_t struct) */
data_packet_t * p_first; /* The first packet containing this
data_packet_t * p_first; /* The first packet contained by this
* PES (used by decoders). */
} pes_packet_t;
......
......@@ -34,17 +34,18 @@ typedef void * module_handle_t;
* Module capabilities.
*****************************************************************************/
#define MODULE_CAPABILITY_NULL 0 /* The Module can't do anything */
#define MODULE_CAPABILITY_INTF 1<<0 /* Interface */
#define MODULE_CAPABILITY_INPUT 1<<1 /* Input */
#define MODULE_CAPABILITY_DECAPS 1<<2 /* Decaps */
#define MODULE_CAPABILITY_ADEC 1<<3 /* Audio decoder */
#define MODULE_CAPABILITY_VDEC 1<<4 /* Video decoder */
#define MODULE_CAPABILITY_AOUT 1<<5 /* Audio output */
#define MODULE_CAPABILITY_VOUT 1<<6 /* Video output */
#define MODULE_CAPABILITY_YUV 1<<7 /* YUV colorspace conversion */
#define MODULE_CAPABILITY_AFX 1<<8 /* Audio effects */
#define MODULE_CAPABILITY_VFX 1<<9 /* Video effects */
#define MODULE_CAPABILITY_NULL 0 /* The Module can't do anything */
#define MODULE_CAPABILITY_INTF 1 << 0 /* Interface */
#define MODULE_CAPABILITY_INPUT 1 << 1 /* Input */
#define MODULE_CAPABILITY_DECAPS 1 << 2 /* Decaps */
#define MODULE_CAPABILITY_ADEC 1 << 3 /* Audio decoder */
#define MODULE_CAPABILITY_VDEC 1 << 4 /* Video decoder */
#define MODULE_CAPABILITY_IDCT 1 << 5 /* IDCT transformation */
#define MODULE_CAPABILITY_AOUT 1 << 6 /* Audio output */
#define MODULE_CAPABILITY_VOUT 1 << 7 /* Video output */
#define MODULE_CAPABILITY_YUV 1 << 8 /* YUV colorspace conversion */
#define MODULE_CAPABILITY_AFX 1 << 9 /* Audio effects */
#define MODULE_CAPABILITY_VFX 1 << 10 /* Video effects */
/* FIXME: not yet used */
typedef struct probedata_s
......@@ -58,20 +59,31 @@ typedef struct probedata_s
/* FIXME: find a nicer way to do this. */
typedef struct function_list_s
{
int ( * p_probe ) ( probedata_t * p_data );
int ( * pf_probe ) ( probedata_t * p_data );
union
{
struct
{
int ( * p_open ) ( struct aout_thread_s * p_aout );
int ( * p_setformat ) ( struct aout_thread_s * p_aout );
long ( * p_getbufinfo ) ( struct aout_thread_s * p_aout,
long l_buffer_info );
void ( * p_play ) ( struct aout_thread_s * p_aout,
byte_t *buffer, int i_size );
void ( * p_close ) ( struct aout_thread_s * p_aout );
} aout;
int ( * pf_open ) ( struct aout_thread_s * p_aout );
int ( * pf_setformat ) ( struct aout_thread_s * p_aout );
long ( * pf_getbufinfo ) ( struct aout_thread_s * p_aout,
long l_buffer_info );
void ( * pf_play ) ( struct aout_thread_s * p_aout,
byte_t *buffer, int i_size );
void ( * pf_close ) ( struct aout_thread_s * p_aout );
} aout;
struct
{
void ( * pf_init ) ( struct vdec_thread_s * p_vdec );
void ( * pf_sparse_idct ) ( struct vdec_thread_s * p_vdec,
dctelem_t * p_block,
int i_sparse_pos );
void ( * pf_idct ) ( struct vdec_thread_s * p_vdec,
dctelem_t * p_block,
int i_idontcare );
} idct;
} functions;
......@@ -79,12 +91,13 @@ typedef struct function_list_s
typedef struct module_functions_s
{
/* The order here has to be the same as above for the #defines */
/* XXX: The order here has to be the same as above for the #defines */
function_list_t intf;
function_list_t input;
function_list_t decaps;
function_list_t adec;
function_list_t vdec;
function_list_t idct;
function_list_t aout;
function_list_t vout;
function_list_t yuv;
......
......@@ -2,7 +2,7 @@
* video_decoder.h : video decoder thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_decoder.h,v 1.1 2000/12/21 17:19:52 massiot Exp $
* $Id: video_decoder.h,v 1.22 2001/01/13 12:57:19 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......
......@@ -91,12 +91,12 @@ static void aout_Close ( aout_thread_t *p_aout );
*****************************************************************************/
void aout_getfunctions( function_list_t * p_function_list )
{
p_function_list->p_probe = aout_Probe;
p_function_list->functions.aout.p_open = aout_Open;
p_function_list->functions.aout.p_setformat = aout_SetFormat;
p_function_list->functions.aout.p_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.p_play = aout_Play;
p_function_list->functions.aout.p_close = aout_Close;
p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.pf_play = aout_Play;
p_function_list->functions.aout.pf_close = aout_Close;
}
......@@ -148,7 +148,6 @@ static int aout_Probe( probedata_t *p_data )
*****************************************************************************
* This function opens an alsa device, through the alsa API
*****************************************************************************/
static int aout_Open( aout_thread_t *p_aout )
{
......@@ -195,8 +194,7 @@ static int aout_Open( aout_thread_t *p_aout )
* This function prepares the device, sets the rate, format, the mode
* ("play as soon as you have data"), and buffer information.
*****************************************************************************/
int aout_SetFormat( aout_thread_t *p_aout )
static int aout_SetFormat( aout_thread_t *p_aout )
{
int i_set_param_returns;
......@@ -288,7 +286,7 @@ int aout_SetFormat( aout_thread_t *p_aout )
* of data to play, it switches to the "underrun" status. It has to
* be flushed and re-prepared
*****************************************************************************/
long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
static long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
{
snd_pcm_channel_status_t alsa_channel_status;
int i_alsa_get_status_returns;
......@@ -333,7 +331,7 @@ long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
*****************************************************************************
* Plays a sample using the snd_pcm_write function from the alsa API
*****************************************************************************/
void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
int i_write_returns;
......@@ -350,7 +348,7 @@ void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
/*****************************************************************************
* aout_Close : close the Alsa device
*****************************************************************************/
void aout_Close( aout_thread_t *p_aout )
static void aout_Close( aout_thread_t *p_aout )
{
int i_close_returns;
......@@ -365,3 +363,4 @@ void aout_Close( aout_thread_t *p_aout )
intf_DbgMsg( "Alsa plugin : Alsa device closed");
}
......@@ -2,7 +2,7 @@
* aout_beos.cpp: BeOS audio output
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: aout_beos.cpp,v 1.9 2001/01/12 13:15:42 sam Exp $
* $Id: aout_beos.cpp,v 1.10 2001/01/13 12:57:19 sam Exp $
*
* Authors:
* Samuel Hocevar <sam@via.ecp.fr>
......@@ -91,18 +91,18 @@ static void aout_Close ( aout_thread_t *p_aout );
*****************************************************************************/
void aout_getfunctions( function_list_t * p_function_list )
{
p_function_list->p_probe = aout_Probe;
p_function_list->functions.aout.p_open = aout_Open;
p_function_list->functions.aout.p_setformat = aout_SetFormat;
p_function_list->functions.aout.p_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.p_play = aout_Play;
p_function_list->functions.aout.p_close = aout_Close;
p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.pf_play = aout_Play;
p_function_list->functions.aout.pf_close = aout_Close;
}
/*****************************************************************************
* aout_Probe: probe the audio device and return a score
*****************************************************************************/
int aout_Probe( aout_thread_t *p_aout )
static int aout_Probe( probedata_t *p_data )
{
/* We don't test anything since I don't know what to test. However
* if the module could be loaded it is quite likely to work. */
......@@ -112,7 +112,7 @@ int aout_Probe( aout_thread_t *p_aout )
/*****************************************************************************
* aout_Open: opens a BPushGameSound
*****************************************************************************/
int aout_Open( aout_thread_t *p_aout )
static int aout_Open( aout_thread_t *p_aout )
{
/* Allocate structure */
p_aout->p_sys = (aout_sys_t*) malloc( sizeof( aout_sys_t ) );
......@@ -175,7 +175,7 @@ int aout_Open( aout_thread_t *p_aout )
/*****************************************************************************
* aout_SetFormat: sets the dsp output format
*****************************************************************************/
int aout_SetFormat( aout_thread_t *p_aout )
static int aout_SetFormat( aout_thread_t *p_aout )
{
return( 0 );
}
......@@ -183,7 +183,7 @@ int aout_SetFormat( aout_thread_t *p_aout )
/*****************************************************************************
* aout_GetBufInfo: buffer status query
*****************************************************************************/
long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
static long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
{
/* Each value is 4 bytes long (stereo signed 16 bits) */
long i_hard_pos = 4 * p_aout->p_sys->p_sound->CurrentPosition();
......@@ -202,7 +202,7 @@ long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
*****************************************************************************
* This function writes a buffer of i_length bytes in the dsp
*****************************************************************************/
void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
long i_newbuf_pos;
......@@ -234,7 +234,7 @@ void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
/*****************************************************************************
* aout_Close: closes the dsp audio device
*****************************************************************************/
void aout_Close( aout_thread_t *p_aout )
static void aout_Close( aout_thread_t *p_aout )
{
p_aout->p_sys->p_sound->UnlockCyclic();
p_aout->p_sys->p_sound->StopPlaying( );
......
......@@ -92,12 +92,12 @@ static void aout_Close ( aout_thread_t *p_aout );
*****************************************************************************/
void aout_getfunctions( function_list_t * p_function_list )
{
p_function_list->p_probe = aout_Probe;
p_function_list->functions.aout.p_open = aout_Open;
p_function_list->functions.aout.p_setformat = aout_SetFormat;
p_function_list->functions.aout.p_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.p_play = aout_Play;
p_function_list->functions.aout.p_close = aout_Close;
p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.pf_play = aout_Play;
p_function_list->functions.aout.pf_close = aout_Close;
}
/*****************************************************************************
......
......@@ -35,6 +35,8 @@
#include "main.h"
#include "modules.h"
/*****************************************************************************
* vout_dummy_t: dummy video output method descriptor
*****************************************************************************
......@@ -44,13 +46,46 @@
typedef struct aout_sys_s
{
} aout_sys_t;
/*****************************************************************************
* aout_DummyOpen: opens a dummy audio device
* Local prototypes.
*****************************************************************************/
static int aout_Probe ( probedata_t *p_data );
static int aout_Open ( aout_thread_t *p_aout );
static int aout_SetFormat ( aout_thread_t *p_aout );
static long aout_GetBufInfo ( aout_thread_t *p_aout, long l_buffer_info );
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 )
{
p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.pf_play = aout_Play;
p_function_list->functions.aout.pf_close = aout_Close;
}
/*****************************************************************************
* aout_Probe: probe the audio device and return a score
*****************************************************************************/
static int aout_Probe( probedata_t *p_data )
{
/* The dummy plugin always works but give it the lower possible score */
return( 1 );
}
/*****************************************************************************
* aout_Open: opens a dummy audio device
*****************************************************************************/
int aout_DummyOpen( aout_thread_t *p_aout )
static int aout_Open( aout_thread_t *p_aout )
{
/* Initialize some variables */
p_aout->i_format = AOUT_FORMAT_DEFAULT;
......@@ -61,33 +96,33 @@ int aout_DummyOpen( aout_thread_t *p_aout )
}
/*****************************************************************************
* aout_DummySetFormat: pretends to set the dsp output format
* aout_SetFormat: pretends to set the dsp output format
*****************************************************************************/
int aout_DummySetFormat( aout_thread_t *p_aout )
static int aout_SetFormat( aout_thread_t *p_aout )
{
return( 0 );
}
/*****************************************************************************
* aout_DummyGetBufInfo: returns available bytes in buffer
* aout_GetBufInfo: returns available bytes in buffer
*****************************************************************************/
long aout_DummyGetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
static long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
{
return( sizeof(s16) * l_buffer_limit + 1 ); /* value big enough to sleep */
}
/*****************************************************************************
* aout_DummyPlay: pretends to play a sound
* aout_Play: pretends to play a sound
*****************************************************************************/
void aout_DummyPlay( aout_thread_t *p_aout, byte_t *buffer, int i_size )
static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
;
}
/*****************************************************************************
* aout_DummyClose: closes the dummy audio device
* aout_Close: closes the dummy audio device
*****************************************************************************/
void aout_DummyClose( aout_thread_t *p_aout )
static void aout_Close( aout_thread_t *p_aout )
{
;
}
......
......@@ -20,6 +20,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME dummy
/*****************************************************************************
* Preamble
*****************************************************************************/
......@@ -39,21 +41,87 @@
#include "video.h"
#include "video_output.h"
#include "modules.h"
#include "modules_inner.h"
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
MODULE_CONFIG_START
ADD_WINDOW( "Configuration for dummy module" )
ADD_COMMENT( "Ha, ha -- nothing to configure yet" )
MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
*****************************************************************************/
extern void aout_getfunctions( function_list_t * p_function_list );
/*****************************************************************************
* 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.
*****************************************************************************/
int InitModule( module_t * p_module )
{
p_module->psz_name = MODULE_STRING;
p_module->psz_longname = "dummy functions module";
p_module->psz_version = VERSION;
p_module->i_capabilities = MODULE_CAPABILITY_NULL
| MODULE_CAPABILITY_AOUT;
return( 0 );
}
/*****************************************************************************
* 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().