From bb245dbd9520bcd8fe45d1874bed6b9d284366f4 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Fri, 12 Oct 2007 05:24:32 +0000 Subject: Ticket #398: Initial support for Secret Rabbit Code (aka libsamplerate) sample rate conversionl library git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1493 74dad513-b988-da41-8d7b-12977e46ad98 --- third_party/build/samplerate/README.txt | 74 +++++++++++ third_party/build/samplerate/Static.msvc | 138 +++++++++++++++++++++ .../build/samplerate/libsamplerate_static.dsp | 114 +++++++++++++++++ 3 files changed, 326 insertions(+) create mode 100644 third_party/build/samplerate/README.txt create mode 100644 third_party/build/samplerate/Static.msvc create mode 100644 third_party/build/samplerate/libsamplerate_static.dsp (limited to 'third_party') diff --git a/third_party/build/samplerate/README.txt b/third_party/build/samplerate/README.txt new file mode 100644 index 00000000..48832594 --- /dev/null +++ b/third_party/build/samplerate/README.txt @@ -0,0 +1,74 @@ + + HOW TO ACTIVATE LIBSAMPLERATE + (a.k.a SRC/Secret Rabbit Code) + AS PJMEDIA'S SAMPLE RATE CONVERSION BACKEND + + by + Benny Prijono + PJSIP + +Background +---------- + Secret Rabbit Code (aka libsamplerate) is a sample rate conversion + library, available from http://www.mega-nerd.com/SRC/index.html. + It is licensed under dual license, GPL and proprietary. + + +Supported Platforms +------------------- + libsamplerate is available for Win32 with Visual Studio and the + Makefile based targets (such as Linux, MacOS X, *nix, etc.). + + It's not supported for WinCE/Windows Mobile and Symbian since it is + a floating point based implementation. + + +Installation +------------ + - Download libsamplerate from http://www.mega-nerd.com/SRC/index.html + + - Untar libsamplerate-0.1.2.tar.gz into third_party directory + cd third_party + tar xzf libsamplerate-0.1.2.tar.gz + + - Rename libsamplerate-0.1.2 directory name to libsamplerate + On Windows: + ren libsamplerate-0.1.2 libsamplerate + + On Linux/Unix/MacOS X: + mv libsamplerate-0.1.2 libsamplerate + + +Visual Studio Build +------------------- + For Visual Studio projects, only static linkage is supported + by PJMEDIA build system. If dynamic linking is desired, edit + pjmedia/src/pjmedia/resample_libresample.c to prevent it from + linking with the static library, and configure your project + to link with libsamplerate DLL library. + + To build libresample static library with Visual Studio: + + - Open third_party/build/samplerate/libsamplerate_static.dsp + - Build the project for both Debug and Release build + + + libresample dynamic library can be produced by following the + instructions in libresample source directory. + + +Makefile build +-------------- + libsamplerate build is integrated with PJSIP's build system. + + TBD. + + +Enabling libsamplerate for PJMEDIA's resample +--------------------------------------------- + Add this in config_site.h: + + #define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_LIBSAMPLERATE + + + diff --git a/third_party/build/samplerate/Static.msvc b/third_party/build/samplerate/Static.msvc new file mode 100644 index 00000000..0f04c8f0 --- /dev/null +++ b/third_party/build/samplerate/Static.msvc @@ -0,0 +1,138 @@ + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF + +CPP=cl.exe +RSC=rc.exe +F90=df.exe +BSC32=bscmake.exe +BSC32_SBRS= \ + +LIB32=link.exe -lib + +OUTDIR_REL=.\output\libsamplerate-i386-win32-vc-release +INTDIR_REL=.\output\libsamplerate-i386-win32-vc-release +OUTDIR_DEB=.\output\libsamplerate-i386-win32-vc-debug +INTDIR_DEB=.\output\libsamplerate-i386-win32-vc-debug + +LIB_REL=..\..\lib\libsamplerate-i386-win32-vc-release.lib +LIB_DEB=..\..\lib\libsamplerate-i386-win32-vc-debug.lib + +ALL : $(LIB_REL) $(LIB_DEB) + +CLEAN : + -@erase "$(INTDIR_REL)\*.obj" + -@erase "$(INTDIR_REL)\*.pch" + -@erase "$(INTDIR_REL)\*.pdb" + -@erase "$(INTDIR_REL)\*.idb" + @rmdir $(INTDIR_REL) + -@erase "$(INTDIR_DEB)\*.obj" + -@erase "$(INTDIR_DEB)\*.pch" + -@erase "$(INTDIR_DEB)\*.pdb" + -@erase "$(INTDIR_DEB)\*.idb" + @rmdir $(INTDIR_DEB) + -@erase $(LIB_REL) + -@erase $(LIB_DEB) + +"$(OUTDIR_REL)" : + if not exist "$(OUTDIR_REL)/$(NULL)" mkdir "$(OUTDIR_REL)" + +CPP_PROJ_REL=/nologo /MD /W3 /GX /O2 /I "../win32" /I "../../libsamplerate/src" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /Fp"$(INTDIR_REL)\libsamplerate_static.pch" /YX /Fo"$(INTDIR_REL)\\" /Fd"$(INTDIR_REL)\\" /FD /c + +LIB32_FLAGS_REL=/nologo /out:$(LIB_REL) +LIB32_OBJS_REL= \ + "$(INTDIR_REL)\samplerate.obj" \ + "$(INTDIR_REL)\src_linear.obj" \ + "$(INTDIR_REL)\src_sinc.obj" \ + "$(INTDIR_REL)\src_zoh.obj" + +$(LIB_REL) : "$(OUTDIR_REL)" $(DEF_FILE) $(LIB32_OBJS_REL) + $(LIB32) @<< + $(LIB32_FLAGS_REL) $(DEF_FLAGS) $(LIB32_OBJS_REL) +<< + +"$(OUTDIR_DEB)" : + if not exist "$(OUTDIR_DEB)/$(NULL)" mkdir "$(OUTDIR_DEB)" + +CPP_PROJ_DEB=/nologo /MTd /W3 /Gm /GX /ZI /Od /I "../win32" /I "../../libsamplerate/src" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /Fp"$(INTDIR_DEB)\libsamplerate_static.pch" /YX /Fo"$(INTDIR_DEB)\\" /Fd"$(INTDIR_DEB)\\" /FD /GZ /c +LIB32_FLAGS_DEB=/nologo /out:$(LIB_DEB) +LIB32_OBJS_DEB= \ + "$(INTDIR_DEB)\samplerate.obj" \ + "$(INTDIR_DEB)\src_linear.obj" \ + "$(INTDIR_DEB)\src_sinc.obj" \ + "$(INTDIR_DEB)\src_zoh.obj" + +$(LIB_DEB) : "$(OUTDIR_DEB)" $(DEF_FILE) $(LIB32_OBJS_DEB) + $(LIB32) @<< + $(LIB32_FLAGS_DEB) $(DEF_FLAGS) $(LIB32_OBJS_DEB) +<< + + +..\..\libsamplerate\src\samplerate.c : \ + "..\..\libsamplerate\src\common.h"\ + "..\..\libsamplerate\src\config.h"\ + "..\..\libsamplerate\src\float_cast.h"\ + "..\..\libsamplerate\src\samplerate.h"\ + + +..\..\libsamplerate\src\src_linear.c : \ + "..\..\libsamplerate\src\common.h"\ + "..\..\libsamplerate\src\config.h"\ + "..\..\libsamplerate\src\float_cast.h"\ + "..\..\libsamplerate\src\samplerate.h"\ + + +..\..\libsamplerate\src\src_sinc.c : \ + "..\..\libsamplerate\src\common.h"\ + "..\..\libsamplerate\src\config.h"\ + "..\..\libsamplerate\src\fastest_coeffs.h"\ + "..\..\libsamplerate\src\float_cast.h"\ + "..\..\libsamplerate\src\high_qual_coeffs.h"\ + "..\..\libsamplerate\src\mid_qual_coeffs.h"\ + "..\..\libsamplerate\src\samplerate.h"\ + + +..\..\libsamplerate\src\src_zoh.c : \ + "..\..\libsamplerate\src\common.h"\ + "..\..\libsamplerate\src\config.h"\ + "..\..\libsamplerate\src\float_cast.h"\ + "..\..\libsamplerate\src\samplerate.h"\ + + + +SOURCE=..\..\libsamplerate\src\samplerate.c + +"$(INTDIR_DEB)\samplerate.obj" : $(SOURCE) "$(INTDIR_DEB)" + $(CPP) $(CPP_PROJ_DEB) $(SOURCE) +"$(INTDIR_REL)\samplerate.obj" : $(SOURCE) "$(INTDIR_REL)" + $(CPP) $(CPP_PROJ_REL) $(SOURCE) + + +SOURCE=..\..\libsamplerate\src\src_linear.c + +"$(INTDIR_DEB)\src_linear.obj" : $(SOURCE) "$(INTDIR_DEB)" + $(CPP) $(CPP_PROJ_DEB) $(SOURCE) +"$(INTDIR_REL)\src_linear.obj" : $(SOURCE) "$(INTDIR_REL)" + $(CPP) $(CPP_PROJ_REL) $(SOURCE) + + +SOURCE=..\..\libsamplerate\src\src_sinc.c + +"$(INTDIR_DEB)\src_sinc.obj" : $(SOURCE) "$(INTDIR_DEB)" + $(CPP) $(CPP_PROJ_DEB) $(SOURCE) +"$(INTDIR_REL)\src_sinc.obj" : $(SOURCE) "$(INTDIR_REL)" + $(CPP) $(CPP_PROJ_REL) $(SOURCE) + + +SOURCE=..\..\libsamplerate\src\src_zoh.c + +"$(INTDIR_DEB)\src_zoh.obj" : $(SOURCE) "$(INTDIR_DEB)" + $(CPP) $(CPP_PROJ_DEB) $(SOURCE) +"$(INTDIR_REL)\src_zoh.obj" : $(SOURCE) "$(INTDIR_REL)" + $(CPP) $(CPP_PROJ_REL) $(SOURCE) + + + diff --git a/third_party/build/samplerate/libsamplerate_static.dsp b/third_party/build/samplerate/libsamplerate_static.dsp new file mode 100644 index 00000000..54ac8e3b --- /dev/null +++ b/third_party/build/samplerate/libsamplerate_static.dsp @@ -0,0 +1,114 @@ +# Microsoft Developer Studio Project File - Name="libsamplerate_static" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libsamplerate_static - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libsamplerate_static.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libsamplerate_static.mak" CFG="libsamplerate_static - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libsamplerate_static - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libsamplerate_static - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libsamplerate_static - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "output/libsamplerate-i386-win32-vc-release" +# PROP BASE Intermediate_Dir "output/libsamplerate-i386-win32-vc-release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "output/libsamplerate-i386-win32-vc-release" +# PROP Intermediate_Dir "output/libsamplerate-i386-win32-vc-release" +# PROP Target_Dir "" +F90=df.exe +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "./win32" /I "../../libsamplerate/src" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"..\..\lib\libsamplerate-i386-win32-vc-release.lib" + +!ELSEIF "$(CFG)" == "libsamplerate_static - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "output/libsamplerate-i386-win32-vc-debug" +# PROP BASE Intermediate_Dir "output/libsamplerate-i386-win32-vc-debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "output/libsamplerate-i386-win32-vc-debug" +# PROP Intermediate_Dir "output/libsamplerate-i386-win32-vc-debug" +# PROP Target_Dir "" +F90=df.exe +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "./win32" /I "../../libsamplerate/src" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"..\..\lib\libsamplerate-i386-win32-vc-debug.lib" + +!ENDIF + +# Begin Target + +# Name "libsamplerate_static - Win32 Release" +# Name "libsamplerate_static - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\libsamplerate\src\samplerate.c +# End Source File +# Begin Source File + +SOURCE=..\..\libsamplerate\src\src_linear.c +# End Source File +# Begin Source File + +SOURCE=..\..\libsamplerate\src\src_sinc.c +# End Source File +# Begin Source File + +SOURCE=..\..\libsamplerate\src\src_zoh.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\libsamplerate\src\samplerate.h +# End Source File +# End Group +# End Target +# End Project -- cgit v1.2.3