Commit e13aed00 authored by Sam Hocevar's avatar Sam Hocevar

. autod�tection des plugins

 . les aliases "gvlc" "fbvlc" "ggivlc" fonctionne comme il faut
parent 4af2fd10
......@@ -211,6 +211,7 @@ video_decoder_obj = video_decoder/video_decoder.o \
video_decoder/vdec_idct.o
misc_obj = misc/mtime.o \
misc/tests.o \
misc/rsc_files.o \
misc/netutils.o \
misc/playlist.o \
......
......@@ -45,7 +45,7 @@ information about MPEG and DVD playing. Have a look at the documentation
section, as well as the bookmarks.
You can also try the OpenDVD site at http://www.opendvd.org/ or the
the LiVid project at http://www.linuxvideo.org/. They have lots of
the LiViD project at http://www.linuxvideo.org/. They have lots of
information, too.
......
......@@ -272,6 +272,9 @@
/* Environment variable containing the display method */
#define VOUT_METHOD_VAR "vlc_vout"
/* Environment variable containing the YUV method */
#define YUV_METHOD_VAR "vlc_yuv"
/* The fallback method */
#define VOUT_DEFAULT_METHOD "x11"
......
......@@ -38,6 +38,7 @@ typedef struct
int i_argc; /* command line arguments count */
char ** ppsz_argv; /* command line arguments */
char ** ppsz_env; /* environment variables */
char * psz_arg0; /* program name (whithout path) */
/* Generic settings */
boolean_t b_audio; /* is audio output allowed ? */
......
......@@ -43,6 +43,8 @@ typedef struct plugin_info_s
void * vout_GetPlugin;
void * intf_GetPlugin;
void * yuv_GetPlugin;
int i_score;
} plugin_info_t;
typedef struct plugin_bank_s
......
/*****************************************************************************
* plugins_export.h : exporting plugins structure
* tests.h: several test functions needed by the plugins
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* Copyright (C) 1996, 1997, 1998, 1999, 2000 VideoLAN
*
* Authors:
*
......@@ -23,36 +23,8 @@
/*****************************************************************************
* Prototypes
*****************************************************************************/
/* audio output */
int aout_SysOpen ( aout_thread_t *p_aout );
int aout_SysReset ( aout_thread_t *p_aout );
int aout_SysSetFormat ( aout_thread_t *p_aout );
int aout_SysSetChannels ( aout_thread_t *p_aout );
int aout_SysSetRate ( aout_thread_t *p_aout );
long aout_SysGetBufInfo ( aout_thread_t *p_aout, long l_buffer_info );
void aout_SysPlaySamples ( aout_thread_t *p_aout, byte_t *buffer,
int i_size );
void aout_SysClose ( aout_thread_t *p_aout );
/* video output */
int vout_SysCreate ( vout_thread_t *p_vout, char *psz_display,
int i_root_window, void *p_data );
int vout_SysInit ( p_vout_thread_t p_vout );
void vout_SysEnd ( p_vout_thread_t p_vout );
void vout_SysDestroy ( p_vout_thread_t p_vout );
int vout_SysManage ( p_vout_thread_t p_vout );
void vout_SysDisplay ( 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_SysCreate ( p_intf_thread_t p_intf );
void intf_SysDestroy ( p_intf_thread_t p_intf );
void intf_SysManage ( p_intf_thread_t p_intf );
/* YUV transformations */
int yuv_SysInit ( p_vout_thread_t p_vout );
int yuv_SysReset ( p_vout_thread_t p_vout );
void yuv_SysEnd ( p_vout_thread_t p_vout );
int TestProgram( char * psz_program );
int TestMethod( char * psz_var, char * psz_method );
int TestVersion( char * psz_version );
int TestMMX( void );
......@@ -75,9 +75,9 @@ extern "C"
{
/*****************************************************************************
* aout_SysOpen: opens a BPushGameSound
* aout_BeOpen: opens a BPushGameSound
*****************************************************************************/
int aout_SysOpen( aout_thread_t *p_aout )
int aout_BeOpen( aout_thread_t *p_aout )
{
/* Allocate structure */
p_aout->p_sys = (aout_sys_t*) malloc( sizeof( aout_sys_t ) );
......@@ -136,41 +136,41 @@ int aout_SysOpen( aout_thread_t *p_aout )
return( 0 );
}
/*****************************************************************************
* aout_SysReset: resets the dsp
* aout_BeReset: resets the dsp
*****************************************************************************/
int aout_SysReset( aout_thread_t *p_aout )
int aout_BeReset( aout_thread_t *p_aout )
{
return( 0 );
}
/*****************************************************************************
* aout_SysSetFormat: sets the dsp output format
* aout_BeSetFormat: sets the dsp output format
*****************************************************************************/
int aout_SysSetFormat( aout_thread_t *p_aout )
int aout_BeSetFormat( aout_thread_t *p_aout )
{
return( 0 );
}
/*****************************************************************************
* aout_SysSetChannels: sets the dsp's stereo or mono mode
* aout_BeSetChannels: sets the dsp's stereo or mono mode
*****************************************************************************/
int aout_SysSetChannels( aout_thread_t *p_aout )
int aout_BeSetChannels( aout_thread_t *p_aout )
{
return( 0 );
}
/*****************************************************************************
* aout_SysSetRate: sets the dsp's audio output rate
* aout_BeSetRate: sets the dsp's audio output rate
*****************************************************************************/
int aout_SysSetRate( aout_thread_t *p_aout )
int aout_BeSetRate( aout_thread_t *p_aout )
{
return( 0 );
}
/*****************************************************************************
* aout_SysGetBufInfo: buffer status query
* aout_BeGetBufInfo: buffer status query
*****************************************************************************/
long aout_SysGetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
long aout_BeGetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
{
long i_hard_pos = 4 * p_aout->p_sys->p_sound->CurrentPosition();
......@@ -189,11 +189,11 @@ long aout_SysGetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
}
/*****************************************************************************
* aout_SysPlaySamples: plays a sound samples buffer
* aout_BePlaySamples: plays a sound samples buffer
*****************************************************************************
* This function writes a buffer of i_length bytes in the dsp
*****************************************************************************/
void aout_SysPlaySamples( aout_thread_t *p_aout, byte_t *buffer, int i_size )
void aout_BePlaySamples( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
long i_newbuf_pos;
......@@ -223,9 +223,9 @@ void aout_SysPlaySamples( aout_thread_t *p_aout, byte_t *buffer, int i_size )
}
/*****************************************************************************
* aout_SysClose: closes the dsp audio device
* aout_BeClose: closes the dsp audio device
*****************************************************************************/
void aout_SysClose( aout_thread_t *p_aout )
void aout_BeClose( aout_thread_t *p_aout )
{
p_aout->p_sys->p_sound->UnlockCyclic();
p_aout->p_sys->p_sound->StopPlaying( );
......
......@@ -40,14 +40,39 @@ extern "C"
#include "video.h"
#include "video_output.h"
#include "plugins_export.h"
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
void aout_GetPlugin( p_aout_thread_t p_aout );
void vout_GetPlugin( p_vout_thread_t p_vout );
void intf_GetPlugin( p_intf_thread_t p_intf );
static void aout_GetPlugin( p_aout_thread_t p_aout );
static void vout_GetPlugin( p_vout_thread_t p_vout );
static void intf_GetPlugin( p_intf_thread_t p_intf );
/* Audio output */
int aout_BeOpen ( aout_thread_t *p_aout );
int aout_BeReset ( aout_thread_t *p_aout );
int aout_BeSetFormat ( aout_thread_t *p_aout );
int aout_BeSetChannels ( aout_thread_t *p_aout );
int aout_BeSetRate ( aout_thread_t *p_aout );
long aout_BeGetBufInfo ( aout_thread_t *p_aout, long l_buffer_info );
void aout_BePlaySamples ( aout_thread_t *p_aout, byte_t *buffer,
int i_size );
void aout_BeClose ( aout_thread_t *p_aout );
/* Video output */
int vout_BeCreate ( vout_thread_t *p_vout, char *psz_display,
int i_root_window, void *p_data );
int vout_BeInit ( p_vout_thread_t p_vout );
void vout_BeEnd ( p_vout_thread_t p_vout );
void vout_BeDestroy ( p_vout_thread_t p_vout );
int vout_BeManage ( p_vout_thread_t p_vout );
void vout_BeDisplay ( p_vout_thread_t p_vout );
void vout_BeSetPalette ( p_vout_thread_t p_vout,
u16 *red, u16 *green, u16 *blue, u16 *transp );
/* Interface */
int intf_BeCreate ( p_intf_thread_t p_intf );
void intf_BeDestroy ( p_intf_thread_t p_intf );
void intf_BeManage ( p_intf_thread_t p_intf );
/*****************************************************************************
* GetConfig: get the plugin structure and configuration
......@@ -65,49 +90,43 @@ plugin_info_t * GetConfig( void )
p_info->intf_GetPlugin = intf_GetPlugin;
p_info->yuv_GetPlugin = NULL;
return( p_info );
}
/* the beos plugin always works under BeOS :) */
p_info->i_score = 0x800;
/*****************************************************************************
* Test: tests if the plugin can be launched
*****************************************************************************/
int Test( void )
{
/* the BeOS plugin always works under BeOS :) */
return( 1 );
return( p_info );
}
/*****************************************************************************
* Following functions are only called through the p_info structure
*****************************************************************************/
void aout_GetPlugin( p_aout_thread_t p_aout )
static void aout_GetPlugin( p_aout_thread_t p_aout )
{
p_aout->p_sys_open = aout_SysOpen;
p_aout->p_sys_reset = aout_SysReset;
p_aout->p_sys_setformat = aout_SysSetFormat;
p_aout->p_sys_setchannels = aout_SysSetChannels;
p_aout->p_sys_setrate = aout_SysSetRate;
p_aout->p_sys_getbufinfo = aout_SysGetBufInfo;
p_aout->p_sys_playsamples = aout_SysPlaySamples;
p_aout->p_sys_close = aout_SysClose;
p_aout->p_sys_open = aout_BeOpen;
p_aout->p_sys_reset = aout_BeReset;
p_aout->p_sys_setformat = aout_BeSetFormat;
p_aout->p_sys_setchannels = aout_BeSetChannels;
p_aout->p_sys_setrate = aout_BeSetRate;
p_aout->p_sys_getbufinfo = aout_BeGetBufInfo;
p_aout->p_sys_playsamples = aout_BePlaySamples;
p_aout->p_sys_close = aout_BeClose;
}
void vout_GetPlugin( p_vout_thread_t p_vout )
static void vout_GetPlugin( p_vout_thread_t p_vout )
{
p_vout->p_sys_create = vout_SysCreate;
p_vout->p_sys_init = vout_SysInit;
p_vout->p_sys_end = vout_SysEnd;
p_vout->p_sys_destroy = vout_SysDestroy;
p_vout->p_sys_manage = vout_SysManage;
p_vout->p_sys_display = vout_SysDisplay;
p_vout->p_sys_create = vout_BeCreate;
p_vout->p_sys_init = vout_BeInit;
p_vout->p_sys_end = vout_BeEnd;
p_vout->p_sys_destroy = vout_BeDestroy;
p_vout->p_sys_manage = vout_BeManage;
p_vout->p_sys_display = vout_BeDisplay;
}
void intf_GetPlugin( p_intf_thread_t p_intf )
static void intf_GetPlugin( p_intf_thread_t p_intf )
{
p_intf->p_sys_create = intf_SysCreate;
p_intf->p_sys_destroy = intf_SysDestroy;
p_intf->p_sys_manage = intf_SysManage;
p_intf->p_sys_create = intf_BeCreate;
p_intf->p_sys_destroy = intf_BeDestroy;
p_intf->p_sys_manage = intf_BeManage;
}
} /* extern "C" */
......@@ -125,9 +125,9 @@ extern "C"
{
/*****************************************************************************
* intf_SysCreate: initialize dummy interface
* intf_BeCreate: initialize dummy interface
*****************************************************************************/
int intf_SysCreate( intf_thread_t *p_intf )
int intf_BeCreate( intf_thread_t *p_intf )
{
/* Allocate instance and initialize some members */
p_intf->p_sys = (intf_sys_t*) malloc( sizeof( intf_sys_t ) );
......@@ -162,9 +162,9 @@ int intf_SysCreate( intf_thread_t *p_intf )
}
/*****************************************************************************
* intf_SysDestroy: destroy dummy interface
* intf_BeDestroy: destroy dummy interface
*****************************************************************************/
void intf_SysDestroy( intf_thread_t *p_intf )
void intf_BeDestroy( intf_thread_t *p_intf )
{
/* Close input thread, if any (blocking) */
if( p_intf->p_input )
......@@ -188,9 +188,9 @@ void intf_SysDestroy( intf_thread_t *p_intf )
/*****************************************************************************
* intf_SysManage: event loop
* intf_BeManage: event loop
*****************************************************************************/
void intf_SysManage( intf_thread_t *p_intf )
void intf_BeManage( intf_thread_t *p_intf )
{
if( p_intf->p_sys->i_key != -1 )
{
......
......@@ -340,11 +340,11 @@ static int BeosOpenDisplay ( vout_thread_t *p_vout );
static void BeosCloseDisplay ( vout_thread_t *p_vout );
/*****************************************************************************
* vout_SysCreate: allocates dummy video thread output method
* vout_BeCreate: allocates dummy video thread output method
*****************************************************************************
* This function allocates and initializes a dummy vout method.
*****************************************************************************/
int vout_SysCreate( vout_thread_t *p_vout, char *psz_display,
int vout_BeCreate( vout_thread_t *p_vout, char *psz_display,
int i_root_window, void *p_data )
{
/* Allocate structure */
......@@ -371,9 +371,9 @@ int vout_SysCreate( vout_thread_t *p_vout, char *psz_display,
}
/*****************************************************************************
* vout_SysInit: initialize dummy video thread output method
* vout_BeInit: initialize dummy video thread output method
*****************************************************************************/
int vout_SysInit( vout_thread_t *p_vout )
int vout_BeInit( vout_thread_t *p_vout )
{
VideoWindow * p_win = p_vout->p_sys->p_window;
u32 i_page_size;
......@@ -406,9 +406,9 @@ int vout_SysInit( vout_thread_t *p_vout )
}
/*****************************************************************************
* vout_SysEnd: terminate dummy video thread output method
* vout_BeEnd: terminate dummy video thread output method
*****************************************************************************/
void vout_SysEnd( vout_thread_t *p_vout )
void vout_BeEnd( vout_thread_t *p_vout )
{
VideoWindow * p_win = p_vout->p_sys->p_window;
......@@ -422,11 +422,11 @@ void vout_SysEnd( vout_thread_t *p_vout )
}
/*****************************************************************************
* vout_SysDestroy: destroy dummy video thread output method
* vout_BeDestroy: destroy dummy video thread output method
*****************************************************************************
* Terminate an output method created by DummyCreateOutputMethod
*****************************************************************************/
void vout_SysDestroy( vout_thread_t *p_vout )
void vout_BeDestroy( vout_thread_t *p_vout )
{
BeosCloseDisplay( p_vout );
......@@ -434,12 +434,12 @@ void vout_SysDestroy( vout_thread_t *p_vout )
}
/*****************************************************************************
* vout_SysManage: handle dummy events
* vout_BeManage: handle dummy 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_SysManage( vout_thread_t *p_vout )
int vout_BeManage( vout_thread_t *p_vout )
{
if( p_vout->i_changes & VOUT_SIZE_CHANGE )
{
......@@ -468,12 +468,12 @@ int vout_SysManage( vout_thread_t *p_vout )
}
/*****************************************************************************
* vout_SysDisplay: displays previously rendered output
* vout_BeDisplay: displays previously rendered output
*****************************************************************************
* This function send the currently rendered image to dummy image, waits until
* it is displayed and switch the two rendering buffers, preparing next frame.
*****************************************************************************/
void vout_SysDisplay( vout_thread_t *p_vout )
void vout_BeDisplay( vout_thread_t *p_vout )
{
VideoWindow * p_win = p_vout->p_sys->p_window;
......
......@@ -22,10 +22,10 @@
/* TODO:
*
* - an aout_sysGetFormats() function
* - an aout_DspGetFormats() function
* - dsp inline/static
* - make this library portable (see mpg123)
* - macroify aout_sysPlaySamples &/| aout_sysGetBufInfo ?
* - macroify aout_DspPlaySamples &/| aout_DspGetBufInfo ?
*
*/
......@@ -74,12 +74,12 @@ typedef struct aout_sys_s
} aout_sys_t;
/*****************************************************************************
* aout_SysOpen: opens the audio device (the digital sound processor)
* aout_DspOpen: opens the audio device (the digital sound processor)
*****************************************************************************
* - This function opens the dsp as an usual non-blocking write-only file, and
* modifies the p_aout->p_sys->i_fd with the file's descriptor.
*****************************************************************************/
int aout_SysOpen( aout_thread_t *p_aout )
int aout_DspOpen( aout_thread_t *p_aout )
{
/* Allocate structure */
p_aout->p_sys = malloc( sizeof( aout_sys_t ) );
......@@ -106,9 +106,9 @@ int aout_SysOpen( aout_thread_t *p_aout )
}
/*****************************************************************************
* aout_SysReset: resets the dsp
* aout_DspReset: resets the dsp
*****************************************************************************/
int aout_SysReset( aout_thread_t *p_aout )
int aout_DspReset( aout_thread_t *p_aout )
{
if ( ioctl( p_aout->i_fd, SNDCTL_DSP_RESET, NULL ) < 0 )
{
......@@ -120,13 +120,13 @@ int aout_SysReset( aout_thread_t *p_aout )
}
/*****************************************************************************
* aout_SysSetFormat: sets the dsp output format
* aout_DspSetFormat: sets the dsp output format
*****************************************************************************
* This functions tries to initialize the dsp output format with the value
* contained in the dsp structure, and if this value could not be set, the
* default value returned by ioctl is set.
*****************************************************************************/
int aout_SysSetFormat( aout_thread_t *p_aout )
int aout_DspSetFormat( aout_thread_t *p_aout )
{
int i_format;
......@@ -147,11 +147,11 @@ int aout_SysSetFormat( aout_thread_t *p_aout )
}
/*****************************************************************************
* aout_SysSetChannels: sets the dsp's stereo or mono mode
* aout_DspSetChannels: sets the dsp's stereo or mono mode
*****************************************************************************
* This function acts just like the previous one...
*****************************************************************************/
int aout_SysSetChannels( aout_thread_t *p_aout )
int aout_DspSetChannels( aout_thread_t *p_aout )
{
boolean_t b_stereo = p_aout->b_stereo;
......@@ -172,13 +172,13 @@ int aout_SysSetChannels( aout_thread_t *p_aout )
}
/*****************************************************************************
* aout_SysSetRate: sets the dsp's audio output rate
* aout_DspSetRate: sets the dsp's audio output rate
*****************************************************************************
* This function tries to initialize the dsp with the rate contained in the
* dsp structure, but if the dsp doesn't support this value, the function uses
* the value returned by ioctl...
*****************************************************************************/
int aout_SysSetRate( aout_thread_t *p_aout )
int aout_DspSetRate( aout_thread_t *p_aout )
{
long l_rate;
......@@ -199,7 +199,7 @@ int aout_SysSetRate( aout_thread_t *p_aout )
}
/*****************************************************************************
* aout_SysGetBufInfo: buffer status query
* aout_DspGetBufInfo: buffer status query
*****************************************************************************
* This function fills in the audio_buf_info structure :
* - int fragments : number of available fragments (partially usend ones not
......@@ -209,7 +209,7 @@ int aout_SysSetRate( aout_thread_t *p_aout )
* - int bytes : available space in bytes (includes partially used fragments)
* Note! 'bytes' could be more than fragments*fragsize
*****************************************************************************/
long aout_SysGetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
long aout_DspGetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
{
ioctl( p_aout->i_fd, SNDCTL_DSP_GETOSPACE, &p_aout->p_sys->audio_buf );
......@@ -220,11 +220,11 @@ long aout_SysGetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
}
/*****************************************************************************
* aout_SysPlaySamples: plays a sound samples buffer
* aout_DspPlaySamples: plays a sound samples buffer
*****************************************************************************
* This function writes a buffer of i_length bytes in the dsp
*****************************************************************************/
void aout_SysPlaySamples( aout_thread_t *p_aout, byte_t *buffer, int i_size )
void aout_DspPlaySamples( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
if( p_aout->b_active )
{
......@@ -233,9 +233,9 @@ void aout_SysPlaySamples( aout_thread_t *p_aout, byte_t *buffer, int i_size )
}
/*****************************************************************************
* aout_SysClose: closes the dsp audio device
* aout_DspClose: closes the dsp audio device
*****************************************************************************/
void aout_SysClose( aout_thread_t *p_aout )
void aout_DspClose( aout_thread_t *p_aout )
{
close( p_aout->i_fd );
}
......
......@@ -25,12 +25,17 @@
*****************************************************************************/
#include "defs.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h> /* malloc(), free() */
#include <unistd.h> /* close() */
#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"
......@@ -38,18 +43,30 @@
#include "video.h"
#include "video_output.h"
#include "plugins_export.h"
#include "main.h"
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
void aout_GetPlugin( p_aout_thread_t p_aout );
static void aout_GetPlugin( p_aout_thread_t p_aout );
/* Audio output */
int aout_DspOpen ( aout_thread_t *p_aout );
int aout_DspReset ( aout_thread_t *p_aout );
int aout_DspSetFormat ( aout_thread_t *p_aout );
int aout_DspSetChannels ( aout_thread_t *p_aout );
int aout_DspSetRate ( aout_thread_t *p_aout );
long aout_DspGetBufInfo ( aout_thread_t *p_aout, long l_buffer_info );
void aout_DspPlaySamples ( aout_thread_t *p_aout, byte_t *buffer,
int i_size );
void aout_DspClose ( aout_thread_t *p_aout );
/*****************************************************************************
* GetConfig: get the plugin structure and configuration
*****************************************************************************/
plugin_info_t * GetConfig( void )
{
int i_fd;
plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
p_info->psz_name = "OSS /dev/dsp";
......@@ -61,31 +78,40 @@ plugin_info_t * GetConfig( void )
p_info->intf_GetPlugin = NULL;
p_info->yuv_GetPlugin = NULL;
return( p_info );
}
/* Test if the device can be opened */
if ( (i_fd = open( main_GetPszVariable( AOUT_DSP_VAR, AOUT_DSP_DEFAULT ),
O_WRONLY )) < 0 )
{
p_info->i_score = 0;
}
else
{
close( i_fd );
p_info->i_score = 0x100;
}
/*****************************************************************************
* Test: tests if the plugin can be launched
*****************************************************************************/
int Test( void )
{
/* TODO: check if suitable */
return( 1 );
/* If this plugin was requested, score it higher */
if( TestMethod( AOUT_METHOD_VAR, "dsp" ) )
{
p_info->i_score += 0x200;
}
return( p_info );
}
/*****************************************************************************
* Following functions are only called through the p_info structure
*****************************************************************************/
void aout_GetPlugin( p_aout_thread_t p_aout )
static void aout_GetPlugin( p_aout_thread_t p_aout )
{
p_aout->p_sys_open = aout_SysOpen;
p_aout->p_sys_reset = aout_SysReset;
p_aout->p_sys_setformat = aout_SysSetFormat;
p_aout->p_sys_setchannels = aout_SysSetChannels;
p_aout->p_sys_setrate = aout_SysSetRate;
p_aout->p_sys_getbufinfo = aout_SysGetBufInfo;
p_aout->p_sys_playsamples = aout_SysPlaySamples;
p_aout->p_sys_close = aout_SysClose;
p_aout->p_sys_open = aout_DspOpen;
p_aout->p_sys_reset = aout_DspReset;
p_aout->p_sys_setformat = aout_DspSetFormat;
p_aout->p_sys_setchannels = aout_DspSetChannels;
p_aout->p_sys_setrate = aout_DspSetRate;
p_aout->p_sys_getbufinfo = aout_DspGetBufInfo;
p_aout->p_sys_playsamples = aout_DspPlaySamples;
p_aout->p_sys_close = aout_DspClose;
}
......@@ -48,9 +48,9 @@ typedef struct aout_sys_s
} aout_sys_t;
/*****************************************************************************
* aout_SysOpen: opens a dummy audio device
* aout_DummyOpen: opens a dummy audio device
*****************************************************************************/
int aout_SysOpen( aout_thread_t *p_aout )
int aout_DummyOpen( aout_thread_t *p_aout )
{
/* Initialize some variables */
p_aout->i_format = AOUT_DEFAULT_FORMAT;
......@@ -61,57 +61,57 @@ int aout_SysOpen( aout_thread_t *p_aout )
}
/*****************************************************************************
* aout_SysReset: fake reset
* aout_DummyReset: fake reset
*****************************************************************************/
int aout_SysReset( aout_thread_t *p_aout )
int aout_DummyReset( aout_thread_t *p_aout )
{
return( 0 );
}
/*****************************************************************************
* aout_SysSetFormat: pretends to set the dsp output format
* aout_DummySetFormat: pretends to set the dsp output format
*****************************************************************************/
int aout_SysSetFormat( aout_thread_t *p_aout )
int aout_DummySetFormat( aout_thread_t *p_aout )
{
return( 0 );
}
/*****************************************************************************
* aout_SysSetChannels: pretends to set stereo or mono mode
* aout_DummySetChannels: pretends to set stereo or mono mode
*****************************************************************************/
int aout_SysSetChannels( aout_thread_t *p_aout )
int aout_DummySetChannels( aout_thread_t *p_aout )
{
return( 0 );
}
/*****************************************************************************
* aout_SysSetRate: pretends to set audio output rate
* aout_DummySetRate: pretends to set audio output rate
*****************************************************************************/
int aout_SysSetRate( aout_thread_t *p_aout )
int aout_DummySetRate( aout_thread_t *p_aout )
{
return( 0 );
}
/*****************************************************************************
* aout_SysGetBufInfo: returns available bytes in buffer
* aout_DummyGetBufInfo: returns available bytes in buffer
*****************************************************************************/
long aout_SysGetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
long aout_DummyGetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
{
return( 2 * l_buffer_limit ); /* value big enough to sleep */
}
/*****************************************************************************
* aout_SysPlaySamples: pretends to play a sound
* aout_DummyPlaySamples: pretends to play a sound
*****************************************************************************/
void aout_SysPlaySamples( aout_thread_t *p_aout, byte_t *buffer, int i_size )
void aout_DummyPlaySamples( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
;
}
/*****************************************************************************
* aout_SysClose: closes the dummy audio device
* aout_DummyClose: closes the dummy audio device
*****************************************************************************/
void aout_SysClose( aout_thread_t *p_aout )