FS-11390: [mod_codec2] Use system libcodec2.

This commit is contained in:
Andrey Volk 2018-09-15 14:58:05 +03:00
parent 9844c06169
commit 6005400994
6 changed files with 68 additions and 51 deletions

View File

@ -1415,9 +1415,25 @@ PKG_CHECK_MODULES([G7221], [g722_1 >= 0.2.0],[
AM_CONDITIONAL([HAVE_G7221],[true])],[
AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_G7221],[false])])
PKG_CHECK_MODULES([CODEC2], [codec2 >= 0.2],[
AM_CONDITIONAL([HAVE_CODEC2],[true])],[
AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_CODEC2],[false])])
codec2="true"
PKG_CHECK_MODULES([CODEC2], [codec2 >= 0.5],[],[
AC_CHECK_LIB([codec2], [codec2_create],[
AC_CHECK_HEADERS([codec2/codec2.h],[
CODEC2_LIBS="-lcodec2"
CODEC2_CFLAGS=""
], [
codec2="false"
if module_enabled mod_codec2; then
AC_MSG_ERROR([You must install libcodec2-dev to build mod_codec2])
else
AC_MSG_RESULT([no])
fi
])
])
])
AM_CONDITIONAL([HAVE_CODEC2],[$codec2])
PKG_CHECK_MODULES([OPUS], [opus >= 1.1],[
AM_CONDITIONAL([HAVE_OPUS],[true])],[

View File

@ -3,7 +3,7 @@ REM In order to regenerate headers
REM execute this generate.bat from the "VS2015 x86 Native Tools Command Prompt"
REM
cd ../../libcodec2-2.59/src
cd ../../libcodec2-2.59/codec2
cl /EHsc generate_codebook.c
generate_codebook.exe lsp_cb codebook/lsp1.txt codebook/lsp2.txt codebook/lsp3.txt codebook/lsp4.txt codebook/lsp5.txt codebook/lsp6.txt codebook/lsp7.txt codebook/lsp8.txt codebook/lsp9.txt codebook/lsp10.txt > codebook.c
generate_codebook.exe lsp_cbd codebook/dlsp1.txt codebook/dlsp2.txt codebook/dlsp3.txt codebook/dlsp4.txt codebook/dlsp5.txt codebook/dlsp6.txt codebook/dlsp7.txt codebook/dlsp8.txt codebook/dlsp9.txt codebook/dlsp10.txt > codebookd.c

View File

@ -119,57 +119,57 @@
<ItemDefinitionGroup>
<PreBuildEvent>
<Command>
xcopy "$(ProjectDir)generated\*" "$(libcodec2LibDir)\src\" /C /D /Y
xcopy "$(ProjectDir)generated\*" "$(libcodec2LibDir)\codec2\" /C /D /Y
</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="$(libcodec2LibDir)\src\dump.c" />
<ClCompile Include="$(libcodec2LibDir)\src\lpc.c" />
<ClCompile Include="$(libcodec2LibDir)\src\nlp.c" />
<ClCompile Include="$(libcodec2LibDir)\src\postfilter.c" />
<ClCompile Include="$(libcodec2LibDir)\src\sine.c" />
<ClCompile Include="$(libcodec2LibDir)\src\codec2.c" />
<ClCompile Include="$(libcodec2LibDir)\src\fifo.c" />
<ClCompile Include="$(libcodec2LibDir)\src\fdmdv.c" />
<ClCompile Include="$(libcodec2LibDir)\src\kiss_fft.c" />
<ClCompile Include="$(libcodec2LibDir)\src\interp.c" />
<ClCompile Include="$(libcodec2LibDir)\src\lsp.c" />
<ClCompile Include="$(libcodec2LibDir)\src\phase.c" />
<ClCompile Include="$(libcodec2LibDir)\src\quantise.c" />
<ClCompile Include="$(libcodec2LibDir)\src\pack.c" />
<ClCompile Include="$(libcodec2LibDir)\src\codebook.c" />
<ClCompile Include="$(libcodec2LibDir)\src\codebookd.c" />
<ClCompile Include="$(libcodec2LibDir)\src\codebookvq.c" />
<ClCompile Include="$(libcodec2LibDir)\src\codebookjnd.c" />
<ClCompile Include="$(libcodec2LibDir)\src\codebookjvm.c" />
<ClCompile Include="$(libcodec2LibDir)\src\codebookvqanssi.c" />
<ClCompile Include="$(libcodec2LibDir)\src\codebookdt.c" />
<ClCompile Include="$(libcodec2LibDir)\src\codebookge.c" />
<ClCompile Include="$(libcodec2LibDir)\codec2\dump.c" />
<ClCompile Include="$(libcodec2LibDir)\codec2\lpc.c" />
<ClCompile Include="$(libcodec2LibDir)\codec2\nlp.c" />
<ClCompile Include="$(libcodec2LibDir)\codec2\postfilter.c" />
<ClCompile Include="$(libcodec2LibDir)\codec2\sine.c" />
<ClCompile Include="$(libcodec2LibDir)\codec2\codec2.c" />
<ClCompile Include="$(libcodec2LibDir)\codec2\fifo.c" />
<ClCompile Include="$(libcodec2LibDir)\codec2\fdmdv.c" />
<ClCompile Include="$(libcodec2LibDir)\codec2\kiss_fft.c" />
<ClCompile Include="$(libcodec2LibDir)\codec2\interp.c" />
<ClCompile Include="$(libcodec2LibDir)\codec2\lsp.c" />
<ClCompile Include="$(libcodec2LibDir)\codec2\phase.c" />
<ClCompile Include="$(libcodec2LibDir)\codec2\quantise.c" />
<ClCompile Include="$(libcodec2LibDir)\codec2\pack.c" />
<ClCompile Include="$(libcodec2LibDir)\codec2\codebook.c" />
<ClCompile Include="$(libcodec2LibDir)\codec2\codebookd.c" />
<ClCompile Include="$(libcodec2LibDir)\codec2\codebookvq.c" />
<ClCompile Include="$(libcodec2LibDir)\codec2\codebookjnd.c" />
<ClCompile Include="$(libcodec2LibDir)\codec2\codebookjvm.c" />
<ClCompile Include="$(libcodec2LibDir)\codec2\codebookvqanssi.c" />
<ClCompile Include="$(libcodec2LibDir)\codec2\codebookdt.c" />
<ClCompile Include="$(libcodec2LibDir)\codec2\codebookge.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(libcodec2LibDir)\src\dump.h" />
<ClInclude Include="$(libcodec2LibDir)\src\lpc.h" />
<ClInclude Include="$(libcodec2LibDir)\src\nlp.h" />
<ClInclude Include="$(libcodec2LibDir)\src\postfilter.h" />
<ClInclude Include="$(libcodec2LibDir)\src\sine.h" />
<ClInclude Include="$(libcodec2LibDir)\src\codec2.h" />
<ClInclude Include="$(libcodec2LibDir)\src\fifo.h" />
<ClInclude Include="$(libcodec2LibDir)\src\fdmdv.h" />
<ClInclude Include="$(libcodec2LibDir)\src\kiss_fft.h" />
<ClInclude Include="$(libcodec2LibDir)\src\interp.h" />
<ClInclude Include="$(libcodec2LibDir)\src\lsp.h" />
<ClInclude Include="$(libcodec2LibDir)\src\phase.h" />
<ClInclude Include="$(libcodec2LibDir)\src\quantise.h" />
<ClInclude Include="$(libcodec2LibDir)\src\pack.h" />
<ClInclude Include="$(libcodec2LibDir)\src\codebook.h" />
<ClInclude Include="$(libcodec2LibDir)\src\codebookd.h" />
<ClInclude Include="$(libcodec2LibDir)\src\codebookvq.h" />
<ClInclude Include="$(libcodec2LibDir)\src\codebookjnd.h" />
<ClInclude Include="$(libcodec2LibDir)\src\codebookjvm.h" />
<ClInclude Include="$(libcodec2LibDir)\src\codebookvqanssi.h" />
<ClInclude Include="$(libcodec2LibDir)\src\codebookdt.h" />
<ClInclude Include="$(libcodec2LibDir)\src\codebookge.h" />
<ClInclude Include="$(libcodec2LibDir)\codec2\dump.h" />
<ClInclude Include="$(libcodec2LibDir)\codec2\lpc.h" />
<ClInclude Include="$(libcodec2LibDir)\codec2\nlp.h" />
<ClInclude Include="$(libcodec2LibDir)\codec2\postfilter.h" />
<ClInclude Include="$(libcodec2LibDir)\codec2\sine.h" />
<ClInclude Include="$(libcodec2LibDir)\codec2\codec2.h" />
<ClInclude Include="$(libcodec2LibDir)\codec2\fifo.h" />
<ClInclude Include="$(libcodec2LibDir)\codec2\fdmdv.h" />
<ClInclude Include="$(libcodec2LibDir)\codec2\kiss_fft.h" />
<ClInclude Include="$(libcodec2LibDir)\codec2\interp.h" />
<ClInclude Include="$(libcodec2LibDir)\codec2\lsp.h" />
<ClInclude Include="$(libcodec2LibDir)\codec2\phase.h" />
<ClInclude Include="$(libcodec2LibDir)\codec2\quantise.h" />
<ClInclude Include="$(libcodec2LibDir)\codec2\pack.h" />
<ClInclude Include="$(libcodec2LibDir)\codec2\codebook.h" />
<ClInclude Include="$(libcodec2LibDir)\codec2\codebookd.h" />
<ClInclude Include="$(libcodec2LibDir)\codec2\codebookvq.h" />
<ClInclude Include="$(libcodec2LibDir)\codec2\codebookjnd.h" />
<ClInclude Include="$(libcodec2LibDir)\codec2\codebookjvm.h" />
<ClInclude Include="$(libcodec2LibDir)\codec2\codebookvqanssi.h" />
<ClInclude Include="$(libcodec2LibDir)\codec2\codebookdt.h" />
<ClInclude Include="$(libcodec2LibDir)\codec2\codebookge.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@ -30,7 +30,7 @@
*/
#include <switch.h>
#include <codec2.h>
#include <codec2/codec2.h>
/* Uncomment to log input/output data for debugging
#define LOG_DATA

View File

@ -34,6 +34,7 @@
outputfolder=""
outputfilename=""
extractto="$(BaseDir)libs\"
moveafter="libcodec2-$(libcodec2_Version)\src|libcodec2-$(libcodec2_Version)\codec2"
/>
</Target>

View File

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(libcodec2LibDir)\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(libcodec2LibDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
</Project>