From 78caea1cc916243be0de0b50561451c3fe706bd5 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Mon, 30 Apr 2007 09:02:46 +0000 Subject: Added resample DLL project git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1232 74dad513-b988-da41-8d7b-12977e46ad98 --- third_party/build/resample/libresample_dll.dsp | 133 ++++++++++ third_party/build/resample/libresample_dll.vcproj | 293 ++++++++++++++++++++++ third_party/resample/include/resamplesubs.h | 16 +- third_party/resample/src/libresample_dll.c | 12 + third_party/resample/src/resamplesubs.c | 10 +- 5 files changed, 454 insertions(+), 10 deletions(-) create mode 100644 third_party/build/resample/libresample_dll.dsp create mode 100644 third_party/build/resample/libresample_dll.vcproj create mode 100644 third_party/resample/src/libresample_dll.c (limited to 'third_party') diff --git a/third_party/build/resample/libresample_dll.dsp b/third_party/build/resample/libresample_dll.dsp new file mode 100644 index 00000000..28fa3290 --- /dev/null +++ b/third_party/build/resample/libresample_dll.dsp @@ -0,0 +1,133 @@ +# Microsoft Developer Studio Project File - Name="libresample_dll" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=libresample_dll - 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 "libresample_dll.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 "libresample_dll.mak" CFG="libresample_dll - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libresample_dll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libresample_dll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libresample_dll - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "output\libresample-dll-i386-win32-vc6-release" +# PROP BASE Intermediate_Dir "output\libresample-dll-i386-win32-vc6-release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "output\libresample-dll-i386-win32-vc6-release" +# PROP Intermediate_Dir "output\libresample-dll-i386-win32-vc6-release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBRESAMPLE_DLL_EXPORTS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../../resample/include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBRESAMPLE_DLL_EXPORTS" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"../../lib/libresample.dll" + +!ELSEIF "$(CFG)" == "libresample_dll - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "output\libresample-dll-i386-win32-vc6-debug" +# PROP BASE Intermediate_Dir "output\libresample-dll-i386-win32-vc6-debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "output\libresample-dll-i386-win32-vc6-debug" +# PROP Intermediate_Dir "output\libresample-dll-i386-win32-vc6-debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBRESAMPLE_DLL_EXPORTS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "." /I "../../resample/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBRESAMPLE_DLL_EXPORTS" /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"../../lib/libresampled.dll" /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "libresample_dll - Win32 Release" +# Name "libresample_dll - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\resample\src\libresample_dll.c +# End Source File +# Begin Source File + +SOURCE=..\..\resample\src\resamplesubs.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\resample\src\largefilter.h +# End Source File +# Begin Source File + +SOURCE=..\..\resample\src\resample.h +# End Source File +# Begin Source File + +SOURCE=..\..\resample\include\resamplesubs.h +# End Source File +# Begin Source File + +SOURCE=..\..\resample\src\smallfilter.h +# End Source File +# Begin Source File + +SOURCE=..\..\resample\src\stddefs.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/third_party/build/resample/libresample_dll.vcproj b/third_party/build/resample/libresample_dll.vcproj new file mode 100644 index 00000000..d7874e67 --- /dev/null +++ b/third_party/build/resample/libresample_dll.vcproj @@ -0,0 +1,293 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/third_party/resample/include/resamplesubs.h b/third_party/resample/include/resamplesubs.h index 76563b7b..ab0771b6 100644 --- a/third_party/resample/include/resamplesubs.h +++ b/third_party/resample/include/resamplesubs.h @@ -7,11 +7,17 @@ typedef int RES_WORD; typedef unsigned short RES_UHWORD; typedef unsigned int RES_UWORD; -int res_SrcLinear(const RES_HWORD X[], RES_HWORD Y[], - double pFactor, RES_UHWORD nx); -int res_Resample(const RES_HWORD X[], RES_HWORD Y[], double pFactor, - RES_UHWORD nx, RES_BOOL LargeF, RES_BOOL Interp); -int res_GetXOFF(double pFactor, RES_BOOL LargeF); +#ifdef _USRDLL +# define DECL(T) __declspec(dllexport) T +#else +# define DECL(T) T +#endif + +DECL(int) res_SrcLinear(const RES_HWORD X[], RES_HWORD Y[], + double pFactor, RES_UHWORD nx); +DECL(int) res_Resample(const RES_HWORD X[], RES_HWORD Y[], double pFactor, + RES_UHWORD nx, RES_BOOL LargeF, RES_BOOL Interp); +DECL(int) res_GetXOFF(double pFactor, RES_BOOL LargeF); #endif diff --git a/third_party/resample/src/libresample_dll.c b/third_party/resample/src/libresample_dll.c new file mode 100644 index 00000000..28ab9ec4 --- /dev/null +++ b/third_party/resample/src/libresample_dll.c @@ -0,0 +1,12 @@ +// libresample_dll.cpp : Defines the entry point for the DLL application. +// +#include + +BOOL APIENTRY DllMain( HANDLE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + return TRUE; +} + diff --git a/third_party/resample/src/resamplesubs.c b/third_party/resample/src/resamplesubs.c index ae78add8..2cb04eb5 100644 --- a/third_party/resample/src/resamplesubs.c +++ b/third_party/resample/src/resamplesubs.c @@ -319,14 +319,14 @@ static int SrcUD(const RES_HWORD X[], RES_HWORD Y[], double pFactor, } -int res_SrcLinear(const RES_HWORD X[], RES_HWORD Y[], - double pFactor, RES_UHWORD nx) +DECL(int) res_SrcLinear(const RES_HWORD X[], RES_HWORD Y[], + double pFactor, RES_UHWORD nx) { return SrcLinear(X, Y, pFactor, nx); } -int res_Resample(const RES_HWORD X[], RES_HWORD Y[], double pFactor, - RES_UHWORD nx, RES_BOOL LargeF, RES_BOOL Interp) +DECL(int) res_Resample(const RES_HWORD X[], RES_HWORD Y[], double pFactor, + RES_UHWORD nx, RES_BOOL LargeF, RES_BOOL Interp) { if (pFactor >= 1) { @@ -353,7 +353,7 @@ int res_Resample(const RES_HWORD X[], RES_HWORD Y[], double pFactor, } } -int res_GetXOFF(double pFactor, RES_BOOL LargeF) +DECL(int) res_GetXOFF(double pFactor, RES_BOOL LargeF) { if (LargeF) return (LARGE_FILTER_NMULT + 1) / 2.0 * -- cgit v1.2.3