[mupen64plus-audio-sdl] 158/163: Imported Upstream version 2.5
Sven Eckelmann
ecsv-guest at moszumanska.debian.org
Thu Nov 26 05:53:40 UTC 2015
This is an automated email from the git hooks/post-receive script.
ecsv-guest pushed a commit to branch armhf_test
in repository mupen64plus-audio-sdl.
commit 8bc5bc84868a50ae9fffee3d862e1a69eab6e8ec
Author: Sven Eckelmann <sven at narfation.org>
Date: Tue Apr 28 22:17:23 2015 +0200
Imported Upstream version 2.5
---
LICENSES | 2 +
RELEASE | 6 +
.../mupen64plus-audio-sdl.vcxproj | 6 +-
projects/msvc8/mupen64plus-audio-sdl.vcproj | 209 ---------------------
projects/unix/Makefile | 63 ++++---
src/main.c | 49 ++++-
src/main.h | 4 +-
src/osal_dynamiclib_unix.c | 4 +-
src/osal_dynamiclib_win32.c | 4 +-
src/volume.c | 10 +-
10 files changed, 97 insertions(+), 260 deletions(-)
diff --git a/LICENSES b/LICENSES
index ac42959..2dcfad8 100644
--- a/LICENSES
+++ b/LICENSES
@@ -13,6 +13,8 @@ The authors of Mupen64Plus are:
* Louai Al-Khanji (slougi)
* Bob Forder (orbitaldecay)
* Jason Espinosa (hasone)
+ * Nebuleon
+ * krnlyng
* Casualjames
* HyperHacker
* and others.
diff --git a/RELEASE b/RELEASE
index ed489c1..9fa4250 100644
--- a/RELEASE
+++ b/RELEASE
@@ -1,6 +1,12 @@
SDL Audio plugin for Mupen64Plus
---------------------------------
+Mupen64Plus-audio-sdl - v2.5 - April 26, 2015
+---------------------------------------------
+ - MS Visual Studio 2013 project files
+ - audioresource support for integration with Linux-based Nemo Mobile OS
+ - Makefile: use SDL2 by default if present, disable OSS support on OpenBSD
+
Mupen64Plus-audio-sdl - v2.0 - July 4, 2013
-------------------------------------------
- Add support for resampling with speexdsp library
diff --git a/projects/msvc11/mupen64plus-audio-sdl.vcxproj b/projects/VisualStudio2013/mupen64plus-audio-sdl.vcxproj
similarity index 96%
rename from projects/msvc11/mupen64plus-audio-sdl.vcxproj
rename to projects/VisualStudio2013/mupen64plus-audio-sdl.vcxproj
index 69233ab..74f20a1 100644
--- a/projects/msvc11/mupen64plus-audio-sdl.vcxproj
+++ b/projects/VisualStudio2013/mupen64plus-audio-sdl.vcxproj
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@@ -20,12 +20,12 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
- <PlatformToolset>v110</PlatformToolset>
+ <PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
- <PlatformToolset>v110</PlatformToolset>
+ <PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
diff --git a/projects/msvc8/mupen64plus-audio-sdl.vcproj b/projects/msvc8/mupen64plus-audio-sdl.vcproj
deleted file mode 100644
index f8c94fb..0000000
--- a/projects/msvc8/mupen64plus-audio-sdl.vcproj
+++ /dev/null
@@ -1,209 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="mupen64plus-audio-sdl"
- ProjectGUID="{96969748-EA54-43FC-8103-A346E9AD98E7}"
- RootNamespace="mupen64plusaudiosdl"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="2"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\include"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="4"
- CompileAs="0"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="..\..\..\mupen64plus-win32-deps\SDL-1.2.14\lib\SDL.lib"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- SubSystem="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="2"
- CharacterSet="2"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\include"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE"
- RuntimeLibrary="2"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- CompileAs="0"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="..\..\..\mupen64plus-win32-deps\SDL-1.2.14\lib\SDL.lib"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\src\main.c"
- >
- </File>
- <File
- RelativePath="..\..\src\osal_dynamiclib_win32.c"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\..\src\main.h"
- >
- </File>
- <File
- RelativePath="..\..\src\osal_dynamiclib.h"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/projects/unix/Makefile b/projects/unix/Makefile
old mode 100644
new mode 100755
index 4904398..b5a9601
--- a/projects/unix/Makefile
+++ b/projects/unix/Makefile
@@ -53,6 +53,7 @@ ifeq ("$(UNAME)","OpenBSD")
OS = FREEBSD
SHARED = -shared
SO_EXTENSION = so
+ NO_OSS = 1
$(warning OS type "$(UNAME)" not officially supported.')
endif
ifneq ("$(filter GNU/kFreeBSD kfreebsd,$(UNAME))","")
@@ -71,10 +72,9 @@ ifeq ("$(OS)","NONE")
$(error OS type "$(UNAME)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues')
endif
-# detect system architecture
+# detect system architecture, only if it matters for build flags
HOST_CPU ?= $(shell uname -m)
-NO_ASM ?= 1
-CPU := NONE
+CPU := OTHER
ifneq ("$(filter x86_64 amd64,$(HOST_CPU))","")
CPU := X86
ifeq ("$(BITS)", "32")
@@ -90,30 +90,8 @@ ifneq ("$(filter pentium i%86,$(HOST_CPU))","")
ARCH_DETECTED := 32BITS
PIC ?= 0
endif
-ifneq ("$(filter ppc macppc socppc powerpc,$(HOST_CPU))","")
- CPU := PPC
- ARCH_DETECTED := 32BITS
- BIG_ENDIAN := 1
+ifeq ("$(CPU)","OTHER")
PIC ?= 1
- $(warning Architecture "$(HOST_CPU)" not officially supported.')
-endif
-ifneq ("$(filter ppc64 powerpc64,$(HOST_CPU))","")
- CPU := PPC
- ARCH_DETECTED := 64BITS
- BIG_ENDIAN := 1
- PIC ?= 1
- $(warning Architecture "$(HOST_CPU)" not officially supported.')
-endif
-ifneq ("$(filter arm%,$(HOST_CPU))","")
- ifeq ("$(filter arm%b,$(HOST_CPU))","")
- CPU := ARM
- ARCH_DETECTED := 32BITS
- PIC ?= 1
- $(warning Architecture "$(HOST_CPU)" not officially supported.')
- endif
-endif
-ifeq ("$(CPU)","NONE")
- $(error CPU type "$(HOST_CPU)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues')
endif
# base CFLAGS, LDLIBS, and LDFLAGS
@@ -130,10 +108,6 @@ else
CFLAGS += -fno-PIC
endif
-ifeq ($(BIG_ENDIAN), 1)
- CFLAGS += -DM64P_BIG_ENDIAN
-endif
-
# tweak flags for 32-bit build on 64-bit system
ifeq ($(ARCH_DETECTED), 64BITS_32)
ifeq ($(OS), FREEBSD)
@@ -223,6 +197,35 @@ ifneq ($(NO_SRC), 1)
LDLIBS += $(SRC_LDLIBS)
endif
+USE_AUDIORESOURCE = 0
+ifeq ($(origin AUDIORESOURCE_CFLAGS) $(origin AUDIORESOURCE_LDLIBS), undefined undefined)
+ ifneq ($(strip $(shell $(PKG_CONFIG) audioresource --modversion 2> /dev/null)),)
+ # set audioresourceflags and libraries
+ USE_AUDIORESOURCE = 1
+ AUDIORESOURCE_CFLAGS += $(shell $(PKG_CONFIG) audioresource --cflags) -DUSE_AUDIORESOURCE
+ AUDIORESOURCE_LDLIBS += $(shell $(PKG_CONFIG) audioresource --libs)
+ endif
+else
+ USE_AUDIORESOURCE = 1
+ AUDIORESOURCE_CFLAGS += -DUSE_AUDIORESOURCE
+endif
+
+ifeq ($(USE_AUDIORESOURCE),1)
+ ifeq ($(origin GLIB_CFLAGS) $(origin GLIB_LDLIBS), undefined undefined)
+ ifneq ($(strip $(shell $(PKG_CONFIG) glib-2.0 --modversion 2> /dev/null)),)
+ # set glib-2.0 flags and libraries
+ GLIB_CFLAGS += $(shell $(PKG_CONFIG) glib-2.0 --cflags)
+ GLIB_LDLIBS += $(shell $(PKG_CONFIG) glib-2.0 --libs)
+ else
+ $(warning audioresource available but glib-2.0 not found, disabling audioresource support. Mupen64plus-sdl-audio will be built without the Nemo Mobile Audio Resource API.)
+ AUDIORESOURCE_CFLAGS =
+ AUDIORESOURCE_LDLIBS =
+ endif
+ endif
+ CFLAGS += $(GLIB_CFLAGS) $(AUDIORESOURCE_CFLAGS)
+ LDLIBS += $(GLIB_LDLIBS) $(AUDIORESOURCE_LDLIBS)
+endif
+
# test for the presence of OSS
ifneq ($(wildcard /dev/mixer),)
ifneq ($(NO_OSS), 1)
diff --git a/src/main.c b/src/main.c
index 08c5abc..79f68dd 100644
--- a/src/main.c
+++ b/src/main.c
@@ -22,13 +22,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#include <SDL.h>
+#include <SDL_audio.h>
+#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <SDL.h>
-#include <SDL_audio.h>
-
#ifdef USE_SRC
#include <samplerate.h>
#endif
@@ -36,15 +36,19 @@
#include <speex/speex_resampler.h>
#endif
+#ifdef USE_AUDIORESOURCE
+#include <audioresource.h>
+#include <glib.h>
+#endif
+
#define M64P_PLUGIN_PROTOTYPES 1
-#include "m64p_types.h"
-#include "m64p_plugin.h"
#include "m64p_common.h"
#include "m64p_config.h"
-
+#include "m64p_plugin.h"
+#include "m64p_types.h"
#include "main.h"
-#include "volume.h"
#include "osal_dynamiclib.h"
+#include "volume.h"
/* Default start-time size of primary buffer (in equivalent output samples).
This is the buffer where audio is loaded after it's extracted from n64's memory.
@@ -84,6 +88,10 @@ static void *l_DebugCallContext = NULL;
static int l_PluginInit = 0;
static int l_PausedForSync = 1; /* Audio is started in paused state after SDL initialization */
static m64p_handle l_ConfigAudio;
+#ifdef USE_AUDIORESOURCE
+static audioresource_t *l_audioresource = NULL;
+static int l_audioresource_acquired = 0;
+#endif
enum resampler_type {
RESAMPLER_TRIVIAL,
@@ -179,6 +187,14 @@ static void DebugMessage(int level, const char *message, ...)
va_end(args);
}
+#ifdef USE_AUDIORESOURCE
+void on_audioresource_acquired(audioresource_t *audioresource, bool acquired, void *user_data)
+{
+ DebugMessage(M64MSG_VERBOSE, "audioresource acquired: %d", acquired);
+ l_audioresource_acquired = acquired;
+}
+#endif
+
/* Mupen64Plus plugin functions */
EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle CoreLibHandle, void *Context,
void (*DebugCallback)(void *, int, const char *))
@@ -282,6 +298,18 @@ EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle CoreLibHandle, void *Con
if (bSaveConfig && ConfigAPIVersion >= 0x020100)
ConfigSaveSection("Audio-SDL");
+#ifdef USE_AUDIORESOURCE
+ l_audioresource = audioresource_init(AUDIO_RESOURCE_GAME, on_audioresource_acquired, NULL);
+
+ audioresource_acquire(l_audioresource);
+
+ while(!l_audioresource_acquired)
+ {
+ DebugMessage(M64MSG_INFO, "Waiting for audioresource...");
+ g_main_context_iteration(NULL, false);
+ }
+#endif
+
l_PluginInit = 1;
return M64ERR_SUCCESS;
}
@@ -302,6 +330,11 @@ EXPORT m64p_error CALL PluginShutdown(void)
mixBuffer = NULL;
}
+#ifdef USE_AUDIORESOURCE
+ audioresource_release(l_audioresource);
+ audioresource_free(l_audioresource);
+#endif
+
l_PluginInit = 0;
return M64ERR_SUCCESS;
}
@@ -668,7 +701,7 @@ static void CreatePrimaryBuffer(void)
static void InitializeAudio(int freq)
{
SDL_AudioSpec *desired, *obtained;
-
+
if(SDL_WasInit(SDL_INIT_AUDIO|SDL_INIT_TIMER) == (SDL_INIT_AUDIO|SDL_INIT_TIMER) )
{
DebugMessage(M64MSG_VERBOSE, "InitializeAudio(): SDL Audio sub-system already initialized.");
diff --git a/src/main.h b/src/main.h
index b7cb3a7..6e600fd 100644
--- a/src/main.h
+++ b/src/main.h
@@ -20,7 +20,9 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* version info */
-#define SDL_AUDIO_PLUGIN_VERSION 0x020000
+#include "m64p_config.h"
+
+#define SDL_AUDIO_PLUGIN_VERSION 0x020500
#define AUDIO_PLUGIN_API_VERSION 0x020000
#define CONFIG_API_VERSION 0x020100
#define CONFIG_PARAM_VERSION 1.00
diff --git a/src/osal_dynamiclib_unix.c b/src/osal_dynamiclib_unix.c
index b3b7ba5..8821ffc 100644
--- a/src/osal_dynamiclib_unix.c
+++ b/src/osal_dynamiclib_unix.c
@@ -19,9 +19,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#include <stdlib.h>
-#include <stdio.h>
#include <dlfcn.h>
+#include <stdio.h>
+#include <stdlib.h>
#include "m64p_types.h"
#include "osal_dynamiclib.h"
diff --git a/src/osal_dynamiclib_win32.c b/src/osal_dynamiclib_win32.c
index 685d717..751e1b0 100644
--- a/src/osal_dynamiclib_win32.c
+++ b/src/osal_dynamiclib_win32.c
@@ -19,9 +19,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#include <windows.h>
-#include <stdlib.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <windows.h>
#include "m64p_types.h"
#include "osal_dynamiclib.h"
diff --git a/src/volume.c b/src/volume.c
index 1c6e25c..d191df3 100644
--- a/src/volume.c
+++ b/src/volume.c
@@ -22,15 +22,15 @@
#if defined(HAS_OSS_SUPPORT)
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <sys/ioctl.h>
/* Sound volume functions. */
#include <sys/soundcard.h>
-#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/ioctl.h>
+#include <sys/types.h>
#include <unistd.h> /* close() */
-#include <fcntl.h>
-#include <stdio.h>
-#include <errno.h>
#include "volume.h"
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mupen64plus-audio-sdl.git
More information about the Pkg-games-commits
mailing list