2004-12-09 23:37:29 +00:00
# include "quakedef.h"
2004-12-24 08:45:56 +00:00
# include "winquake.h"
2015-05-14 03:06:58 +00:00
# ifdef DYNAMIC_SDL
# define SDL_MAJOR_VERSION 2
2017-01-24 10:27:39 +00:00
# define SDL_MINOR_VERSION 0
# define SDL_PATCHLEVEL 5
# define SDL_VERSIONNUM(X, Y, Z) ((X)*1000 + (Y)*100 + (Z))
# define SDL_COMPILEDVERSION SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
# define SDL_VERSION_ATLEAST(X, Y, Z) (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
2015-05-14 03:06:58 +00:00
//if we're not an sdl build, we probably want to link to sdl libraries dynamically or something.
# include <stdint.h>
# define SDL_AudioDeviceID uint32_t
# define SDL_INIT_AUDIO 0x00000010
# define SDL_INIT_NOPARACHUTE 0x00100000
# define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001
# define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002
# define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004
2017-09-20 11:27:13 +00:00
# define AUDIO_U8 0x0008
# define AUDIO_S8 0x8008
2015-05-14 03:06:58 +00:00
# define AUDIO_S16LSB 0x8010
# define AUDIO_S16MSB 0x9010
2017-09-20 11:27:13 +00:00
# define AUDIO_F32LSB 0x8120
# define AUDIO_F32MSB 0x9120
2015-05-14 03:06:58 +00:00
# if __BYTE_ORDER == __BIG_ENDIAN
# define AUDIO_S16SYS AUDIO_S16MSB
2017-09-20 11:27:13 +00:00
# define AUDIO_F32SYS AUDIO_F32MSB
2015-05-14 03:06:58 +00:00
# else
# define AUDIO_S16SYS AUDIO_S16LSB
2017-09-20 11:27:13 +00:00
# define AUDIO_F32SYS AUDIO_F32LSB
2015-05-14 03:06:58 +00:00
# endif
2017-01-24 10:27:39 +00:00
# define SDLCALL QDECL
2015-05-14 03:06:58 +00:00
typedef uint16_t SDL_AudioFormat ;
2017-01-24 10:27:39 +00:00
typedef void ( SDLCALL * SDL_AudioCallback ) ( void * userdata , uint8_t * stream , int len ) ;
2015-05-14 03:06:58 +00:00
typedef struct SDL_AudioSpec
{
int freq ;
SDL_AudioFormat format ;
uint8_t channels ;
uint8_t silence ;
uint16_t samples ;
uint16_t padding ;
uint32_t size ;
SDL_AudioCallback callback ;
void * userdata ;
} SDL_AudioSpec ;
2017-01-24 10:27:39 +00:00
static int ( SDLCALL * SDL_Init ) ( uint32_t flags ) ;
static int ( SDLCALL * SDL_InitSubSystem ) ( uint32_t flags ) ;
static SDL_AudioDeviceID ( SDLCALL * SDL_OpenAudioDevice ) ( const char * dev , int iscapture , const SDL_AudioSpec * desired , SDL_AudioSpec * obtained , int allowed_changes ) ;
static void ( SDLCALL * SDL_PauseAudioDevice ) ( SDL_AudioDeviceID fd , int pausestate ) ;
static void ( SDLCALL * SDL_LockAudioDevice ) ( SDL_AudioDeviceID fd ) ;
static void ( SDLCALL * SDL_UnlockAudioDevice ) ( SDL_AudioDeviceID fd ) ;
static int ( SDLCALL * SDL_CloseAudioDevice ) ( SDL_AudioDeviceID fd ) ;
static int ( SDLCALL * SDL_GetNumAudioDevices ) ( int iscapture ) ;
static const char * ( SDLCALL * SDL_GetAudioDeviceName ) ( int index , int iscapture ) ;
static const char * ( SDLCALL * SDL_GetError ) ( void ) ;
# if SDL_VERSION_ATLEAST(2,0,5)
static uint32_t ( SDLCALL * SDL_GetQueuedAudioSize ) ( SDL_AudioDeviceID dev ) ;
static uint32_t ( SDLCALL * SDL_DequeueAudio ) ( SDL_AudioDeviceID dev , void * data , uint32_t len ) ;
# endif
2015-05-14 03:06:58 +00:00
# else
2004-12-24 08:45:56 +00:00
# include <SDL.h>
2015-05-14 03:06:58 +00:00
# endif
2013-04-13 08:15:18 +00:00
# define SELFPAINT
2004-12-24 08:45:56 +00:00
2005-11-07 00:59:22 +00:00
//SDL calls a callback each time it needs to repaint the 'hardware' buffers
2015-05-14 03:06:58 +00:00
//This results in extra latency due it needing to buffer that much data.
2005-11-07 00:59:22 +00:00
//So we tell it a fairly pathetically sized buffer and try and get it to copy often
//hopefully this lowers sound latency, and has no suddenly starting sounds and stuff.
//It still has greater latency than direct access, of course.
2015-05-14 03:06:58 +00:00
//On the plus side, SDL calls the callback from another thread. this means we can set up some tiny buffer size, and if we're mixing inside the callback then you can actually get lower latency than waiting for an entire frame (yay rtlights)
static qboolean SSDL_InitAudio ( void )
{
static qboolean inited = false ;
# ifdef DYNAMIC_SDL
static dllfunction_t funcs [ ] =
{
{ ( void * ) & SDL_Init , " SDL_Init " } ,
{ ( void * ) & SDL_InitSubSystem , " SDL_InitSubSystem " } ,
{ ( void * ) & SDL_OpenAudioDevice , " SDL_OpenAudioDevice " } ,
{ ( void * ) & SDL_PauseAudioDevice , " SDL_PauseAudioDevice " } ,
{ ( void * ) & SDL_LockAudioDevice , " SDL_LockAudioDevice " } ,
{ ( void * ) & SDL_UnlockAudioDevice , " SDL_UnlockAudioDevice " } ,
{ ( void * ) & SDL_CloseAudioDevice , " SDL_CloseAudioDevice " } ,
{ ( void * ) & SDL_GetNumAudioDevices , " SDL_GetNumAudioDevices " } ,
{ ( void * ) & SDL_GetAudioDeviceName , " SDL_GetAudioDeviceName " } ,
{ ( void * ) & SDL_GetError , " SDL_GetError " } ,
2017-01-24 10:27:39 +00:00
# if SDL_VERSION_ATLEAST(2,0,5)
{ ( void * ) & SDL_GetQueuedAudioSize , " SDL_GetQueuedAudioSize " } ,
{ ( void * ) & SDL_DequeueAudio , " SDL_DequeueAudio " } ,
# endif
2015-05-14 03:06:58 +00:00
{ NULL , NULL }
} ;
static dllhandle_t * libsdl ;
if ( ! libsdl )
{
2016-11-02 08:01:21 +00:00
libsdl = Sys_LoadLibrary ( " libSDL2-2.0.so.0 " , funcs ) ;
if ( ! libsdl )
libsdl = Sys_LoadLibrary ( " libSDL2.so " , funcs ) ; //maybe they have a dev package installed that fixes this mess.
2017-01-24 10:27:39 +00:00
# ifdef _WIN32
if ( ! libsdl )
libsdl = Sys_LoadLibrary ( " SDL2 " , funcs ) ;
# endif
2015-05-14 03:06:58 +00:00
if ( libsdl )
SDL_Init ( SDL_INIT_NOPARACHUTE ) ;
else
{
Con_Printf ( " Unable to load libSDL2 library \n " ) ;
return false ;
}
}
# endif
if ( ! inited )
if ( SDL_InitSubSystem ( SDL_INIT_AUDIO | SDL_INIT_NOPARACHUTE ) )
{
Con_Printf ( " Couldn't initialize SDL audio subsystem (%s) \n " , SDL_GetError ( ) ) ;
return false ;
}
inited = true ;
return true ;
}
2005-11-07 00:59:22 +00:00
2004-12-24 08:45:56 +00:00
2005-06-14 04:52:10 +00:00
static void SSDL_Shutdown ( soundcardinfo_t * sc )
2004-12-09 23:37:29 +00:00
{
2013-04-13 08:15:18 +00:00
Con_DPrintf ( " Shutdown SDL sound \n " ) ;
2015-05-14 03:06:58 +00:00
# if SDL_MAJOR_VERSION >= 2
2017-09-20 11:27:13 +00:00
if ( sc - > audio_fd )
{
SDL_PauseAudioDevice ( sc - > audio_fd , 1 ) ;
SDL_CloseAudioDevice ( sc - > audio_fd ) ;
}
2015-05-14 03:06:58 +00:00
# else
2005-06-14 04:52:10 +00:00
SDL_CloseAudio ( ) ;
2015-05-14 03:06:58 +00:00
# endif
2013-04-13 08:15:18 +00:00
# ifndef SELFPAINT
2005-06-14 04:52:10 +00:00
if ( sc - > sn . buffer )
free ( sc - > sn . buffer ) ;
2013-04-13 08:15:18 +00:00
# endif
2005-06-14 04:52:10 +00:00
sc - > sn . buffer = NULL ;
2004-12-09 23:37:29 +00:00
}
2005-06-14 04:52:10 +00:00
static unsigned int SSDL_GetDMAPos ( soundcardinfo_t * sc )
2004-12-09 23:37:29 +00:00
{
2017-09-20 11:27:13 +00:00
sc - > sn . samplepos = sc - > snd_sent / sc - > sn . samplebytes ;
2005-01-12 08:38:31 +00:00
return sc - > sn . samplepos ;
}
2005-06-14 04:52:10 +00:00
//this function is called from inside SDL.
//transfer the 'dma' buffer into the buffer it requests.
2010-03-14 14:35:56 +00:00
static void VARGS SSDL_Paint ( void * userdata , qbyte * stream , int len )
2005-01-12 08:38:31 +00:00
{
2005-06-14 04:52:10 +00:00
soundcardinfo_t * sc = userdata ;
2013-04-13 08:15:18 +00:00
# ifdef SELFPAINT
sc - > sn . buffer = stream ;
2017-09-20 11:27:13 +00:00
sc - > sn . samples = len / sc - > sn . samplebytes ;
2013-04-13 08:15:18 +00:00
sc - > samplequeue = sc - > sn . samples ;
S_MixerThread ( sc ) ;
sc - > snd_sent + = len ;
# else
2017-09-20 11:27:13 +00:00
int buffersize = sc - > sn . samples * sc - > sn . samplebytes ;
2013-05-03 04:28:08 +00:00
2005-11-07 00:59:22 +00:00
if ( len > buffersize )
{
len = buffersize ; //whoa nellie!
}
if ( len + sc - > snd_sent % buffersize > buffersize )
2005-01-12 08:38:31 +00:00
{ //buffer will wrap, fill in the rest
2005-11-07 00:59:22 +00:00
memcpy ( stream , ( char * ) sc - > sn . buffer + ( sc - > snd_sent % buffersize ) , buffersize - ( sc - > snd_sent % buffersize ) ) ;
stream + = buffersize - sc - > snd_sent % buffersize ;
2010-12-13 23:13:16 +00:00
sc - > snd_sent + = buffersize - sc - > snd_sent % buffersize ;
2005-11-07 00:59:22 +00:00
len - = buffersize - ( sc - > snd_sent % buffersize ) ;
if ( len < 0 )
return ;
2005-01-12 08:38:31 +00:00
} //and finish from the start
2005-11-07 00:59:22 +00:00
memcpy ( stream , ( char * ) sc - > sn . buffer + ( sc - > snd_sent % buffersize ) , len ) ;
2005-06-14 04:52:10 +00:00
sc - > snd_sent + = len ;
2013-04-13 08:15:18 +00:00
# endif
2005-06-14 04:52:10 +00:00
}
2012-04-09 19:12:12 +00:00
static void * SSDL_LockBuffer ( soundcardinfo_t * sc , unsigned int * sampidx )
2005-06-14 04:52:10 +00:00
{
2015-05-14 03:06:58 +00:00
# if SDL_MAJOR_VERSION >= 2
SDL_LockAudioDevice ( sc - > audio_fd ) ;
# else
2005-06-14 04:52:10 +00:00
SDL_LockAudio ( ) ;
2015-05-14 03:06:58 +00:00
# endif
2005-11-07 00:59:22 +00:00
2005-06-14 04:52:10 +00:00
return sc - > sn . buffer ;
}
static void SSDL_UnlockBuffer ( soundcardinfo_t * sc , void * buffer )
{
2015-05-14 03:06:58 +00:00
# if SDL_MAJOR_VERSION >= 2
SDL_UnlockAudioDevice ( sc - > audio_fd ) ;
# else
2005-06-14 04:52:10 +00:00
SDL_UnlockAudio ( ) ;
2015-05-14 03:06:58 +00:00
# endif
2005-06-14 04:52:10 +00:00
}
2011-05-26 16:46:43 +00:00
static void SSDL_Submit ( soundcardinfo_t * sc , int start , int end )
2005-06-14 04:52:10 +00:00
{
//SDL will call SSDL_Paint to paint when it's time, and the sound buffer is always there...
2004-12-09 23:37:29 +00:00
}
2017-01-24 10:27:39 +00:00
static qboolean QDECL SDL_InitCard ( soundcardinfo_t * sc , const char * devicename )
2004-12-09 23:37:29 +00:00
{
2004-12-24 08:45:56 +00:00
SDL_AudioSpec desired , obtained ;
2015-05-14 03:06:58 +00:00
if ( ! SSDL_InitAudio ( ) )
2004-12-24 08:45:56 +00:00
{
2005-09-26 08:07:26 +00:00
Con_Printf ( " Couldn't initialize SDL audio subsystem \n " ) ;
2004-12-24 08:45:56 +00:00
return false ;
}
memset ( & desired , 0 , sizeof ( desired ) ) ;
desired . freq = sc - > sn . speed ;
2010-03-14 14:35:56 +00:00
desired . channels = sc - > sn . numchannels ; //fixme!
2013-04-13 08:15:18 +00:00
desired . samples = 0x0200 ; //'Good values seem to range between 512 and 8192 inclusive, depending on the application and CPU speed.'
2010-08-28 17:14:38 +00:00
desired . callback = ( void * ) SSDL_Paint ;
2005-06-14 04:52:10 +00:00
desired . userdata = sc ;
2005-11-07 00:59:22 +00:00
memcpy ( & obtained , & desired , sizeof ( obtained ) ) ;
2005-01-12 08:38:31 +00:00
2015-05-14 03:06:58 +00:00
# if SDL_MAJOR_VERSION >= 2
2017-09-20 11:27:13 +00:00
desired . format = AUDIO_F32SYS ; //most modern audio APIs favour float audio nowadays.
sc - > audio_fd = SDL_OpenAudioDevice ( devicename , false , & desired , & obtained , ( sndcardinfo ? 0 : SDL_AUDIO_ALLOW_FREQUENCY_CHANGE ) | SDL_AUDIO_ALLOW_CHANNELS_CHANGE | SDL_AUDIO_ALLOW_FORMAT_CHANGE ) ;
2015-05-14 03:06:58 +00:00
if ( ! sc - > audio_fd )
2013-04-02 05:18:17 +00:00
{
2015-05-14 03:06:58 +00:00
Con_Printf ( " SDL_OpenAudioDevice(%s) failed: couldn't open sound device (%s). \n " , devicename ? devicename : " default " , SDL_GetError ( ) ) ;
2013-04-02 05:18:17 +00:00
return false ;
}
2017-09-20 11:27:13 +00:00
if ( obtained . format ! = AUDIO_U8 & & obtained . format ! = AUDIO_S8 & & obtained . format ! = AUDIO_S16SYS & & obtained . format ! = AUDIO_F32SYS )
{ //can't cope with that... try again but force the format (so SDL converts)
SDL_CloseAudioDevice ( sc - > audio_fd ) ;
sc - > audio_fd = SDL_OpenAudioDevice ( devicename , false , & desired , & obtained , ( sndcardinfo ? 0 : SDL_AUDIO_ALLOW_FREQUENCY_CHANGE ) | SDL_AUDIO_ALLOW_CHANNELS_CHANGE ) ;
}
2015-05-14 03:06:58 +00:00
if ( devicename )
Con_Printf ( " Initing SDL audio device '%s'. \n " , devicename ) ;
else
Con_Printf ( " Initing default SDL audio device. \n " ) ;
2013-04-02 05:18:17 +00:00
# else
2017-09-20 11:27:13 +00:00
desired . format = AUDIO_S16SYS ;
2015-05-14 03:06:58 +00:00
if ( sndcardinfo )
return false ; //SDL1 only supports opening one audio device at a time. the existing one might not be sdl, but I don't care.
2017-09-20 11:27:13 +00:00
if ( SDL_OpenAudio ( & desired , & obtained ) < 0 )
2004-12-24 08:45:56 +00:00
{
2015-05-14 03:06:58 +00:00
Con_Printf ( " SDL_OpenAudio failed: couldn't open sound device (%s). \n " , SDL_GetError ( ) ) ;
2004-12-24 08:45:56 +00:00
return false ;
}
2015-05-14 03:06:58 +00:00
Con_Printf ( " Initing default SDL audio device. \n " ) ;
2013-04-02 05:18:17 +00:00
# endif
2005-01-12 08:38:31 +00:00
sc - > sn . numchannels = obtained . channels ;
2005-11-01 23:25:15 +00:00
sc - > sn . speed = obtained . freq ;
2005-11-07 00:59:22 +00:00
sc - > sn . samples = 32768 ; //*sc->sn.numchannels; //doesn't really matter, so long as it's higher than obtained.samples
2017-09-20 11:27:13 +00:00
switch ( obtained . format )
{
case AUDIO_U8 :
sc - > sn . samplebytes = 1 ;
sc - > sn . sampleformat = QSF_U8 ;
break ;
case AUDIO_S8 :
sc - > sn . samplebytes = 1 ;
sc - > sn . sampleformat = QSF_S8 ;
break ;
case AUDIO_S16SYS :
sc - > sn . samplebytes = 2 ;
sc - > sn . sampleformat = QSF_S16 ;
break ;
case AUDIO_F32SYS :
sc - > sn . samplebytes = 4 ;
sc - > sn . sampleformat = QSF_F32 ;
break ;
default :
//unsupported. shouldn't have obtained that.
# if SDL_MAJOR_VERSION >= 2
SDL_CloseAudioDevice ( sc - > audio_fd ) ;
sc - > audio_fd = 0 ;
# else
SDL_CloseAudio ( ) ;
# endif
break ;
}
2013-04-13 08:15:18 +00:00
# ifdef SELFPAINT
sc - > selfpainting = true ;
# endif
2005-11-07 00:59:22 +00:00
Con_DPrintf ( " channels: %i \n " , sc - > sn . numchannels ) ;
Con_DPrintf ( " Speed: %i \n " , sc - > sn . speed ) ;
2017-09-20 11:27:13 +00:00
Con_DPrintf ( " Samplebits: %i \n " , sc - > sn . samplebytes * 8 ) ;
2005-11-07 00:59:22 +00:00
Con_DPrintf ( " SDLSamples: %i (low for latency) \n " , obtained . samples ) ;
Con_DPrintf ( " FakeSamples: %i \n " , sc - > sn . samples ) ;
2013-04-13 08:15:18 +00:00
# ifndef SELFPAINT
2017-09-20 11:27:13 +00:00
sc - > sn . buffer = malloc ( sc - > sn . samples * sc - > sn . samplebytes ) ;
2013-04-13 08:15:18 +00:00
# endif
2005-11-07 00:59:22 +00:00
Con_DPrintf ( " Got sound %i-%i \n " , obtained . freq , obtained . format ) ;
2004-12-09 23:37:29 +00:00
2005-06-14 04:52:10 +00:00
sc - > Lock = SSDL_LockBuffer ;
sc - > Unlock = SSDL_UnlockBuffer ;
sc - > Submit = SSDL_Submit ;
sc - > Shutdown = SSDL_Shutdown ;
sc - > GetDMAPos = SSDL_GetDMAPos ;
2015-05-14 03:06:58 +00:00
# if SDL_MAJOR_VERSION >= 2
SDL_PauseAudioDevice ( sc - > audio_fd , 0 ) ;
# else
2005-11-07 00:59:22 +00:00
SDL_PauseAudio ( 0 ) ;
2015-05-14 03:06:58 +00:00
# endif
2005-11-07 00:59:22 +00:00
2005-06-14 04:52:10 +00:00
return true ;
2004-12-09 23:37:29 +00:00
}
2005-01-12 08:38:31 +00:00
2015-05-14 03:06:58 +00:00
# define SDRVNAME "SDL"
static qboolean QDECL SDL_Enumerate ( void ( QDECL * cb ) ( const char * drivername , const char * devicecode , const char * readablename ) )
{
# if SDL_MAJOR_VERSION >= 2
int max , i ;
if ( SSDL_InitAudio ( ) )
{
max = SDL_GetNumAudioDevices ( false ) ;
for ( i = 0 ; i < max ; i + + )
{
const char * devname = SDL_GetAudioDeviceName ( i , false ) ;
if ( devname )
2017-01-24 10:27:39 +00:00
cb ( SDRVNAME , devname , va ( " SDL:%s " , devname ) ) ;
2015-05-14 03:06:58 +00:00
}
}
return true ;
# else
return false ;
# endif
}
sounddriver_t SDL_Output =
{
SDRVNAME ,
SDL_InitCard ,
SDL_Enumerate
} ;
2017-01-24 10:27:39 +00:00
# if SDL_VERSION_ATLEAST(2,0,5) && defined(VOICECHAT)
//Requires SDL 2.0.5+ supposedly.
//Bugging out for me on windows, with really low audio levels. looks like there's been some float->int conversion without a multiplier. asking for float audio gives stupidly low values too.
typedef struct
{
SDL_AudioDeviceID dev ;
} sdlcapture_t ;
static void QDECL SDL_Capture_Start ( void * ctx )
{
sdlcapture_t * d = ctx ;
2017-01-24 10:33:29 +00:00
SDL_PauseAudioDevice ( d - > dev , false ) ;
2017-01-24 10:27:39 +00:00
}
static void QDECL SDL_Capture_Stop ( void * ctx )
{
sdlcapture_t * d = ctx ;
2017-01-24 10:33:29 +00:00
SDL_PauseAudioDevice ( d - > dev , true ) ;
2017-01-24 10:27:39 +00:00
}
static void QDECL SDL_Capture_Shutdown ( void * ctx )
{
sdlcapture_t * d = ctx ;
SDL_CloseAudioDevice ( d - > dev ) ;
Z_Free ( d ) ;
}
static qboolean QDECL SDL_Capture_Enumerate ( void ( QDECL * callback ) ( const char * drivername , const char * devicecode , const char * readablename ) )
{
int i , count ;
if ( SSDL_InitAudio ( ) )
{
count = SDL_GetNumAudioDevices ( true ) ;
for ( i = 0 ; i < count ; i + + )
{
const char * name = SDL_GetAudioDeviceName ( i , true ) ;
if ( name )
callback ( SDRVNAME , name , va ( " SDL:%s " , name ) ) ;
}
}
return true ;
}
static void * QDECL SDL_Capture_Init ( int rate , const char * devname )
{
SDL_AudioSpec want , have ;
sdlcapture_t c , * r ;
memset ( & want , 0 , sizeof ( want ) ) ;
want . freq = rate ;
want . format = AUDIO_S16SYS ;
want . channels = 1 ;
want . samples = 256 ; //this seems to be chunk sizes rather than total buffer size, so lets keep it reasonably small for lower latencies
want . callback = NULL ;
c . dev = SDL_OpenAudioDevice ( devname , true , & want , & have , 0 ) ;
if ( ! c . dev ) //failed?
return NULL ;
r = Z_Malloc ( sizeof ( * r ) ) ;
* r = c ;
return r ;
}
2005-11-07 00:59:22 +00:00
2017-01-24 10:27:39 +00:00
/*minbytes is a hint to not bother wasting time*/
static unsigned int QDECL SDL_Capture_Update ( void * ctx , unsigned char * buffer , unsigned int minbytes , unsigned int maxbytes )
{
sdlcapture_t * c = ctx ;
unsigned int queuedsize = SDL_GetQueuedAudioSize ( c - > dev ) ;
if ( queuedsize < minbytes )
return 0 ;
if ( queuedsize > maxbytes )
queuedsize = maxbytes ;
queuedsize = SDL_DequeueAudio ( c - > dev , buffer , queuedsize ) ;
return queuedsize ;
}
snd_capture_driver_t SDL_Capture =
{
1 ,
SDRVNAME ,
SDL_Capture_Enumerate ,
SDL_Capture_Init ,
SDL_Capture_Start ,
SDL_Capture_Update ,
SDL_Capture_Stop ,
SDL_Capture_Shutdown
} ;
# endif