Return-Path: X-Original-To: apmail-corinthia-commits-archive@minotaur.apache.org Delivered-To: apmail-corinthia-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 93382174D1 for ; Mon, 23 Mar 2015 16:19:58 +0000 (UTC) Received: (qmail 6163 invoked by uid 500); 23 Mar 2015 16:19:45 -0000 Delivered-To: apmail-corinthia-commits-archive@corinthia.apache.org Received: (qmail 6118 invoked by uid 500); 23 Mar 2015 16:19:45 -0000 Mailing-List: contact commits-help@corinthia.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@corinthia.incubator.apache.org Delivered-To: mailing list commits@corinthia.incubator.apache.org Received: (qmail 6065 invoked by uid 99); 23 Mar 2015 16:19:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Mar 2015 16:19:45 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 23 Mar 2015 16:19:10 +0000 Received: (qmail 2781 invoked by uid 99); 23 Mar 2015 16:18:50 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Mar 2015 16:18:50 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D9B5DE1826; Mon, 23 Mar 2015 16:18:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jani@apache.org To: commits@corinthia.incubator.apache.org Date: Mon, 23 Mar 2015 16:18:56 -0000 Message-Id: <8fbc5888e19349b1b0ebc72863248dc6@git.apache.org> In-Reply-To: <59c3409626e945c1aed43ae72533e25e@git.apache.org> References: <59c3409626e945c1aed43ae72533e25e@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [08/83] [abbrv] [partial] incubator-corinthia git commit: removed SDL2 X-Virus-Checked: Checked by ClamAV on apache.org http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/d1484ae0/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/esd/SDL_esdaudio.c ---------------------------------------------------------------------- diff --git a/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/esd/SDL_esdaudio.c b/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/esd/SDL_esdaudio.c deleted file mode 100644 index e675272..0000000 --- a/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/esd/SDL_esdaudio.c +++ /dev/null @@ -1,345 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_AUDIO_DRIVER_ESD - -/* Allow access to an ESD network stream mixing buffer */ - -#include -#include -#include -#include -#include - -#include "SDL_timer.h" -#include "SDL_audio.h" -#include "../SDL_audiomem.h" -#include "../SDL_audio_c.h" -#include "SDL_esdaudio.h" - -#ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC -#include "SDL_name.h" -#include "SDL_loadso.h" -#else -#define SDL_NAME(X) X -#endif - -#ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC - -static const char *esd_library = SDL_AUDIO_DRIVER_ESD_DYNAMIC; -static void *esd_handle = NULL; - -static int (*SDL_NAME(esd_open_sound)) (const char *host); -static int (*SDL_NAME(esd_close)) (int esd); -static int (*SDL_NAME(esd_play_stream)) (esd_format_t format, int rate, - const char *host, const char *name); - -#define SDL_ESD_SYM(x) { #x, (void **) (char *) &SDL_NAME(x) } -static struct -{ - const char *name; - void **func; -} const esd_functions[] = { - SDL_ESD_SYM(esd_open_sound), - SDL_ESD_SYM(esd_close), SDL_ESD_SYM(esd_play_stream), -}; - -#undef SDL_ESD_SYM - -static void -UnloadESDLibrary() -{ - if (esd_handle != NULL) { - SDL_UnloadObject(esd_handle); - esd_handle = NULL; - } -} - -static int -LoadESDLibrary(void) -{ - int i, retval = -1; - - if (esd_handle == NULL) { - esd_handle = SDL_LoadObject(esd_library); - if (esd_handle) { - retval = 0; - for (i = 0; i < SDL_arraysize(esd_functions); ++i) { - *esd_functions[i].func = - SDL_LoadFunction(esd_handle, esd_functions[i].name); - if (!*esd_functions[i].func) { - retval = -1; - UnloadESDLibrary(); - break; - } - } - } - } - return retval; -} - -#else - -static void -UnloadESDLibrary() -{ - return; -} - -static int -LoadESDLibrary(void) -{ - return 0; -} - -#endif /* SDL_AUDIO_DRIVER_ESD_DYNAMIC */ - - -/* This function waits until it is possible to write a full sound buffer */ -static void -ESD_WaitDevice(_THIS) -{ - Sint32 ticks; - - /* Check to see if the thread-parent process is still alive */ - { - static int cnt = 0; - /* Note that this only works with thread implementations - that use a different process id for each thread. - */ - /* Check every 10 loops */ - if (this->hidden->parent && (((++cnt) % 10) == 0)) { - if (kill(this->hidden->parent, 0) < 0 && errno == ESRCH) { - this->enabled = 0; - } - } - } - - /* Use timer for general audio synchronization */ - ticks = ((Sint32) (this->hidden->next_frame - SDL_GetTicks())) - FUDGE_TICKS; - if (ticks > 0) { - SDL_Delay(ticks); - } -} - -static void -ESD_PlayDevice(_THIS) -{ - int written = 0; - - /* Write the audio data, checking for EAGAIN on broken audio drivers */ - do { - written = write(this->hidden->audio_fd, - this->hidden->mixbuf, this->hidden->mixlen); - if ((written < 0) && ((errno == 0) || (errno == EAGAIN))) { - SDL_Delay(1); /* Let a little CPU time go by */ - } - } while ((written < 0) && - ((errno == 0) || (errno == EAGAIN) || (errno == EINTR))); - - /* Set the next write frame */ - this->hidden->next_frame += this->hidden->frame_ticks; - - /* If we couldn't write, assume fatal error for now */ - if (written < 0) { - this->enabled = 0; - } -} - -static Uint8 * -ESD_GetDeviceBuf(_THIS) -{ - return (this->hidden->mixbuf); -} - -static void -ESD_CloseDevice(_THIS) -{ - if (this->hidden != NULL) { - SDL_FreeAudioMem(this->hidden->mixbuf); - this->hidden->mixbuf = NULL; - if (this->hidden->audio_fd >= 0) { - SDL_NAME(esd_close) (this->hidden->audio_fd); - this->hidden->audio_fd = -1; - } - - SDL_free(this->hidden); - this->hidden = NULL; - } -} - -/* Try to get the name of the program */ -static char * -get_progname(void) -{ - char *progname = NULL; -#ifdef __LINUX__ - FILE *fp; - static char temp[BUFSIZ]; - - SDL_snprintf(temp, SDL_arraysize(temp), "/proc/%d/cmdline", getpid()); - fp = fopen(temp, "r"); - if (fp != NULL) { - if (fgets(temp, sizeof(temp) - 1, fp)) { - progname = SDL_strrchr(temp, '/'); - if (progname == NULL) { - progname = temp; - } else { - progname = progname + 1; - } - } - fclose(fp); - } -#endif - return (progname); -} - - -static int -ESD_OpenDevice(_THIS, const char *devname, int iscapture) -{ - esd_format_t format = (ESD_STREAM | ESD_PLAY); - SDL_AudioFormat test_format = 0; - int found = 0; - - /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { - return SDL_OutOfMemory(); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - this->hidden->audio_fd = -1; - - /* Convert audio spec to the ESD audio format */ - /* Try for a closest match on audio format */ - for (test_format = SDL_FirstAudioFormat(this->spec.format); - !found && test_format; test_format = SDL_NextAudioFormat()) { -#ifdef DEBUG_AUDIO - fprintf(stderr, "Trying format 0x%4.4x\n", test_format); -#endif - found = 1; - switch (test_format) { - case AUDIO_U8: - format |= ESD_BITS8; - break; - case AUDIO_S16SYS: - format |= ESD_BITS16; - break; - default: - found = 0; - break; - } - } - - if (!found) { - ESD_CloseDevice(this); - return SDL_SetError("Couldn't find any hardware audio formats"); - } - - if (this->spec.channels == 1) { - format |= ESD_MONO; - } else { - format |= ESD_STEREO; - } -#if 0 - this->spec.samples = ESD_BUF_SIZE; /* Darn, no way to change this yet */ -#endif - - /* Open a connection to the ESD audio server */ - this->hidden->audio_fd = - SDL_NAME(esd_play_stream) (format, this->spec.freq, NULL, - get_progname()); - - if (this->hidden->audio_fd < 0) { - ESD_CloseDevice(this); - return SDL_SetError("Couldn't open ESD connection"); - } - - /* Calculate the final parameters for this audio specification */ - SDL_CalculateAudioSpec(&this->spec); - this->hidden->frame_ticks = - (float) (this->spec.samples * 1000) / this->spec.freq; - this->hidden->next_frame = SDL_GetTicks() + this->hidden->frame_ticks; - - /* Allocate mixing buffer */ - this->hidden->mixlen = this->spec.size; - this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); - if (this->hidden->mixbuf == NULL) { - ESD_CloseDevice(this); - return SDL_OutOfMemory(); - } - SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); - - /* Get the parent process id (we're the parent of the audio thread) */ - this->hidden->parent = getpid(); - - /* We're ready to rock and roll. :-) */ - return 0; -} - -static void -ESD_Deinitialize(void) -{ - UnloadESDLibrary(); -} - -static int -ESD_Init(SDL_AudioDriverImpl * impl) -{ - if (LoadESDLibrary() < 0) { - return 0; - } else { - int connection = 0; - - /* Don't start ESD if it's not running */ - SDL_setenv("ESD_NO_SPAWN", "1", 0); - - connection = SDL_NAME(esd_open_sound) (NULL); - if (connection < 0) { - UnloadESDLibrary(); - SDL_SetError("ESD: esd_open_sound failed (no audio server?)"); - return 0; - } - SDL_NAME(esd_close) (connection); - } - - /* Set the function pointers */ - impl->OpenDevice = ESD_OpenDevice; - impl->PlayDevice = ESD_PlayDevice; - impl->WaitDevice = ESD_WaitDevice; - impl->GetDeviceBuf = ESD_GetDeviceBuf; - impl->CloseDevice = ESD_CloseDevice; - impl->Deinitialize = ESD_Deinitialize; - impl->OnlyHasDefaultOutputDevice = 1; - - return 1; /* this audio target is available. */ -} - - -AudioBootStrap ESD_bootstrap = { - "esd", "Enlightened Sound Daemon", ESD_Init, 0 -}; - -#endif /* SDL_AUDIO_DRIVER_ESD */ - -/* vi: set ts=4 sw=4 expandtab: */ http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/d1484ae0/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/esd/SDL_esdaudio.h ---------------------------------------------------------------------- diff --git a/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/esd/SDL_esdaudio.h b/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/esd/SDL_esdaudio.h deleted file mode 100644 index e0d5d4c..0000000 --- a/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/esd/SDL_esdaudio.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#ifndef _SDL_esdaudio_h -#define _SDL_esdaudio_h - -#include "../SDL_sysaudio.h" - -/* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this - -struct SDL_PrivateAudioData -{ - /* The file descriptor for the audio device */ - int audio_fd; - - /* The parent process id, to detect when application quits */ - pid_t parent; - - /* Raw mixing buffer */ - Uint8 *mixbuf; - int mixlen; - - /* Support for audio timing using a timer */ - float frame_ticks; - float next_frame; -}; -#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ - -#endif /* _SDL_esdaudio_h */ -/* vi: set ts=4 sw=4 expandtab: */ http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/d1484ae0/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/fusionsound/SDL_fsaudio.c ---------------------------------------------------------------------- diff --git a/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/fusionsound/SDL_fsaudio.c b/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/fusionsound/SDL_fsaudio.c deleted file mode 100644 index b836771..0000000 --- a/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/fusionsound/SDL_fsaudio.c +++ /dev/null @@ -1,345 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_AUDIO_DRIVER_FUSIONSOUND - -/* Allow access to a raw mixing buffer */ - -#ifdef HAVE_SIGNAL_H -#include -#endif -#include - -#include "SDL_timer.h" -#include "SDL_audio.h" -#include "../SDL_audiomem.h" -#include "../SDL_audio_c.h" -#include "SDL_fsaudio.h" - -#include - -/* #define SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC "libfusionsound.so" */ - -#ifdef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC -#include "SDL_name.h" -#include "SDL_loadso.h" -#else -#define SDL_NAME(X) X -#endif - -#if (FUSIONSOUND_MAJOR_VERSION == 1) && (FUSIONSOUND_MINOR_VERSION < 1) -typedef DFBResult DirectResult; -#endif - -/* Buffers to use - more than 2 gives a lot of latency */ -#define FUSION_BUFFERS (2) - -#ifdef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC - -static const char *fs_library = SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC; -static void *fs_handle = NULL; - -static DirectResult (*SDL_NAME(FusionSoundInit)) (int *argc, char *(*argv[])); -static DirectResult (*SDL_NAME(FusionSoundCreate)) (IFusionSound ** - ret_interface); - -#define SDL_FS_SYM(x) { #x, (void **) (char *) &SDL_NAME(x) } -static struct -{ - const char *name; - void **func; -} fs_functions[] = { -/* *INDENT-OFF* */ - SDL_FS_SYM(FusionSoundInit), - SDL_FS_SYM(FusionSoundCreate), -/* *INDENT-ON* */ -}; - -#undef SDL_FS_SYM - -static void -UnloadFusionSoundLibrary() -{ - if (fs_handle != NULL) { - SDL_UnloadObject(fs_handle); - fs_handle = NULL; - } -} - -static int -LoadFusionSoundLibrary(void) -{ - int i, retval = -1; - - if (fs_handle == NULL) { - fs_handle = SDL_LoadObject(fs_library); - if (fs_handle != NULL) { - retval = 0; - for (i = 0; i < SDL_arraysize(fs_functions); ++i) { - *fs_functions[i].func = - SDL_LoadFunction(fs_handle, fs_functions[i].name); - if (!*fs_functions[i].func) { - retval = -1; - UnloadFusionSoundLibrary(); - break; - } - } - } - } - - return retval; -} - -#else - -static void -UnloadFusionSoundLibrary() -{ - return; -} - -static int -LoadFusionSoundLibrary(void) -{ - return 0; -} - -#endif /* SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC */ - -/* This function waits until it is possible to write a full sound buffer */ -static void -SDL_FS_WaitDevice(_THIS) -{ - this->hidden->stream->Wait(this->hidden->stream, - this->hidden->mixsamples); -} - -static void -SDL_FS_PlayDevice(_THIS) -{ - DirectResult ret; - - ret = this->hidden->stream->Write(this->hidden->stream, - this->hidden->mixbuf, - this->hidden->mixsamples); - /* If we couldn't write, assume fatal error for now */ - if (ret) { - this->enabled = 0; - } -#ifdef DEBUG_AUDIO - fprintf(stderr, "Wrote %d bytes of audio data\n", this->hidden->mixlen); -#endif -} - -static void -SDL_FS_WaitDone(_THIS) -{ - this->hidden->stream->Wait(this->hidden->stream, - this->hidden->mixsamples * FUSION_BUFFERS); -} - - -static Uint8 * -SDL_FS_GetDeviceBuf(_THIS) -{ - return (this->hidden->mixbuf); -} - - -static void -SDL_FS_CloseDevice(_THIS) -{ - if (this->hidden != NULL) { - SDL_FreeAudioMem(this->hidden->mixbuf); - this->hidden->mixbuf = NULL; - if (this->hidden->stream) { - this->hidden->stream->Release(this->hidden->stream); - this->hidden->stream = NULL; - } - if (this->hidden->fs) { - this->hidden->fs->Release(this->hidden->fs); - this->hidden->fs = NULL; - } - SDL_free(this->hidden); - this->hidden = NULL; - } -} - - -static int -SDL_FS_OpenDevice(_THIS, const char *devname, int iscapture) -{ - int bytes; - SDL_AudioFormat test_format = 0, format = 0; - FSSampleFormat fs_format; - FSStreamDescription desc; - DirectResult ret; - - /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { - return SDL_OutOfMemory(); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - - /* Try for a closest match on audio format */ - for (test_format = SDL_FirstAudioFormat(this->spec.format); - !format && test_format;) { -#ifdef DEBUG_AUDIO - fprintf(stderr, "Trying format 0x%4.4x\n", test_format); -#endif - switch (test_format) { - case AUDIO_U8: - fs_format = FSSF_U8; - bytes = 1; - format = 1; - break; - case AUDIO_S16SYS: - fs_format = FSSF_S16; - bytes = 2; - format = 1; - break; - case AUDIO_S32SYS: - fs_format = FSSF_S32; - bytes = 4; - format = 1; - break; - case AUDIO_F32SYS: - fs_format = FSSF_FLOAT; - bytes = 4; - format = 1; - break; - default: - format = 0; - break; - } - if (!format) { - test_format = SDL_NextAudioFormat(); - } - } - - if (format == 0) { - SDL_FS_CloseDevice(this); - return SDL_SetError("Couldn't find any hardware audio formats"); - } - this->spec.format = test_format; - - /* Retrieve the main sound interface. */ - ret = SDL_NAME(FusionSoundCreate) (&this->hidden->fs); - if (ret) { - SDL_FS_CloseDevice(this); - return SDL_SetError("Unable to initialize FusionSound: %d", ret); - } - - this->hidden->mixsamples = this->spec.size / bytes / this->spec.channels; - - /* Fill stream description. */ - desc.flags = FSSDF_SAMPLERATE | FSSDF_BUFFERSIZE | - FSSDF_CHANNELS | FSSDF_SAMPLEFORMAT | FSSDF_PREBUFFER; - desc.samplerate = this->spec.freq; - desc.buffersize = this->spec.size * FUSION_BUFFERS; - desc.channels = this->spec.channels; - desc.prebuffer = 10; - desc.sampleformat = fs_format; - - ret = - this->hidden->fs->CreateStream(this->hidden->fs, &desc, - &this->hidden->stream); - if (ret) { - SDL_FS_CloseDevice(this); - return SDL_SetError("Unable to create FusionSoundStream: %d", ret); - } - - /* See what we got */ - desc.flags = FSSDF_SAMPLERATE | FSSDF_BUFFERSIZE | - FSSDF_CHANNELS | FSSDF_SAMPLEFORMAT; - ret = this->hidden->stream->GetDescription(this->hidden->stream, &desc); - - this->spec.freq = desc.samplerate; - this->spec.size = - desc.buffersize / FUSION_BUFFERS * bytes * desc.channels; - this->spec.channels = desc.channels; - - /* Calculate the final parameters for this audio specification */ - SDL_CalculateAudioSpec(&this->spec); - - /* Allocate mixing buffer */ - this->hidden->mixlen = this->spec.size; - this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); - if (this->hidden->mixbuf == NULL) { - SDL_FS_CloseDevice(this); - return SDL_OutOfMemory(); - } - SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); - - /* We're ready to rock and roll. :-) */ - return 0; -} - - -static void -SDL_FS_Deinitialize(void) -{ - UnloadFusionSoundLibrary(); -} - - -static int -SDL_FS_Init(SDL_AudioDriverImpl * impl) -{ - if (LoadFusionSoundLibrary() < 0) { - return 0; - } else { - DirectResult ret; - - ret = SDL_NAME(FusionSoundInit) (NULL, NULL); - if (ret) { - UnloadFusionSoundLibrary(); - SDL_SetError - ("FusionSound: SDL_FS_init failed (FusionSoundInit: %d)", - ret); - return 0; - } - } - - /* Set the function pointers */ - impl->OpenDevice = SDL_FS_OpenDevice; - impl->PlayDevice = SDL_FS_PlayDevice; - impl->WaitDevice = SDL_FS_WaitDevice; - impl->GetDeviceBuf = SDL_FS_GetDeviceBuf; - impl->CloseDevice = SDL_FS_CloseDevice; - impl->WaitDone = SDL_FS_WaitDone; - impl->Deinitialize = SDL_FS_Deinitialize; - impl->OnlyHasDefaultOutputDevice = 1; - - return 1; /* this audio target is available. */ -} - - -AudioBootStrap FUSIONSOUND_bootstrap = { - "fusionsound", "FusionSound", SDL_FS_Init, 0 -}; - -#endif /* SDL_AUDIO_DRIVER_FUSIONSOUND */ - -/* vi: set ts=4 sw=4 expandtab: */ http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/d1484ae0/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/fusionsound/SDL_fsaudio.h ---------------------------------------------------------------------- diff --git a/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/fusionsound/SDL_fsaudio.h b/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/fusionsound/SDL_fsaudio.h deleted file mode 100644 index 1f9d6bd..0000000 --- a/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/fusionsound/SDL_fsaudio.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#ifndef _SDL_fsaudio_h -#define _SDL_fsaudio_h - -#include - -#include "../SDL_sysaudio.h" - -/* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this - -struct SDL_PrivateAudioData -{ - /* Interface */ - IFusionSound *fs; - - /* The stream interface for the audio device */ - IFusionSoundStream *stream; - - /* Raw mixing buffer */ - Uint8 *mixbuf; - int mixlen; - int mixsamples; - -}; - -#endif /* _SDL_fsaudio_h */ -/* vi: set ts=4 sw=4 expandtab: */ http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/d1484ae0/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/haiku/SDL_haikuaudio.cc ---------------------------------------------------------------------- diff --git a/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/haiku/SDL_haikuaudio.cc b/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/haiku/SDL_haikuaudio.cc deleted file mode 100644 index dddb779..0000000 --- a/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/haiku/SDL_haikuaudio.cc +++ /dev/null @@ -1,240 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_AUDIO_DRIVER_HAIKU - -/* Allow access to the audio stream on Haiku */ - -#include -#include - -#include "../../main/haiku/SDL_BeApp.h" - -extern "C" -{ - -#include "SDL_audio.h" -#include "../SDL_audio_c.h" -#include "../SDL_sysaudio.h" -#include "SDL_haikuaudio.h" - -} - - -/* !!! FIXME: have the callback call the higher level to avoid code dupe. */ -/* The Haiku callback for handling the audio buffer */ -static void -FillSound(void *device, void *stream, size_t len, - const media_raw_audio_format & format) -{ - SDL_AudioDevice *audio = (SDL_AudioDevice *) device; - - /* Only do soemthing if audio is enabled */ - if (!audio->enabled) - return; - - if (!audio->paused) { - if (audio->convert.needed) { - SDL_LockMutex(audio->mixer_lock); - (*audio->spec.callback) (audio->spec.userdata, - (Uint8 *) audio->convert.buf, - audio->convert.len); - SDL_UnlockMutex(audio->mixer_lock); - SDL_ConvertAudio(&audio->convert); - SDL_memcpy(stream, audio->convert.buf, audio->convert.len_cvt); - } else { - SDL_LockMutex(audio->mixer_lock); - (*audio->spec.callback) (audio->spec.userdata, - (Uint8 *) stream, len); - SDL_UnlockMutex(audio->mixer_lock); - } - } -} - -static void -HAIKUAUDIO_CloseDevice(_THIS) -{ - if (_this->hidden != NULL) { - if (_this->hidden->audio_obj) { - _this->hidden->audio_obj->Stop(); - delete _this->hidden->audio_obj; - _this->hidden->audio_obj = NULL; - } - - delete _this->hidden; - _this->hidden = NULL; - } -} - - -static const int sig_list[] = { - SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGWINCH, 0 -}; - -static inline void -MaskSignals(sigset_t * omask) -{ - sigset_t mask; - int i; - - sigemptyset(&mask); - for (i = 0; sig_list[i]; ++i) { - sigaddset(&mask, sig_list[i]); - } - sigprocmask(SIG_BLOCK, &mask, omask); -} - -static inline void -UnmaskSignals(sigset_t * omask) -{ - sigprocmask(SIG_SETMASK, omask, NULL); -} - - -static int -HAIKUAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) -{ - int valid_datatype = 0; - media_raw_audio_format format; - SDL_AudioFormat test_format = SDL_FirstAudioFormat(_this->spec.format); - - /* Initialize all variables that we clean on shutdown */ - _this->hidden = new SDL_PrivateAudioData; - if (_this->hidden == NULL) { - return SDL_OutOfMemory(); - } - SDL_memset(_this->hidden, 0, (sizeof *_this->hidden)); - - /* Parse the audio format and fill the Be raw audio format */ - SDL_memset(&format, '\0', sizeof(media_raw_audio_format)); - format.byte_order = B_MEDIA_LITTLE_ENDIAN; - format.frame_rate = (float) _this->spec.freq; - format.channel_count = _this->spec.channels; /* !!! FIXME: support > 2? */ - while ((!valid_datatype) && (test_format)) { - valid_datatype = 1; - _this->spec.format = test_format; - switch (test_format) { - case AUDIO_S8: - format.format = media_raw_audio_format::B_AUDIO_CHAR; - break; - - case AUDIO_U8: - format.format = media_raw_audio_format::B_AUDIO_UCHAR; - break; - - case AUDIO_S16LSB: - format.format = media_raw_audio_format::B_AUDIO_SHORT; - break; - - case AUDIO_S16MSB: - format.format = media_raw_audio_format::B_AUDIO_SHORT; - format.byte_order = B_MEDIA_BIG_ENDIAN; - break; - - case AUDIO_S32LSB: - format.format = media_raw_audio_format::B_AUDIO_INT; - break; - - case AUDIO_S32MSB: - format.format = media_raw_audio_format::B_AUDIO_INT; - format.byte_order = B_MEDIA_BIG_ENDIAN; - break; - - case AUDIO_F32LSB: - format.format = media_raw_audio_format::B_AUDIO_FLOAT; - break; - - case AUDIO_F32MSB: - format.format = media_raw_audio_format::B_AUDIO_FLOAT; - format.byte_order = B_MEDIA_BIG_ENDIAN; - break; - - default: - valid_datatype = 0; - test_format = SDL_NextAudioFormat(); - break; - } - } - - if (!valid_datatype) { /* shouldn't happen, but just in case... */ - HAIKUAUDIO_CloseDevice(_this); - return SDL_SetError("Unsupported audio format"); - } - - /* Calculate the final parameters for this audio specification */ - SDL_CalculateAudioSpec(&_this->spec); - - format.buffer_size = _this->spec.size; - - /* Subscribe to the audio stream (creates a new thread) */ - sigset_t omask; - MaskSignals(&omask); - _this->hidden->audio_obj = new BSoundPlayer(&format, "SDL Audio", - FillSound, NULL, _this); - UnmaskSignals(&omask); - - if (_this->hidden->audio_obj->Start() == B_NO_ERROR) { - _this->hidden->audio_obj->SetHasData(true); - } else { - HAIKUAUDIO_CloseDevice(_this); - return SDL_SetError("Unable to start Be audio"); - } - - /* We're running! */ - return 0; -} - -static void -HAIKUAUDIO_Deinitialize(void) -{ - SDL_QuitBeApp(); -} - -static int -HAIKUAUDIO_Init(SDL_AudioDriverImpl * impl) -{ - /* Initialize the Be Application, if it's not already started */ - if (SDL_InitBeApp() < 0) { - return 0; - } - - /* Set the function pointers */ - impl->OpenDevice = HAIKUAUDIO_OpenDevice; - impl->CloseDevice = HAIKUAUDIO_CloseDevice; - impl->Deinitialize = HAIKUAUDIO_Deinitialize; - impl->ProvidesOwnCallbackThread = 1; - impl->OnlyHasDefaultOutputDevice = 1; - - return 1; /* this audio target is available. */ -} - -extern "C" -{ - extern AudioBootStrap HAIKUAUDIO_bootstrap; -} -AudioBootStrap HAIKUAUDIO_bootstrap = { - "haiku", "Haiku BSoundPlayer", HAIKUAUDIO_Init, 0 -}; - -#endif /* SDL_AUDIO_DRIVER_HAIKU */ - -/* vi: set ts=4 sw=4 expandtab: */ http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/d1484ae0/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/haiku/SDL_haikuaudio.h ---------------------------------------------------------------------- diff --git a/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/haiku/SDL_haikuaudio.h b/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/haiku/SDL_haikuaudio.h deleted file mode 100644 index c6c019e..0000000 --- a/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/haiku/SDL_haikuaudio.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#ifndef _SDL_beaudio_h -#define _SDL_beaudio_h - -#include "../SDL_sysaudio.h" - -/* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *_this - -struct SDL_PrivateAudioData -{ - BSoundPlayer *audio_obj; -}; - -#endif /* _SDL_beaudio_h */ - -/* vi: set ts=4 sw=4 expandtab: */ http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/d1484ae0/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/nas/SDL_nasaudio.c ---------------------------------------------------------------------- diff --git a/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/nas/SDL_nasaudio.c b/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/nas/SDL_nasaudio.c deleted file mode 100644 index a41a480..0000000 --- a/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/nas/SDL_nasaudio.c +++ /dev/null @@ -1,397 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_AUDIO_DRIVER_NAS - -/* Allow access to a raw mixing buffer */ - -#include -#include - -#include "SDL_timer.h" -#include "SDL_audio.h" -#include "SDL_loadso.h" -#include "../SDL_audiomem.h" -#include "../SDL_audio_c.h" -#include "SDL_nasaudio.h" - -static struct SDL_PrivateAudioData *this2 = NULL; - - -static void (*NAS_AuCloseServer) (AuServer *); -static void (*NAS_AuNextEvent) (AuServer *, AuBool, AuEvent *); -static AuBool(*NAS_AuDispatchEvent) (AuServer *, AuEvent *); -static AuFlowID(*NAS_AuCreateFlow) (AuServer *, AuStatus *); -static void (*NAS_AuStartFlow) (AuServer *, AuFlowID, AuStatus *); -static void (*NAS_AuSetElements) - (AuServer *, AuFlowID, AuBool, int, AuElement *, AuStatus *); -static void (*NAS_AuWriteElement) - (AuServer *, AuFlowID, int, AuUint32, AuPointer, AuBool, AuStatus *); -static AuServer *(*NAS_AuOpenServer) - (_AuConst char *, int, _AuConst char *, int, _AuConst char *, char **); -static AuEventHandlerRec *(*NAS_AuRegisterEventHandler) - (AuServer *, AuMask, int, AuID, AuEventHandlerCallback, AuPointer); - - -#ifdef SDL_AUDIO_DRIVER_NAS_DYNAMIC - -static const char *nas_library = SDL_AUDIO_DRIVER_NAS_DYNAMIC; -static void *nas_handle = NULL; - -static int -load_nas_sym(const char *fn, void **addr) -{ - *addr = SDL_LoadFunction(nas_handle, fn); - if (*addr == NULL) { - return 0; - } - return 1; -} - -/* cast funcs to char* first, to please GCC's strict aliasing rules. */ -#define SDL_NAS_SYM(x) \ - if (!load_nas_sym(#x, (void **) (char *) &NAS_##x)) return -1 -#else -#define SDL_NAS_SYM(x) NAS_##x = x -#endif - -static int -load_nas_syms(void) -{ - SDL_NAS_SYM(AuCloseServer); - SDL_NAS_SYM(AuNextEvent); - SDL_NAS_SYM(AuDispatchEvent); - SDL_NAS_SYM(AuCreateFlow); - SDL_NAS_SYM(AuStartFlow); - SDL_NAS_SYM(AuSetElements); - SDL_NAS_SYM(AuWriteElement); - SDL_NAS_SYM(AuOpenServer); - SDL_NAS_SYM(AuRegisterEventHandler); - return 0; -} - -#undef SDL_NAS_SYM - -#ifdef SDL_AUDIO_DRIVER_NAS_DYNAMIC - -static void -UnloadNASLibrary(void) -{ - if (nas_handle != NULL) { - SDL_UnloadObject(nas_handle); - nas_handle = NULL; - } -} - -static int -LoadNASLibrary(void) -{ - int retval = 0; - if (nas_handle == NULL) { - nas_handle = SDL_LoadObject(nas_library); - if (nas_handle == NULL) { - /* Copy error string so we can use it in a new SDL_SetError(). */ - const char *origerr = SDL_GetError(); - const size_t len = SDL_strlen(origerr) + 1; - char *err = (char *) alloca(len); - SDL_strlcpy(err, origerr, len); - retval = -1; - SDL_SetError("NAS: SDL_LoadObject('%s') failed: %s\n", - nas_library, err); - } else { - retval = load_nas_syms(); - if (retval < 0) { - UnloadNASLibrary(); - } - } - } - return retval; -} - -#else - -static void -UnloadNASLibrary(void) -{ -} - -static int -LoadNASLibrary(void) -{ - load_nas_syms(); - return 0; -} - -#endif /* SDL_AUDIO_DRIVER_NAS_DYNAMIC */ - -/* This function waits until it is possible to write a full sound buffer */ -static void -NAS_WaitDevice(_THIS) -{ - while (this->hidden->buf_free < this->hidden->mixlen) { - AuEvent ev; - NAS_AuNextEvent(this->hidden->aud, AuTrue, &ev); - NAS_AuDispatchEvent(this->hidden->aud, &ev); - } -} - -static void -NAS_PlayDevice(_THIS) -{ - while (this->hidden->mixlen > this->hidden->buf_free) { - /* - * We think the buffer is full? Yikes! Ask the server for events, - * in the hope that some of them is LowWater events telling us more - * of the buffer is free now than what we think. - */ - AuEvent ev; - NAS_AuNextEvent(this->hidden->aud, AuTrue, &ev); - NAS_AuDispatchEvent(this->hidden->aud, &ev); - } - this->hidden->buf_free -= this->hidden->mixlen; - - /* Write the audio data */ - NAS_AuWriteElement(this->hidden->aud, this->hidden->flow, 0, - this->hidden->mixlen, this->hidden->mixbuf, AuFalse, - NULL); - - this->hidden->written += this->hidden->mixlen; - -#ifdef DEBUG_AUDIO - fprintf(stderr, "Wrote %d bytes of audio data\n", this->hidden->mixlen); -#endif -} - -static Uint8 * -NAS_GetDeviceBuf(_THIS) -{ - return (this->hidden->mixbuf); -} - -static void -NAS_CloseDevice(_THIS) -{ - if (this->hidden != NULL) { - SDL_FreeAudioMem(this->hidden->mixbuf); - this->hidden->mixbuf = NULL; - if (this->hidden->aud) { - NAS_AuCloseServer(this->hidden->aud); - this->hidden->aud = 0; - } - SDL_free(this->hidden); - this2 = this->hidden = NULL; - } -} - -static unsigned char -sdlformat_to_auformat(unsigned int fmt) -{ - switch (fmt) { - case AUDIO_U8: - return AuFormatLinearUnsigned8; - case AUDIO_S8: - return AuFormatLinearSigned8; - case AUDIO_U16LSB: - return AuFormatLinearUnsigned16LSB; - case AUDIO_U16MSB: - return AuFormatLinearUnsigned16MSB; - case AUDIO_S16LSB: - return AuFormatLinearSigned16LSB; - case AUDIO_S16MSB: - return AuFormatLinearSigned16MSB; - } - return AuNone; -} - -static AuBool -event_handler(AuServer * aud, AuEvent * ev, AuEventHandlerRec * hnd) -{ - switch (ev->type) { - case AuEventTypeElementNotify: - { - AuElementNotifyEvent *event = (AuElementNotifyEvent *) ev; - - switch (event->kind) { - case AuElementNotifyKindLowWater: - if (this2->buf_free >= 0) { - this2->really += event->num_bytes; - gettimeofday(&this2->last_tv, 0); - this2->buf_free += event->num_bytes; - } else { - this2->buf_free = event->num_bytes; - } - break; - case AuElementNotifyKindState: - switch (event->cur_state) { - case AuStatePause: - if (event->reason != AuReasonUser) { - if (this2->buf_free >= 0) { - this2->really += event->num_bytes; - gettimeofday(&this2->last_tv, 0); - this2->buf_free += event->num_bytes; - } else { - this2->buf_free = event->num_bytes; - } - } - break; - } - } - } - } - return AuTrue; -} - -static AuDeviceID -find_device(_THIS, int nch) -{ - /* These "Au" things are all macros, not functions... */ - int i; - for (i = 0; i < AuServerNumDevices(this->hidden->aud); i++) { - if ((AuDeviceKind(AuServerDevice(this->hidden->aud, i)) == - AuComponentKindPhysicalOutput) && - AuDeviceNumTracks(AuServerDevice(this->hidden->aud, i)) == nch) { - return AuDeviceIdentifier(AuServerDevice(this->hidden->aud, i)); - } - } - return AuNone; -} - -static int -NAS_OpenDevice(_THIS, const char *devname, int iscapture) -{ - AuElement elms[3]; - int buffer_size; - SDL_AudioFormat test_format, format; - - /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { - return SDL_OutOfMemory(); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - - /* Try for a closest match on audio format */ - format = 0; - for (test_format = SDL_FirstAudioFormat(this->spec.format); - !format && test_format;) { - format = sdlformat_to_auformat(test_format); - if (format == AuNone) { - test_format = SDL_NextAudioFormat(); - } - } - if (format == 0) { - NAS_CloseDevice(this); - return SDL_SetError("NAS: Couldn't find any hardware audio formats"); - } - this->spec.format = test_format; - - this->hidden->aud = NAS_AuOpenServer("", 0, NULL, 0, NULL, NULL); - if (this->hidden->aud == 0) { - NAS_CloseDevice(this); - return SDL_SetError("NAS: Couldn't open connection to NAS server"); - } - - this->hidden->dev = find_device(this, this->spec.channels); - if ((this->hidden->dev == AuNone) - || (!(this->hidden->flow = NAS_AuCreateFlow(this->hidden->aud, 0)))) { - NAS_CloseDevice(this); - return SDL_SetError("NAS: Couldn't find a fitting device on NAS server"); - } - - buffer_size = this->spec.freq; - if (buffer_size < 4096) - buffer_size = 4096; - - if (buffer_size > 32768) - buffer_size = 32768; /* So that the buffer won't get unmanageably big. */ - - /* Calculate the final parameters for this audio specification */ - SDL_CalculateAudioSpec(&this->spec); - - this2 = this->hidden; - - AuMakeElementImportClient(elms, this->spec.freq, format, - this->spec.channels, AuTrue, buffer_size, - buffer_size / 4, 0, NULL); - AuMakeElementExportDevice(elms + 1, 0, this->hidden->dev, this->spec.freq, - AuUnlimitedSamples, 0, NULL); - NAS_AuSetElements(this->hidden->aud, this->hidden->flow, AuTrue, 2, elms, - NULL); - NAS_AuRegisterEventHandler(this->hidden->aud, AuEventHandlerIDMask, 0, - this->hidden->flow, event_handler, - (AuPointer) NULL); - - NAS_AuStartFlow(this->hidden->aud, this->hidden->flow, NULL); - - /* Allocate mixing buffer */ - this->hidden->mixlen = this->spec.size; - this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); - if (this->hidden->mixbuf == NULL) { - NAS_CloseDevice(this); - return SDL_OutOfMemory(); - } - SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); - - /* We're ready to rock and roll. :-) */ - return 0; -} - -static void -NAS_Deinitialize(void) -{ - UnloadNASLibrary(); -} - -static int -NAS_Init(SDL_AudioDriverImpl * impl) -{ - if (LoadNASLibrary() < 0) { - return 0; - } else { - AuServer *aud = NAS_AuOpenServer("", 0, NULL, 0, NULL, NULL); - if (aud == NULL) { - SDL_SetError("NAS: AuOpenServer() failed (no audio server?)"); - return 0; - } - NAS_AuCloseServer(aud); - } - - /* Set the function pointers */ - impl->OpenDevice = NAS_OpenDevice; - impl->PlayDevice = NAS_PlayDevice; - impl->WaitDevice = NAS_WaitDevice; - impl->GetDeviceBuf = NAS_GetDeviceBuf; - impl->CloseDevice = NAS_CloseDevice; - impl->Deinitialize = NAS_Deinitialize; - impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: is this true? */ - - return 1; /* this audio target is available. */ -} - -AudioBootStrap NAS_bootstrap = { - "nas", "Network Audio System", NAS_Init, 0 -}; - -#endif /* SDL_AUDIO_DRIVER_NAS */ - -/* vi: set ts=4 sw=4 expandtab: */ http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/d1484ae0/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/nas/SDL_nasaudio.h ---------------------------------------------------------------------- diff --git a/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/nas/SDL_nasaudio.h b/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/nas/SDL_nasaudio.h deleted file mode 100644 index e1ee6a5..0000000 --- a/DocFormats/platform/3rdparty/SDL2-2.0.3/src/audio/nas/SDL_nasaudio.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#ifndef _SDL_nasaudio_h -#define _SDL_nasaudio_h - -#ifdef __sgi -#include -#else -#include