Skip to content

Commit

Permalink
audio: Renamed some internal driver symbols in various targets.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Aug 12, 2016
1 parent 8f0af77 commit 6f4bcd2
Show file tree
Hide file tree
Showing 9 changed files with 101 additions and 104 deletions.
29 changes: 14 additions & 15 deletions src/audio/SDL_audio.c
Expand Up @@ -46,7 +46,7 @@ extern AudioBootStrap QSAAUDIO_bootstrap;
extern AudioBootStrap SUNAUDIO_bootstrap;
extern AudioBootStrap ARTS_bootstrap;
extern AudioBootStrap ESD_bootstrap;
extern AudioBootStrap NACLAUD_bootstrap;
extern AudioBootStrap NACLAUDIO_bootstrap;
extern AudioBootStrap NAS_bootstrap;
extern AudioBootStrap XAUDIO2_bootstrap;
extern AudioBootStrap DSOUND_bootstrap;
Expand All @@ -55,17 +55,16 @@ extern AudioBootStrap PAUDIO_bootstrap;
extern AudioBootStrap HAIKUAUDIO_bootstrap;
extern AudioBootStrap COREAUDIO_bootstrap;
extern AudioBootStrap SNDMGR_bootstrap;
extern AudioBootStrap DISKAUD_bootstrap;
extern AudioBootStrap DUMMYAUD_bootstrap;
extern AudioBootStrap DCAUD_bootstrap;
extern AudioBootStrap DISKAUDIO_bootstrap;
extern AudioBootStrap DUMMYAUDIO_bootstrap;
extern AudioBootStrap DCAUDIO_bootstrap;
extern AudioBootStrap DART_bootstrap;
extern AudioBootStrap NDSAUD_bootstrap;
extern AudioBootStrap NDSAUDIO_bootstrap;
extern AudioBootStrap FUSIONSOUND_bootstrap;
extern AudioBootStrap ANDROIDAUD_bootstrap;
extern AudioBootStrap PSPAUD_bootstrap;
extern AudioBootStrap ANDROIDAUDIO_bootstrap;
extern AudioBootStrap PSPAUDIO_bootstrap;
extern AudioBootStrap SNDIO_bootstrap;
extern AudioBootStrap EmscriptenAudio_bootstrap;

extern AudioBootStrap EMSCRIPTENAUDIO_bootstrap;

/* Available audio drivers */
static const AudioBootStrap *const bootstrap[] = {
Expand Down Expand Up @@ -97,7 +96,7 @@ static const AudioBootStrap *const bootstrap[] = {
&ESD_bootstrap,
#endif
#if SDL_AUDIO_DRIVER_NACL
&NACLAUD_bootstrap,
&NACLAUDIO_bootstrap,
#endif
#if SDL_AUDIO_DRIVER_NAS
&NAS_bootstrap,
Expand All @@ -121,22 +120,22 @@ static const AudioBootStrap *const bootstrap[] = {
&COREAUDIO_bootstrap,
#endif
#if SDL_AUDIO_DRIVER_DISK
&DISKAUD_bootstrap,
&DISKAUDIO_bootstrap,
#endif
#if SDL_AUDIO_DRIVER_DUMMY
&DUMMYAUD_bootstrap,
&DUMMYAUDIO_bootstrap,
#endif
#if SDL_AUDIO_DRIVER_FUSIONSOUND
&FUSIONSOUND_bootstrap,
#endif
#if SDL_AUDIO_DRIVER_ANDROID
&ANDROIDAUD_bootstrap,
&ANDROIDAUDIO_bootstrap,
#endif
#if SDL_AUDIO_DRIVER_PSP
&PSPAUD_bootstrap,
&PSPAUDIO_bootstrap,
#endif
#if SDL_AUDIO_DRIVER_EMSCRIPTEN
&EmscriptenAudio_bootstrap,
&EMSCRIPTENAUDIO_bootstrap,
#endif
NULL
};
Expand Down
34 changes: 17 additions & 17 deletions src/audio/android/SDL_androidaudio.c
Expand Up @@ -37,7 +37,7 @@ static SDL_AudioDevice* audioDevice = NULL;
static SDL_AudioDevice* captureDevice = NULL;

static int
AndroidAUD_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
ANDROIDAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
{
SDL_AudioFormat test_format;

Expand Down Expand Up @@ -96,31 +96,31 @@ AndroidAUD_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
}

static void
AndroidAUD_PlayDevice(_THIS)
ANDROIDAUDIO_PlayDevice(_THIS)
{
Android_JNI_WriteAudioBuffer();
}

static Uint8 *
AndroidAUD_GetDeviceBuf(_THIS)
ANDROIDAUDIO_GetDeviceBuf(_THIS)
{
return Android_JNI_GetAudioBuffer();
}

static int
AndroidAUD_CaptureFromDevice(_THIS, void *buffer, int buflen)
ANDROIDAUDIO_CaptureFromDevice(_THIS, void *buffer, int buflen)
{
return Android_JNI_CaptureAudioBuffer(buffer, buflen);
}

static void
AndroidAUD_FlushCapture(_THIS)
ANDROIDAUDIO_FlushCapture(_THIS)
{
Android_JNI_FlushCapturedAudio();
}

static void
AndroidAUD_CloseDevice(_THIS)
ANDROIDAUDIO_CloseDevice(_THIS)
{
/* At this point SDL_CloseAudioDevice via close_audio_device took care of terminating the audio thread
so it's safe to terminate the Java side buffer and AudioTrack
Expand All @@ -137,15 +137,15 @@ AndroidAUD_CloseDevice(_THIS)
}

static int
AndroidAUD_Init(SDL_AudioDriverImpl * impl)
ANDROIDAUDIO_Init(SDL_AudioDriverImpl * impl)
{
/* Set the function pointers */
impl->OpenDevice = AndroidAUD_OpenDevice;
impl->PlayDevice = AndroidAUD_PlayDevice;
impl->GetDeviceBuf = AndroidAUD_GetDeviceBuf;
impl->CloseDevice = AndroidAUD_CloseDevice;
impl->CaptureFromDevice = AndroidAUD_CaptureFromDevice;
impl->FlushCapture = AndroidAUD_FlushCapture;
impl->OpenDevice = ANDROIDAUDIO_OpenDevice;
impl->PlayDevice = ANDROIDAUDIO_PlayDevice;
impl->GetDeviceBuf = ANDROIDAUDIO_GetDeviceBuf;
impl->CloseDevice = ANDROIDAUDIO_CloseDevice;
impl->CaptureFromDevice = ANDROIDAUDIO_CaptureFromDevice;
impl->FlushCapture = ANDROIDAUDIO_FlushCapture;

/* and the capabilities */
impl->HasCaptureSupport = SDL_TRUE;
Expand All @@ -155,12 +155,12 @@ AndroidAUD_Init(SDL_AudioDriverImpl * impl)
return 1; /* this audio target is available. */
}

AudioBootStrap ANDROIDAUD_bootstrap = {
"android", "SDL Android audio driver", AndroidAUD_Init, 0
AudioBootStrap ANDROIDAUDIO_bootstrap = {
"android", "SDL Android audio driver", ANDROIDAUDIO_Init, 0
};

/* Pause (block) all non already paused audio devices by taking their mixer lock */
void AndroidAUD_PauseDevices(void)
void ANDROIDAUDIO_PauseDevices(void)
{
/* TODO: Handle multiple devices? */
struct SDL_PrivateAudioData *private;
Expand Down Expand Up @@ -192,7 +192,7 @@ void AndroidAUD_PauseDevices(void)
}

/* Resume (unblock) all non already paused audio devices by releasing their mixer lock */
void AndroidAUD_ResumeDevices(void)
void ANDROIDAUDIO_ResumeDevices(void)
{
/* TODO: Handle multiple devices? */
struct SDL_PrivateAudioData *private;
Expand Down
2 changes: 0 additions & 2 deletions src/audio/android/SDL_androidaudio.h
Expand Up @@ -34,8 +34,6 @@ struct SDL_PrivateAudioData
int resume;
};

static void AndroidAUD_CloseDevice(_THIS);

#endif /* _SDL_androidaudio_h */

/* vi: set ts=4 sw=4 expandtab: */
38 changes: 19 additions & 19 deletions src/audio/disk/SDL_diskaudio.c
Expand Up @@ -44,13 +44,13 @@

/* This function waits until it is possible to write a full sound buffer */
static void
DISKAUD_WaitDevice(_THIS)
DISKAUDIO_WaitDevice(_THIS)
{
SDL_Delay(this->hidden->io_delay);
}

static void
DISKAUD_PlayDevice(_THIS)
DISKAUDIO_PlayDevice(_THIS)
{
const size_t written = SDL_RWwrite(this->hidden->io,
this->hidden->mixbuf,
Expand All @@ -66,13 +66,13 @@ DISKAUD_PlayDevice(_THIS)
}

static Uint8 *
DISKAUD_GetDeviceBuf(_THIS)
DISKAUDIO_GetDeviceBuf(_THIS)
{
return (this->hidden->mixbuf);
}

static int
DISKAUD_CaptureFromDevice(_THIS, void *buffer, int buflen)
DISKAUDIO_CaptureFromDevice(_THIS, void *buffer, int buflen)
{
struct SDL_PrivateAudioData *h = this->hidden;
const int origbuflen = buflen;
Expand All @@ -96,14 +96,14 @@ DISKAUD_CaptureFromDevice(_THIS, void *buffer, int buflen)
}

static void
DISKAUD_FlushCapture(_THIS)
DISKAUDIO_FlushCapture(_THIS)
{
/* no op...we don't advance the file pointer or anything. */
}


static void
DISKAUD_CloseDevice(_THIS)
DISKAUDIO_CloseDevice(_THIS)
{
if (this->hidden->io != NULL) {
SDL_RWclose(this->hidden->io);
Expand All @@ -126,7 +126,7 @@ get_filename(const int iscapture, const char *devname)
}

static int
DISKAUD_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
DISKAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
{
/* handle != NULL means "user specified the placeholder name on the fake detected device list" */
const char *fname = get_filename(iscapture, handle ? NULL : devname);
Expand Down Expand Up @@ -172,34 +172,34 @@ DISKAUD_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
}

static void
DISKAUD_DetectDevices(void)
DISKAUDIO_DetectDevices(void)
{
SDL_AddAudioDevice(SDL_FALSE, DEFAULT_OUTPUT_DEVNAME, (void *) 0x1);
SDL_AddAudioDevice(SDL_TRUE, DEFAULT_INPUT_DEVNAME, (void *) 0x2);
}

static int
DISKAUD_Init(SDL_AudioDriverImpl * impl)
DISKAUDIO_Init(SDL_AudioDriverImpl * impl)
{
/* Set the function pointers */
impl->OpenDevice = DISKAUD_OpenDevice;
impl->WaitDevice = DISKAUD_WaitDevice;
impl->PlayDevice = DISKAUD_PlayDevice;
impl->GetDeviceBuf = DISKAUD_GetDeviceBuf;
impl->CaptureFromDevice = DISKAUD_CaptureFromDevice;
impl->FlushCapture = DISKAUD_FlushCapture;
impl->OpenDevice = DISKAUDIO_OpenDevice;
impl->WaitDevice = DISKAUDIO_WaitDevice;
impl->PlayDevice = DISKAUDIO_PlayDevice;
impl->GetDeviceBuf = DISKAUDIO_GetDeviceBuf;
impl->CaptureFromDevice = DISKAUDIO_CaptureFromDevice;
impl->FlushCapture = DISKAUDIO_FlushCapture;

impl->CloseDevice = DISKAUD_CloseDevice;
impl->DetectDevices = DISKAUD_DetectDevices;
impl->CloseDevice = DISKAUDIO_CloseDevice;
impl->DetectDevices = DISKAUDIO_DetectDevices;

impl->AllowsArbitraryDeviceNames = 1;
impl->HasCaptureSupport = SDL_TRUE;

return 1; /* this audio target is available. */
}

AudioBootStrap DISKAUD_bootstrap = {
"disk", "direct-to-disk audio", DISKAUD_Init, 1
AudioBootStrap DISKAUDIO_bootstrap = {
"disk", "direct-to-disk audio", DISKAUDIO_Init, 1
};

#endif /* SDL_AUDIO_DRIVER_DISK */
Expand Down
14 changes: 7 additions & 7 deletions src/audio/dummy/SDL_dummyaudio.c
Expand Up @@ -28,13 +28,13 @@
#include "SDL_dummyaudio.h"

static int
DUMMYAUD_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
DUMMYAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
{
return 0; /* always succeeds. */
}

static int
DUMMYAUD_CaptureFromDevice(_THIS, void *buffer, int buflen)
DUMMYAUDIO_CaptureFromDevice(_THIS, void *buffer, int buflen)
{
/* Delay to make this sort of simulate real audio input. */
SDL_Delay((this->spec.samples * 1000) / this->spec.freq);
Expand All @@ -45,11 +45,11 @@ DUMMYAUD_CaptureFromDevice(_THIS, void *buffer, int buflen)
}

static int
DUMMYAUD_Init(SDL_AudioDriverImpl * impl)
DUMMYAUDIO_Init(SDL_AudioDriverImpl * impl)
{
/* Set the function pointers */
impl->OpenDevice = DUMMYAUD_OpenDevice;
impl->CaptureFromDevice = DUMMYAUD_CaptureFromDevice;
impl->OpenDevice = DUMMYAUDIO_OpenDevice;
impl->CaptureFromDevice = DUMMYAUDIO_CaptureFromDevice;

impl->OnlyHasDefaultOutputDevice = 1;
impl->OnlyHasDefaultCaptureDevice = 1;
Expand All @@ -58,8 +58,8 @@ DUMMYAUD_Init(SDL_AudioDriverImpl * impl)
return 1; /* this audio target is available. */
}

AudioBootStrap DUMMYAUD_bootstrap = {
"dummy", "SDL dummy audio driver", DUMMYAUD_Init, 1
AudioBootStrap DUMMYAUDIO_bootstrap = {
"dummy", "SDL dummy audio driver", DUMMYAUDIO_Init, 1
};

/* vi: set ts=4 sw=4 expandtab: */
14 changes: 7 additions & 7 deletions src/audio/emscripten/SDL_emscriptenaudio.c
Expand Up @@ -196,7 +196,7 @@ HandleCaptureProcess(_THIS)


static void
Emscripten_CloseDevice(_THIS)
EMSCRIPTENAUDIO_CloseDevice(_THIS)
{
EM_ASM_({
if ($0) {
Expand Down Expand Up @@ -233,7 +233,7 @@ Emscripten_CloseDevice(_THIS)
}

static int
Emscripten_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
EMSCRIPTENAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
{
SDL_bool valid_format = SDL_FALSE;
SDL_AudioFormat test_format;
Expand Down Expand Up @@ -380,11 +380,11 @@ Emscripten_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
}

static int
Emscripten_Init(SDL_AudioDriverImpl * impl)
EMSCRIPTENAUDIO_Init(SDL_AudioDriverImpl * impl)
{
/* Set the function pointers */
impl->OpenDevice = Emscripten_OpenDevice;
impl->CloseDevice = Emscripten_CloseDevice;
impl->OpenDevice = EMSCRIPTENAUDIO_OpenDevice;
impl->CloseDevice = EMSCRIPTENAUDIO_CloseDevice;

impl->OnlyHasDefaultOutputDevice = 1;

Expand Down Expand Up @@ -421,8 +421,8 @@ Emscripten_Init(SDL_AudioDriverImpl * impl)
return available;
}

AudioBootStrap EmscriptenAudio_bootstrap = {
"emscripten", "SDL emscripten audio driver", Emscripten_Init, 0
AudioBootStrap EMSCRIPTENAUDIO_bootstrap = {
"emscripten", "SDL emscripten audio driver", EMSCRIPTENAUDIO_Init, 0
};

#endif /* SDL_AUDIO_DRIVER_EMSCRIPTEN */
Expand Down

0 comments on commit 6f4bcd2

Please sign in to comment.