diff options
author | Rainer Hochecker <fernetmenta@online.de> | 2014-03-11 17:57:59 +0100 |
---|---|---|
committer | Rainer Hochecker <fernetmenta@online.de> | 2014-03-11 19:17:39 +0100 |
commit | db3f10339ad2616c314188b4b734ccc621439e96 (patch) | |
tree | d8ba7919a2987bc090d94e14ebab80ef1f8a50a2 | |
parent | 0ef974cb12c3f10a93bccb9fdb5d6ebbad616dfe (diff) |
paplayer: sunset wav and adpcm codecs
-rw-r--r-- | Makefile.in | 2 | ||||
-rw-r--r-- | configure.in | 1 | ||||
-rw-r--r-- | lib/DllAdpcm.h | 60 | ||||
-rw-r--r-- | lib/xbadpcm/ADPCMDll.cpp | 169 | ||||
-rw-r--r-- | lib/xbadpcm/Makefile.in | 20 | ||||
-rw-r--r-- | lib/xbadpcm/adpcm.sln | 21 | ||||
-rw-r--r-- | lib/xbadpcm/adpcm.vcxproj | 149 | ||||
-rw-r--r-- | lib/xbadpcm/adpcm.vcxproj.filters | 29 | ||||
-rw-r--r-- | lib/xbadpcm/in_xbadpcm.txt | 47 | ||||
-rw-r--r-- | lib/xbadpcm/mywav.h | 249 | ||||
-rw-r--r-- | lib/xbadpcm/uXboxAdpcmDecoder.c | 164 | ||||
-rw-r--r-- | lib/xbadpcm/uXboxAdpcmDecoder.h | 63 | ||||
-rw-r--r-- | xbmc/DllPaths_generated.h.in | 1 | ||||
-rw-r--r-- | xbmc/cores/paplayer/ADPCMCodec.cpp | 104 | ||||
-rw-r--r-- | xbmc/cores/paplayer/ADPCMCodec.h | 47 | ||||
-rw-r--r-- | xbmc/cores/paplayer/CodecFactory.cpp | 22 | ||||
-rw-r--r-- | xbmc/cores/paplayer/Makefile.in | 4 |
17 files changed, 6 insertions, 1146 deletions
diff --git a/Makefile.in b/Makefile.in index 8eda3c4a70..6f689cfbd1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -192,7 +192,6 @@ DIRECTORY_ARCHIVES += lib/xbmc-libav-hacks/dll-libavhacks.a endif PAPCODECS_DIRS= \ - lib/xbadpcm \ lib/nosefart \ lib/timidity \ lib/libsidplay2 \ @@ -420,7 +419,6 @@ libhdhomerun: dllloader $(MAKE) -C lib/libhdhomerun papcodecs: dllloader dvdpcodecs test -d system/players/paplayer || mkdir system/players/paplayer - $(MAKE) -C lib/xbadpcm $(MAKE) -C lib/vgmstream $(MAKE) -C lib/timidity $(MAKE) -C lib/nosefart diff --git a/configure.in b/configure.in index 1cd6b2e67a..d5ff793b9c 100644 --- a/configure.in +++ b/configure.in @@ -2525,7 +2525,6 @@ OUTPUT_FILES="Makefile \ xbmc/cores/paplayer/Makefile \ xbmc/cores/omxplayer/Makefile \ lib/timidity/Makefile \ - lib/xbadpcm/Makefile \ lib/asap/Makefile \ lib/nosefart/Makefile \ lib/libsidplay2/Makefile \ diff --git a/lib/DllAdpcm.h b/lib/DllAdpcm.h deleted file mode 100644 index 8988bdb122..0000000000 --- a/lib/DllAdpcm.h +++ /dev/null @@ -1,60 +0,0 @@ -#pragma once -/* - * Copyright (C) 2005-2013 Team XBMC - * http://xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -#include "DynamicDll.h" - -class DllADPCMInterface -{ -public: - virtual ~DllADPCMInterface() {} - virtual void* LoadXWAV(const char* szFileName)=0; - virtual void FreeXWAV(void*)=0; - virtual long FillBuffer(void* nsf, char* buffer, int size)=0; - virtual int GetPlaybackRate(void* nsf)=0; - virtual int GetNumberOfChannels(void* info)=0; - virtual int GetSampleSize(void* info)=0; - virtual int GetLength(void* info)=0; - virtual int Seek(void* info, int pos)=0; -}; - -class DllADPCM : public DllDynamic, DllADPCMInterface -{ - DECLARE_DLL_WRAPPER(DllADPCM, DLL_PATH_ADPCM_CODEC) - DEFINE_METHOD1(void*, LoadXWAV, (const char* p1)) - DEFINE_METHOD1(void, FreeXWAV, (void* p1)) - DEFINE_METHOD3(long, FillBuffer, (void* p1, char* p2, int p3)) - DEFINE_METHOD1(int, GetPlaybackRate, (void* p1)) - DEFINE_METHOD1(int, GetNumberOfChannels, (void* p1)) - DEFINE_METHOD1(int, GetSampleSize, (void* p1)) - DEFINE_METHOD1(int, GetLength, (void* p1)) - DEFINE_METHOD2(int, Seek, (void* p1, int p2)) - - BEGIN_METHOD_RESOLVE() - RESOLVE_METHOD_RENAME(DLL_LoadXWAV, LoadXWAV) - RESOLVE_METHOD_RENAME(DLL_FreeXWAV, FreeXWAV) - RESOLVE_METHOD_RENAME(DLL_FillBuffer, FillBuffer) - RESOLVE_METHOD_RENAME(DLL_GetPlaybackRate, GetPlaybackRate) - RESOLVE_METHOD_RENAME(DLL_Seek, Seek) - RESOLVE_METHOD_RENAME(DLL_GetNumberOfChannels, GetNumberOfChannels) - RESOLVE_METHOD_RENAME(DLL_GetSampleSize, GetSampleSize) - RESOLVE_METHOD_RENAME(DLL_GetLength, GetLength) - END_METHOD_RESOLVE() -}; diff --git a/lib/xbadpcm/ADPCMDll.cpp b/lib/xbadpcm/ADPCMDll.cpp deleted file mode 100644 index b0dab8987c..0000000000 --- a/lib/xbadpcm/ADPCMDll.cpp +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (C) 2008-2013 Team XBMC - * http://xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -#ifdef _LINUX -#define __declspec(x) -#define __cdecl -#endif - -extern "C" -{ -#include "mywav.h" -#include "uXboxAdpcmDecoder.h" -#include <stdlib.h> - -#define GETLENGTH(x,SAMPLERATE,NCH) (((x * 10) / ((SAMPLERATE / 100) * NCH * (16 >> 3)) / XBOX_ADPCM_SRCSIZE) * XBOX_ADPCM_DSTSIZE) - - struct ADPCMInfo - { - FILE* f; - mywav_fmtchunk fmt; - unsigned int length; - int data_offset; - char* szInputBuffer; - char* szBuf; - char* szStartOfBuf; - int bufLen; - }; - - int getwavinfo(ADPCMInfo* info) { - int wavsize; - - wavsize = mywav_data(info->f, &info->fmt); - - if (info->fmt.dwSamplesPerSec == 0 || info->fmt.wChannels == 0) - return -1; - - if(wavsize >= 0) { - if(info->fmt.wFormatTag != 0x0069) { - fseek(info->f,0,SEEK_SET); - return(-1); - } - info->data_offset = ftell(info->f); - } else { - fseek(info->f,0,SEEK_END); - wavsize = ftell(info->f); - fseek(info->f,0,SEEK_SET); - } - - info->length = GETLENGTH(wavsize,info->fmt.dwSamplesPerSec,info->fmt.wChannels); - return(wavsize); -} - - - __declspec(dllexport) void* __cdecl DLL_LoadXWAV(const char* szFileName) - { - ADPCMInfo* info = (ADPCMInfo*)malloc(sizeof(ADPCMInfo)); - info->f = fopen(szFileName,"rb"); - if (!info->f) - { - free(info); - return NULL; - } - - int iResult = getwavinfo(info); - if (iResult == -1) - { - fclose(info->f); - free(info); - return NULL; - } - - info->szBuf = (char*)malloc(XBOX_ADPCM_DSTSIZE*info->fmt.wChannels*4); - info->szInputBuffer = (char*)malloc(XBOX_ADPCM_SRCSIZE*info->fmt.wChannels*4); - info->szStartOfBuf = info->szBuf+XBOX_ADPCM_DSTSIZE*info->fmt.wChannels*4; - info->bufLen = XBOX_ADPCM_DSTSIZE*info->fmt.wChannels*4; - return (void*)info; - } - - void __declspec(dllexport) DLL_FreeXWAV(void* info) - { - ADPCMInfo* pInfo = (ADPCMInfo*)info; - fclose(pInfo->f); - free(pInfo); - } - - int __declspec(dllexport) DLL_Seek(void* info, int pos) - { - ADPCMInfo* pInfo = (ADPCMInfo*)info; - int offs = pInfo->data_offset + ((((pos/ 1000) * pInfo->fmt.dwSamplesPerSec) / XBOX_ADPCM_DSTSIZE) * XBOX_ADPCM_SRCSIZE * pInfo->fmt.wChannels * (16 >> 3)); - - fseek(pInfo->f,offs,SEEK_SET); - // invalidate buffer - pInfo->szStartOfBuf = pInfo->szBuf+XBOX_ADPCM_DSTSIZE*pInfo->fmt.wChannels*4; - return pos; - } - - long __declspec(dllexport) DLL_FillBuffer(void* info, char* buffer, int size) - { - ADPCMInfo* pInfo = (ADPCMInfo*)info; - int iCurrSize = size; - while (iCurrSize > 0) - { - if (pInfo->szStartOfBuf >= pInfo->szBuf+pInfo->bufLen) - { - // Read data into input buffer - int read = fread(pInfo->szInputBuffer,XBOX_ADPCM_SRCSIZE*pInfo->fmt.wChannels,4,pInfo->f); - if (!read) - break; - - TXboxAdpcmDecoder_Decode_Memory((uint8_t*)pInfo->szInputBuffer, read*XBOX_ADPCM_SRCSIZE*pInfo->fmt.wChannels, (uint8_t*)pInfo->szBuf, pInfo->fmt.wChannels); - pInfo->szStartOfBuf = pInfo->szBuf; - } - int iCopy=0; - if (iCurrSize > pInfo->szBuf+pInfo->bufLen-pInfo->szStartOfBuf) - iCopy = pInfo->szBuf+pInfo->bufLen-pInfo->szStartOfBuf; - else - iCopy = iCurrSize; - - memcpy(buffer,pInfo->szStartOfBuf,iCopy); - buffer += iCopy; - iCurrSize -= iCopy; - pInfo->szStartOfBuf += iCopy; - } - - return size-iCurrSize; - } - - int __declspec(dllexport) DLL_GetPlaybackRate(void* info) - { - ADPCMInfo* pInfo = (ADPCMInfo*)info; - return pInfo->fmt.dwSamplesPerSec; - } - - int __declspec(dllexport) DLL_GetNumberOfChannels(void* info) - { - ADPCMInfo* pInfo = (ADPCMInfo*)info; - return pInfo->fmt.wChannels; - } - - int __declspec(dllexport) DLL_GetSampleSize(void* info) - { - ADPCMInfo* pInfo = (ADPCMInfo*)info; - return pInfo->fmt.wBitsPerSample; - } - - int __declspec(dllexport) DLL_GetLength(void* info) - { - ADPCMInfo* pInfo = (ADPCMInfo*)info; - return pInfo->length; - } -} - diff --git a/lib/xbadpcm/Makefile.in b/lib/xbadpcm/Makefile.in deleted file mode 100644 index 0a2bc43e44..0000000000 --- a/lib/xbadpcm/Makefile.in +++ /dev/null @@ -1,20 +0,0 @@ -ARCH=@ARCH@ -OBJS=uXboxAdpcmDecoder.o ADPCMDll.o -CFLAGS +=-D_LINUX -fPIC -CXXFLAGS += -D_LINUX -fPIC - -SLIB=@abs_top_srcdir@/system/players/paplayer/adpcm-@ARCH@.so - -$(SLIB): $(OBJS) -ifeq ($(findstring osx,$(ARCH)), osx) - $(CC) $(LDFLAGS) -Wl,-alias_list,@abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper_mach_alias \ - -bundle -undefined dynamic_lookup -read_only_relocs suppress -o $@ \ - @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o *.o $(BUNDLE1_O) - chmod +x $@ -else - $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ *.o -Wl,--unresolved-symbols=ignore-all -lm \ - `cat @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.def` @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o -endif - -include @abs_top_srcdir@/Makefile.include - diff --git a/lib/xbadpcm/adpcm.sln b/lib/xbadpcm/adpcm.sln deleted file mode 100644 index 448fcad143..0000000000 --- a/lib/xbadpcm/adpcm.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "adpcm", "adpcm.vcproj", "{2A8CBFB5-C226-4BB3-8C03-7C75D511A4A2}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {2A8CBFB5-C226-4BB3-8C03-7C75D511A4A2}.Debug.ActiveCfg = Debug|Win32 - {2A8CBFB5-C226-4BB3-8C03-7C75D511A4A2}.Debug.Build.0 = Debug|Win32 - {2A8CBFB5-C226-4BB3-8C03-7C75D511A4A2}.Release.ActiveCfg = Release|Win32 - {2A8CBFB5-C226-4BB3-8C03-7C75D511A4A2}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/lib/xbadpcm/adpcm.vcxproj b/lib/xbadpcm/adpcm.vcxproj deleted file mode 100644 index 2ebf6f5ca7..0000000000 --- a/lib/xbadpcm/adpcm.vcxproj +++ /dev/null @@ -1,149 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - </ItemGroup> - <PropertyGroup Label="Globals"> - <ProjectName>libadpcm_dll</ProjectName> - <ProjectGuid>{2A8CBFB5-C226-4BB3-8C03-7C75D511A4A2}</ProjectGuid> - <RootNamespace>libadpcm_dll</RootNamespace> - <Keyword>Win32Proj</Keyword> - </PropertyGroup> - <Import Project="$(SolutionDir)\XBMC.core-defaults.props" /> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>DynamicLibrary</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <CharacterSet>MultiByte</CharacterSet> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> - <ConfigurationType>DynamicLibrary</ConfigurationType> - <UseDebugLibraries>true</UseDebugLibraries> - <CharacterSet>MultiByte</CharacterSet> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <ImportGroup Label="ExtensionSettings"> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - <Import Project="$(SolutionDir)\XBMC.defaults.props" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - <Import Project="$(SolutionDir)\XBMC.defaults.props" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup> - <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)libs\$(TargetName)\$(Configuration)\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)objs\$(TargetName)\$(Configuration)\</IntDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)libs\$(TargetName)\$(Configuration)\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)objs\$(TargetName)\$(Configuration)\</IntDir> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> - <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> - <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> - <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">adpcm</TargetName> - <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">adpcm</TargetName> - <CustomBuildAfterTargets Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Build</CustomBuildAfterTargets> - <CustomBuildAfterTargets Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Build</CustomBuildAfterTargets> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <PrecompiledHeader> - </PrecompiledHeader> - <DisableSpecificWarnings>4244;4267;4311;4312;%(DisableSpecificWarnings)</DisableSpecificWarnings> - </ClCompile> - <ResourceCompile> - <ResourceOutputFileName> - </ResourceOutputFileName> - </ResourceCompile> - <Link> - <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> - <ProgramDatabaseFile>adpcm.pdb</ProgramDatabaseFile> - <ProfileGuidedDatabase> - </ProfileGuidedDatabase> - <RandomizedBaseAddress>false</RandomizedBaseAddress> - <DataExecutionPrevention> - </DataExecutionPrevention> - <ImportLibrary>$(TargetName).lib</ImportLibrary> - <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies> - </Link> - <PostBuildEvent> - <Command> - </Command> - </PostBuildEvent> - <CustomBuildStep> - <Command>copy /B /Y "$(TargetPath)" "$(SolutionDir)..\..\system\players\paplayer\$(TargetFileName)"</Command> - </CustomBuildStep> - <CustomBuildStep> - <Message>Copy output</Message> - </CustomBuildStep> - <CustomBuildStep> - <Outputs>$(SolutionDir)..\..\system\players\paplayer\$(TargetFileName)</Outputs> - <Inputs>$(TargetPath)</Inputs> - </CustomBuildStep> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <PrecompiledHeader> - </PrecompiledHeader> - <DisableSpecificWarnings>4244;4267;4311;4312;%(DisableSpecificWarnings)</DisableSpecificWarnings> - <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> - <IntrinsicFunctions>true</IntrinsicFunctions> - <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> - <WholeProgramOptimization>true</WholeProgramOptimization> - </ClCompile> - <ResourceCompile> - <ResourceOutputFileName> - </ResourceOutputFileName> - </ResourceCompile> - <Link> - <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> - <ProgramDatabaseFile>$(TargetName).pdb</ProgramDatabaseFile> - <ProfileGuidedDatabase> - </ProfileGuidedDatabase> - <RandomizedBaseAddress>false</RandomizedBaseAddress> - <DataExecutionPrevention> - </DataExecutionPrevention> - <ImportLibrary>$(TargetName).lib</ImportLibrary> - <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies> - </Link> - <PostBuildEvent> - <Command> - </Command> - </PostBuildEvent> - <CustomBuildStep> - <Command>copy /B /Y "$(TargetPath)" "$(SolutionDir)..\..\system\players\paplayer\$(TargetFileName)"</Command> - </CustomBuildStep> - <CustomBuildStep> - <Message>Copy output</Message> - </CustomBuildStep> - <CustomBuildStep> - <Outputs>$(SolutionDir)..\..\system\players\paplayer\$(TargetFileName)</Outputs> - <Inputs>$(TargetPath)</Inputs> - </CustomBuildStep> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="ADPCMDll.cpp" /> - <ClCompile Include="uXboxAdpcmDecoder.c" /> - </ItemGroup> - <ItemGroup> - <ClInclude Include="uXboxAdpcmDecoder.h" /> - <ClInclude Include="mywav.h" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> -</Project>
\ No newline at end of file diff --git a/lib/xbadpcm/adpcm.vcxproj.filters b/lib/xbadpcm/adpcm.vcxproj.filters deleted file mode 100644 index ac523b1030..0000000000 --- a/lib/xbadpcm/adpcm.vcxproj.filters +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Filter Include="Source Files"> - <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> - <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> - </Filter> - <Filter Include="Header Files"> - <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> - <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> - </Filter> - </ItemGroup> - <ItemGroup> - <ClCompile Include="ADPCMDll.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="uXboxAdpcmDecoder.c"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> - <ItemGroup> - <ClInclude Include="uXboxAdpcmDecoder.h"> - <Filter>Source Files</Filter> - </ClInclude> - <ClInclude Include="mywav.h"> - <Filter>Header Files</Filter> - </ClInclude> - </ItemGroup> -</Project>
\ No newline at end of file diff --git a/lib/xbadpcm/in_xbadpcm.txt b/lib/xbadpcm/in_xbadpcm.txt deleted file mode 100644 index 05903cd25a..0000000000 --- a/lib/xbadpcm/in_xbadpcm.txt +++ /dev/null @@ -1,47 +0,0 @@ -###################################################################### - -Xbox ADPCM plugin for Winamp -by Luigi Auriemma -e-mail: aluigi@autistici.org -web: aluigi.org -plugin: http://aluigi.org/papers.htm#xbox - -###################################################################### - - -This is a plugin for Winamp which allows to play the audio compressed -with the Xbox ADPCM codec. - -For using it simply move in_xbadpcm.dll into your Plugin folder or in -the folder where is located your preferred player (Winamp, Xmplay and -many others), - -Supports wave file (tag 0x0069), raw files (like those extracted with -the old versions of my Unxwb tool), XWB/ZWB/WBA archives (the plugin -will skip the WMA and PCM audio files and the XWB file will be read as -an unique audio file, in future I hope to add subsongs handling) and -XSD/XSH archives. - -It's open source and released under the GPL license. - -More info and tools are available here: - - http://aluigi.org/papers.htm#xbox - -Note that raw audio files have no info in them (XWB archives store -these info) so the sample rate is automatically set to 44100 and the -channels to 2. -I highly suggest you to use my xbadpdec tool for adding the wave -header to your files: - - xbadpdec -a 00000000.dat 00000000.wav - -or if your game uses the 32000 or 33000 sample rate (like Unreal -Championship) use: - - xbadpdec -f 32000 -a 00000000.dat 00000000.wav - -channels number can be set with the -c option. - - -###################################################################### diff --git a/lib/xbadpcm/mywav.h b/lib/xbadpcm/mywav.h deleted file mode 100644 index f29498dba4..0000000000 --- a/lib/xbadpcm/mywav.h +++ /dev/null @@ -1,249 +0,0 @@ -/* - MyWAV 0.1.1 - by Luigi Auriemma - e-mail: aluigi@autistici.org - web: aluigi.org - - Copyright 2005,2006 Luigi Auriemma - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - http://www.gnu.org/licenses/gpl.txt -*/ - -#include <string.h> - -//#include <stdint.h> -typedef unsigned char uint8_t; -typedef unsigned int uint32_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; - -#include <stdio.h> - -/* -the functions return ever 0 if success, other values (-1) if error -note that these functions have been written with compatibility in mind -so don't worry if you see useless instructions -*/ - - - -typedef struct { - uint8_t id[4]; - uint32_t size; -} mywav_chunk; - -typedef struct { - int16_t wFormatTag; - uint16_t wChannels; - uint32_t dwSamplesPerSec; - uint32_t dwAvgBytesPerSec; - uint16_t wBlockAlign; - uint16_t wBitsPerSample; -} mywav_fmtchunk; - - - - /* FILE WRITING */ - - // 8 bit -int mywav_fwi08(FILE *fd, int num) { - if(fputc((num ) & 0xff, fd) < 0) return(-1); - return(0); -} - - - - // 16 bit -int mywav_fwi16(FILE *fd, int num) { - if(fputc((num ) & 0xff, fd) < 0) return(-1); - if(fputc((num >> 8) & 0xff, fd) < 0) return(-1); - return(0); -} - - - - // 32 bit -int mywav_fwi32(FILE *fd, int num) { - if(fputc((num ) & 0xff, fd) < 0) return(-1); - if(fputc((num >> 8) & 0xff, fd) < 0) return(-1); - if(fputc((num >> 16) & 0xff, fd) < 0) return(-1); - if(fputc((num >> 24) & 0xff, fd) < 0) return(-1); - return(0); -} - - - - // data -int mywav_fwmem(FILE *fd, uint8_t *mem, int size) { - if(size) { - if(fwrite(mem, size, 1, fd) != 1) return(-1); - } - return(0); -} - - - - // chunk -int mywav_fwchunk(FILE *fd, mywav_chunk *chunk) { - if(mywav_fwmem(fd, chunk->id, 4)) return(-1); - if(mywav_fwi32(fd, chunk->size)) return(-1); - return(0); -} - - - - // fmtchunk -int mywav_fwfmtchunk(FILE *fd, mywav_fmtchunk *fmtchunk) { - if(mywav_fwi16(fd, fmtchunk->wFormatTag)) return(-1); - if(mywav_fwi16(fd, fmtchunk->wChannels)) return(-1); - if(mywav_fwi32(fd, fmtchunk->dwSamplesPerSec)) return(-1); - if(mywav_fwi32(fd, fmtchunk->dwAvgBytesPerSec)) return(-1); - if(mywav_fwi16(fd, fmtchunk->wBlockAlign)) return(-1); - if(mywav_fwi16(fd, fmtchunk->wBitsPerSample)) return(-1); - return(0); -} - - - - /* FILE READING */ - - // 8 bit -int mywav_fri08(FILE *fd, uint8_t *num) { - if(fread(num, 1, 1, fd) != 1) return(-1); - return(0); -} - - - - // 16 bit -int mywav_fri16(FILE *fd, uint16_t *num) { - uint16_t ret; - uint8_t tmp; - - if(fread(&tmp, 1, 1, fd) != 1) return(-1); ret = tmp; - if(fread(&tmp, 1, 1, fd) != 1) return(-1); ret |= (tmp << 8); - *num = ret; - return(0); -} - - - - // 32 bit -int mywav_fri32(FILE *fd, uint32_t *num) { - uint32_t ret; - uint8_t tmp; - - if(fread(&tmp, 1, 1, fd) != 1) return(-1); ret = tmp; - if(fread(&tmp, 1, 1, fd) != 1) return(-1); ret |= (tmp << 8); - if(fread(&tmp, 1, 1, fd) != 1) return(-1); ret |= (tmp << 16); - if(fread(&tmp, 1, 1, fd) != 1) return(-1); ret |= (tmp << 24); - *num = ret; - return(0); -} - - - - // data -int mywav_frmem(FILE *fd, uint8_t *mem, int size) { - if(size) { - if(fread(mem, size, 1, fd) != 1) return(-1); - } - return(0); -} - - - - // chunk -int mywav_frchunk(FILE *fd, mywav_chunk *chunk) { - if(mywav_frmem(fd, (uint8_t *)&chunk->id, 4)) return(-1); - if(mywav_fri32(fd, (uint32_t *)&chunk->size)) return(-1); - return(0); -} - - - - // fmtchunk -int mywav_frfmtchunk(FILE *fd, mywav_fmtchunk *fmtchunk) { - if(mywav_fri16(fd, (uint16_t *)&fmtchunk->wFormatTag)) return(-1); - if(mywav_fri16(fd, (uint16_t *)&fmtchunk->wChannels)) return(-1); - if(mywav_fri32(fd, (uint32_t *)&fmtchunk->dwSamplesPerSec)) return(-1); - if(mywav_fri32(fd, (uint32_t *)&fmtchunk->dwAvgBytesPerSec)) return(-1); - if(mywav_fri16(fd, (uint16_t *)&fmtchunk->wBlockAlign)) return(-1); - if(mywav_fri16(fd, (uint16_t *)&fmtchunk->wBitsPerSample)) return(-1); - return(0); -} - - - /* MYWAV MAIN FUNCTIONS */ - -int mywav_seekchunk(FILE *fd, uint8_t *find) { - mywav_chunk chunk; - - if(fseek(fd, sizeof(mywav_chunk) + 4, SEEK_SET) < 0) return(-1); - - while(!mywav_frchunk(fd, &chunk)) { - if(!memcmp(chunk.id, find, 4)) return(chunk.size); - if(fseek(fd, chunk.size, SEEK_CUR) < 0) break; - } - return(-1); -} - - - -int mywav_data(FILE *fd, mywav_fmtchunk *fmt) { - mywav_chunk chunk; - uint8_t type[4]; - - if(mywav_frchunk(fd, &chunk) < 0) return(-1); - if(mywav_frmem(fd, type, 4) < 0) return(-1); - if(memcmp(type, "WAVE", 4)) return(-1); - - if(mywav_seekchunk(fd, (uint8_t*)"fmt ") < 0) return(-1); - if(mywav_frfmtchunk(fd, fmt) < 0) return(-1); - - return(mywav_seekchunk(fd, (uint8_t*)"data")); -} - - - -int mywav_writehead(FILE *fd, mywav_fmtchunk *fmt, uint32_t data_size, uint8_t *more, int morelen) { - mywav_chunk chunk; - - memcpy(chunk.id, "RIFF", 4); - chunk.size = - 4 + - sizeof(mywav_chunk) + - sizeof(mywav_fmtchunk) + - morelen + - sizeof(mywav_chunk) + - data_size; - - if(mywav_fwchunk(fd, &chunk) < 0) return(-1); - if(mywav_fwmem(fd, (uint8_t*)"WAVE", 4) < 0) return(-1); - - memcpy(chunk.id, "fmt ", 4); - chunk.size = sizeof(mywav_fmtchunk) + morelen; - if(mywav_fwchunk(fd, &chunk) < 0) return(-1); - if(mywav_fwfmtchunk(fd, fmt) < 0) return(-1); - if(mywav_fwmem(fd, more, morelen) < 0) return(-1); - - memcpy(chunk.id, "data", 4); - chunk.size = data_size; - if(mywav_fwchunk(fd, &chunk) < 0) return(-1); - return(0); -} - diff --git a/lib/xbadpcm/uXboxAdpcmDecoder.c b/lib/xbadpcm/uXboxAdpcmDecoder.c deleted file mode 100644 index f405c42212..0000000000 --- a/lib/xbadpcm/uXboxAdpcmDecoder.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - TXboxAdpcmDecoder class - (c) 2005 Benjamin Haisch - - Revision 2 with stereo support - -### - C conversion 0.1.3 - by Luigi Auriemma - e-mail: aluigi@autistici.org - web: aluigi.org - - Copyright 2005,2006 Luigi Auriemma - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - http://www.gnu.org/licenses/gpl.txt -*/ - -#include "uXboxAdpcmDecoder.h" - -#define TXboxAdpcmDecoder_delimit(x,h,l) \ - if(x > h) { \ - x = h; \ - } else if(x < l) { \ - x = l; \ - } - - - -typedef struct { - int8_t Index; - int16_t StepSize; - int16_t Predictor; -} TAdpcmState; - - - -const static int16_t StepTable[89] = { - 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, - 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, - 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, - 130, 143, 157, 173, 190, 209, 230, 253, 279, 307, - 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, - 876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, - 2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358, - 5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, - 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 -}; - - - -const static int8_t IndexTable[16] = { - -1, -1, -1, -1, 2, 4, 6, 8, - -1, -1, -1, -1, 2, 4, 6, 8 -}; - - - -int TXboxAdpcmDecoder_DecodeSample(int Code, TAdpcmState *State) { - int Delta, - Result; - - Delta = State->StepSize >> 3; - if(Code & 4) Delta += State->StepSize; - if(Code & 2) Delta += State->StepSize >> 1; - if(Code & 1) Delta += State->StepSize >> 2; - if(Code & 8) Delta = -Delta; - Result = State->Predictor + Delta; - TXboxAdpcmDecoder_delimit(Result, 32767, -32768); - State->Index += IndexTable[Code]; - TXboxAdpcmDecoder_delimit(State->Index, 88, 0); - State->StepSize = StepTable[State->Index]; - State->Predictor = Result; - return(Result); -} - - - -int TXboxAdpcmDecoder_Decode_Memory(uint8_t *in, int inlen, uint8_t *out, int FChannels) { - TAdpcmState FAdpcmState[6]; - int16_t Buffers[6][8]; - uint32_t CodeBuf; - int i, - j, - c, - outlen; - - inlen = (inlen / XBOX_ADPCM_SRCSIZE) / FChannels; - - for(outlen = 0; inlen--; outlen++) { - for(c = 0; c < FChannels; c++) { - *out++ = in[0]; - *out++ = in[1]; - FAdpcmState[c].Predictor = in[0] | (in[1] << 8); in += 2; - FAdpcmState[c].Index = in[0] | (in[1] << 8); in += 2; - TXboxAdpcmDecoder_delimit(FAdpcmState[c].Index, 88, 0); - FAdpcmState[c].StepSize = StepTable[FAdpcmState[c].Index]; - } - for(i = 0; i < 8; i++) { - for(c = 0; c < FChannels; c++) { - CodeBuf = in[0] | (in[1] << 8) | (in[2] << 16) | (in[3] << 24); - in += 4; - for(j = 0; j < 8; j++) { - Buffers[c][j] = TXboxAdpcmDecoder_DecodeSample(CodeBuf & 15, &FAdpcmState[c]); - CodeBuf >>= 4; - } - } - for(j = 0; j < 8; j++) { - for(c = 0; c < FChannels; c++) { - *out++ = (Buffers[c][j] ) & 0xff; - *out++ = (Buffers[c][j] >> 8) & 0xff; - } - } - } - } - - return(outlen * XBOX_ADPCM_DSTSIZE * FChannels); -} - - - -int TXboxAdpcmDecoder_Decode(FILE *ASource, FILE *ADest, int SourcePos, int SourceSize, int FChannels) { - int DestSize; - uint8_t in[XBOX_ADPCM_SRCSIZE * 6], - out[XBOX_ADPCM_DSTSIZE * 6]; - - if(FChannels <= 0) return(0); - - if(SourcePos >= 0) { - if(fseek(ASource, SourcePos, SEEK_SET) < 0) return(0); - } - if(SourceSize > 0) { - SourceSize -= (SourceSize % XBOX_ADPCM_SRCSIZE); - SourceSize = (SourceSize / XBOX_ADPCM_SRCSIZE) / FChannels; - } - - for(DestSize = 0; SourceSize; SourceSize--) { - if(!fread(in, sizeof(in), 1, ASource)) break; - DestSize += TXboxAdpcmDecoder_Decode_Memory(in, sizeof(in), out, FChannels); - if(!fwrite(out, sizeof(out), 1, ADest)) break; - } - - return(DestSize); -} - - - -int TXboxAdpcmDecoder_guess_output_size(int SourceSize) { - return((SourceSize / XBOX_ADPCM_SRCSIZE) * XBOX_ADPCM_DSTSIZE); -} - diff --git a/lib/xbadpcm/uXboxAdpcmDecoder.h b/lib/xbadpcm/uXboxAdpcmDecoder.h deleted file mode 100644 index 69356d4e76..0000000000 --- a/lib/xbadpcm/uXboxAdpcmDecoder.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - TXboxAdpcmDecoder class - (c) 2005 Benjamin Haisch - - Revision 2 with stereo support - -### - C conversion 0.1.3 - by Luigi Auriemma - e-mail: aluigi@autistici.org - web: aluigi.org - - Copyright 2005,2006 Luigi Auriemma - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - http://www.gnu.org/licenses/gpl.txt -*/ - -#include <stdio.h> - -typedef unsigned char uint8_t; -typedef unsigned int uint32_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed char int8_t; - -#define XBOX_ADPCM_SRCSIZE 36 -#define XBOX_ADPCM_DSTSIZE 130 - -int TXboxAdpcmDecoder_Decode_Memory( - uint8_t *in, // input buffer - int inlen, // input size MUST BE a multiplier of XBOX_ADPCM_SRCSIZE - uint8_t *out, // output buffer - int FChannels // channels -); - -int TXboxAdpcmDecoder_Decode( - FILE *ASource, // input file - FILE *ADest, // output file - int SourcePos, // fseek offset, use -1 for none - int SourceSize, // size of the input audio block, use -1 for all - int AChannels // number of channels, usually 2 -); - - -int TXboxAdpcmDecoder_guess_output_size( - int SourceSize // size of the input audio block -); - - diff --git a/xbmc/DllPaths_generated.h.in b/xbmc/DllPaths_generated.h.in index d35ea97d68..4953236c31 100644 --- a/xbmc/DllPaths_generated.h.in +++ b/xbmc/DllPaths_generated.h.in @@ -46,7 +46,6 @@ /* paplayer */ #define DLL_PATH_AAC_CODEC "special://xbmcbin/system/players/paplayer/AACCodec-@ARCH@.so" -#define DLL_PATH_ADPCM_CODEC "special://xbmcbin/system/players/paplayer/adpcm-@ARCH@.so" #define DLL_PATH_ADPLUG_CODEC "special://xbmcbin/system/players/paplayer/adplug-@ARCH@.so" #define DLL_PATH_APE_CODEC "special://xbmcbin/system/players/paplayer/MACDll-@ARCH@.so" #define DLL_PATH_ASAP_CODEC "special://xbmcbin/system/players/paplayer/xbmc_asap-@ARCH@.so" diff --git a/xbmc/cores/paplayer/ADPCMCodec.cpp b/xbmc/cores/paplayer/ADPCMCodec.cpp deleted file mode 100644 index 9b0a25e7e6..0000000000 --- a/xbmc/cores/paplayer/ADPCMCodec.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2005-2013 Team XBMC - * http://xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -#include "ADPCMCodec.h" -#include "utils/log.h" -#include "cores/AudioEngine/Utils/AEUtil.h" - -ADPCMCodec::ADPCMCodec() -{ - m_CodecName = "adpcm"; - m_adpcm = NULL; - m_bIsPlaying = false; -} - -ADPCMCodec::~ADPCMCodec() -{ - DeInit(); -} - -bool ADPCMCodec::Init(const CStdString &strFile, unsigned int filecache) -{ - DeInit(); - - if (!m_dll.Load()) - return false; // error logged previously - - m_adpcm = m_dll.LoadXWAV(strFile.c_str()); - if (!m_adpcm) - { - CLog::Log(LOGERROR,"ADPCMCodec: error opening file %s!",strFile.c_str()); - return false; - } - - m_Channels = m_dll.GetNumberOfChannels(m_adpcm); - m_SampleRate = m_dll.GetPlaybackRate(m_adpcm); - m_BitsPerSample = 16;//m_dll.GetSampleSize(m_adpcm); - m_DataFormat = AE_FMT_S16NE; - m_TotalTime = m_dll.GetLength(m_adpcm); // fixme? - - return true; -} - -void ADPCMCodec::DeInit() -{ - if (m_adpcm) - m_dll.FreeXWAV(m_adpcm); - - m_adpcm = NULL; - m_bIsPlaying = false; -} - -int64_t ADPCMCodec::Seek(int64_t iSeekTime) -{ - m_dll.Seek(m_adpcm,(int)iSeekTime); - return iSeekTime; -} - -int ADPCMCodec::ReadPCM(BYTE *pBuffer, int size, int *actualsize) -{ - if (!m_adpcm) - return READ_ERROR; - - *actualsize = m_dll.FillBuffer(m_adpcm,(char*)pBuffer,size); - - if (*actualsize == 0) - return READ_ERROR; - - return READ_SUCCESS; -} - -bool ADPCMCodec::CanInit() -{ - return m_dll.CanLoad(); -} - -CAEChannelInfo ADPCMCodec::GetChannelInfo() -{ - static enum AEChannel map[2][3] = { - {AE_CH_FC, AE_CH_NULL}, - {AE_CH_FL, AE_CH_FR , AE_CH_NULL} - }; - - if (m_Channels > 2) - return CAEUtil::GuessChLayout(m_Channels); - - return CAEChannelInfo(map[m_Channels - 1]); -} diff --git a/xbmc/cores/paplayer/ADPCMCodec.h b/xbmc/cores/paplayer/ADPCMCodec.h deleted file mode 100644 index aa09376a68..0000000000 --- a/xbmc/cores/paplayer/ADPCMCodec.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef ADPCM_CODEC_H_ -#define ADPCM_CODEC_H_ -/* - * Copyright (C) 2005-2013 Team XBMC - * http://xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -#include "ICodec.h" -#include "DllAdpcm.h" - -class ADPCMCodec : public ICodec -{ -public: - ADPCMCodec(); - virtual ~ADPCMCodec(); - - virtual bool Init(const CStdString &strFile, unsigned int filecache); - virtual void DeInit(); - virtual int64_t Seek(int64_t iSeekTime); - virtual int ReadPCM(BYTE *pBuffer, int size, int *actualsize); - virtual bool CanInit(); - virtual CAEChannelInfo GetChannelInfo(); - -private: - void* m_adpcm; - bool m_bIsPlaying; - - DllADPCM m_dll; -}; - -#endif - diff --git a/xbmc/cores/paplayer/CodecFactory.cpp b/xbmc/cores/paplayer/CodecFactory.cpp index 2c9d0f165a..e60644c105 100644 --- a/xbmc/cores/paplayer/CodecFactory.cpp +++ b/xbmc/cores/paplayer/CodecFactory.cpp @@ -22,7 +22,6 @@ #include "CodecFactory.h" #include "MP3codec.h" #include "OGGcodec.h" -#include "WAVcodec.h" #include "ModplugCodec.h" #include "NSFCodec.h" #ifdef HAS_SPC_CODEC @@ -31,7 +30,6 @@ #include "SIDCodec.h" #include "VGMCodec.h" #include "YMCodec.h" -#include "ADPCMCodec.h" #include "TimidityCodec.h" #ifdef HAS_ASAP_CODEC #include "ASAPCodec.h" @@ -99,7 +97,7 @@ ICodec* CodecFactory::CreateCodec(const CStdString& strFileType) else if (strFileType.Equals("aiff") || strFileType.Equals("aif")) return new DVDPlayerCodec(); else if (strFileType.Equals("xwav")) - return new ADPCMCodec(); + return new DVDPlayerCodec(); else if (TimidityCodec::IsSupportedFormat(strFileType)) return new TimidityCodec(); #ifdef HAS_ASAP_CODEC @@ -159,7 +157,6 @@ ICodec* CodecFactory::CreateCodecDemux(const CStdString& strFile, const CStdStri if (urlFile.GetFileType().Equals("wav") || strContent.Equals("audio/wav") || strContent.Equals("audio/x-wav")) { - ICodec* codec; //lets see what it contains... //this kinda sucks 'cause if it's a plain wav file the file //will be opened, sniffed and closed 2 times before it is opened *again* for wav @@ -170,20 +167,11 @@ ICodec* CodecFactory::CreateCodecDemux(const CStdString& strFile, const CStdStri { return dvdcodec; } - delete dvdcodec; - codec = new ADPCMCodec(); - if (codec->Init(strFile, filecache)) - { - return codec; - } - delete codec; - codec = new WAVCodec(); - if (codec->Init(strFile, filecache)) - { - return codec; - } - delete codec; + dvdcodec = new DVDPlayerCodec(); + dvdcodec->SetContentType(strContent); + return dvdcodec; + } else if (urlFile.GetFileType().Equals("ogg") || urlFile.GetFileType().Equals("oggstream") || urlFile.GetFileType().Equals("oga")) return CreateOGGCodec(strFile,filecache); diff --git a/xbmc/cores/paplayer/Makefile.in b/xbmc/cores/paplayer/Makefile.in index d0c817668e..2bd5868bb6 100644 --- a/xbmc/cores/paplayer/Makefile.in +++ b/xbmc/cores/paplayer/Makefile.in @@ -7,8 +7,7 @@ CFLAGS += -DHAS_ALSA CXXFLAGS += -DHAS_ALSA endif -SRCS = ADPCMCodec.cpp -SRCS += AudioDecoder.cpp +SRCS = AudioDecoder.cpp SRCS += CodecFactory.cpp SRCS += DVDPlayerCodec.cpp SRCS += ModplugCodec.cpp @@ -21,7 +20,6 @@ SRCS += PCMCodec.cpp SRCS += SIDCodec.cpp SRCS += TimidityCodec.cpp SRCS += VGMCodec.cpp -SRCS += WAVcodec.cpp SRCS += YMCodec.cpp ifeq (@USE_ASAP_CODEC@,1) |