| @ -1,99 +0,0 @@ | |||
| | |||
| Microsoft Visual Studio Solution File, Format Version 12.00 | |||
| # Visual Studio Express 2012 for Windows Phone | |||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmsbcg729", "bcg729.vcxproj", "{1DB09AFE-FC9B-472E-A746-0E33F8EF8883}" | |||
| ProjectSection(ProjectDependencies) = postProject | |||
| {027BAD0E-9179-48C1-9733-7AA7E2C2EC70} = {027BAD0E-9179-48C1-9733-7AA7E2C2EC70} | |||
| EndProjectSection | |||
| EndProject | |||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mediastreamer2", "..\..\..\..\linphone\mediastreamer2\build\wp8\mediastreamer2\mediastreamer2.vcxproj", "{027BAD0E-9179-48C1-9733-7AA7E2C2EC70}" | |||
| EndProject | |||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "oRTP", "..\..\..\..\linphone\oRTP\build\wp8\oRTP\oRTP.vcxproj", "{FFC7B532-0502-4D88-AC98-9E89071CBC97}" | |||
| EndProject | |||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "srtp", "..\..\..\..\srtp\build\wp8\srtp\srtp.vcxproj", "{B4B96BC4-2B72-4964-98E4-7FD048A43363}" | |||
| EndProject | |||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "speex", "..\..\..\..\speex\build\wp8\speex\speex.vcxproj", "{D5EC8C11-C1D9-47E3-BB82-A93C300FD902}" | |||
| EndProject | |||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "speexdsp", "..\..\..\..\speex\build\wp8\speex\speexdsp.vcxproj", "{6BD78980-9C71-4341-8775-AD19E9EC7305}" | |||
| EndProject | |||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsm", "..\..\..\..\gsm\build\wp8\gsm\gsm.vcxproj", "{746EA080-5BA9-42C5-9E52-EA421C3F3AFD}" | |||
| EndProject | |||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opus", "..\..\..\..\opus\build\wp8\opus\opus.vcxproj", "{D450EC75-DF02-48B0-A4FB-ACA79BD894AB}" | |||
| EndProject | |||
| Global | |||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | |||
| Debug|ARM = Debug|ARM | |||
| Debug|Win32 = Debug|Win32 | |||
| Release|ARM = Release|ARM | |||
| Release|Win32 = Release|Win32 | |||
| EndGlobalSection | |||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | |||
| {1DB09AFE-FC9B-472E-A746-0E33F8EF8883}.Debug|ARM.ActiveCfg = Debug|ARM | |||
| {1DB09AFE-FC9B-472E-A746-0E33F8EF8883}.Debug|ARM.Build.0 = Debug|ARM | |||
| {1DB09AFE-FC9B-472E-A746-0E33F8EF8883}.Debug|Win32.ActiveCfg = Debug|Win32 | |||
| {1DB09AFE-FC9B-472E-A746-0E33F8EF8883}.Debug|Win32.Build.0 = Debug|Win32 | |||
| {1DB09AFE-FC9B-472E-A746-0E33F8EF8883}.Release|ARM.ActiveCfg = Release|ARM | |||
| {1DB09AFE-FC9B-472E-A746-0E33F8EF8883}.Release|ARM.Build.0 = Release|ARM | |||
| {1DB09AFE-FC9B-472E-A746-0E33F8EF8883}.Release|Win32.ActiveCfg = Release|Win32 | |||
| {1DB09AFE-FC9B-472E-A746-0E33F8EF8883}.Release|Win32.Build.0 = Release|Win32 | |||
| {027BAD0E-9179-48C1-9733-7AA7E2C2EC70}.Debug|ARM.ActiveCfg = Debug|ARM | |||
| {027BAD0E-9179-48C1-9733-7AA7E2C2EC70}.Debug|ARM.Build.0 = Debug|ARM | |||
| {027BAD0E-9179-48C1-9733-7AA7E2C2EC70}.Debug|Win32.ActiveCfg = Debug|Win32 | |||
| {027BAD0E-9179-48C1-9733-7AA7E2C2EC70}.Debug|Win32.Build.0 = Debug|Win32 | |||
| {027BAD0E-9179-48C1-9733-7AA7E2C2EC70}.Release|ARM.ActiveCfg = Release|ARM | |||
| {027BAD0E-9179-48C1-9733-7AA7E2C2EC70}.Release|ARM.Build.0 = Release|ARM | |||
| {027BAD0E-9179-48C1-9733-7AA7E2C2EC70}.Release|Win32.ActiveCfg = Release|Win32 | |||
| {027BAD0E-9179-48C1-9733-7AA7E2C2EC70}.Release|Win32.Build.0 = Release|Win32 | |||
| {FFC7B532-0502-4D88-AC98-9E89071CBC97}.Debug|ARM.ActiveCfg = Debug|ARM | |||
| {FFC7B532-0502-4D88-AC98-9E89071CBC97}.Debug|ARM.Build.0 = Debug|ARM | |||
| {FFC7B532-0502-4D88-AC98-9E89071CBC97}.Debug|Win32.ActiveCfg = Debug|Win32 | |||
| {FFC7B532-0502-4D88-AC98-9E89071CBC97}.Debug|Win32.Build.0 = Debug|Win32 | |||
| {FFC7B532-0502-4D88-AC98-9E89071CBC97}.Release|ARM.ActiveCfg = Release|ARM | |||
| {FFC7B532-0502-4D88-AC98-9E89071CBC97}.Release|ARM.Build.0 = Release|ARM | |||
| {FFC7B532-0502-4D88-AC98-9E89071CBC97}.Release|Win32.ActiveCfg = Release|Win32 | |||
| {FFC7B532-0502-4D88-AC98-9E89071CBC97}.Release|Win32.Build.0 = Release|Win32 | |||
| {B4B96BC4-2B72-4964-98E4-7FD048A43363}.Debug|ARM.ActiveCfg = Debug|ARM | |||
| {B4B96BC4-2B72-4964-98E4-7FD048A43363}.Debug|ARM.Build.0 = Debug|ARM | |||
| {B4B96BC4-2B72-4964-98E4-7FD048A43363}.Debug|Win32.ActiveCfg = Debug|Win32 | |||
| {B4B96BC4-2B72-4964-98E4-7FD048A43363}.Debug|Win32.Build.0 = Debug|Win32 | |||
| {B4B96BC4-2B72-4964-98E4-7FD048A43363}.Release|ARM.ActiveCfg = Release|ARM | |||
| {B4B96BC4-2B72-4964-98E4-7FD048A43363}.Release|ARM.Build.0 = Release|ARM | |||
| {B4B96BC4-2B72-4964-98E4-7FD048A43363}.Release|Win32.ActiveCfg = Release|Win32 | |||
| {B4B96BC4-2B72-4964-98E4-7FD048A43363}.Release|Win32.Build.0 = Release|Win32 | |||
| {D5EC8C11-C1D9-47E3-BB82-A93C300FD902}.Debug|ARM.ActiveCfg = Debug|ARM | |||
| {D5EC8C11-C1D9-47E3-BB82-A93C300FD902}.Debug|ARM.Build.0 = Debug|ARM | |||
| {D5EC8C11-C1D9-47E3-BB82-A93C300FD902}.Debug|Win32.ActiveCfg = Debug|Win32 | |||
| {D5EC8C11-C1D9-47E3-BB82-A93C300FD902}.Debug|Win32.Build.0 = Debug|Win32 | |||
| {D5EC8C11-C1D9-47E3-BB82-A93C300FD902}.Release|ARM.ActiveCfg = Release|ARM | |||
| {D5EC8C11-C1D9-47E3-BB82-A93C300FD902}.Release|ARM.Build.0 = Release|ARM | |||
| {D5EC8C11-C1D9-47E3-BB82-A93C300FD902}.Release|Win32.ActiveCfg = Release|Win32 | |||
| {D5EC8C11-C1D9-47E3-BB82-A93C300FD902}.Release|Win32.Build.0 = Release|Win32 | |||
| {6BD78980-9C71-4341-8775-AD19E9EC7305}.Debug|ARM.ActiveCfg = Debug|ARM | |||
| {6BD78980-9C71-4341-8775-AD19E9EC7305}.Debug|ARM.Build.0 = Debug|ARM | |||
| {6BD78980-9C71-4341-8775-AD19E9EC7305}.Debug|Win32.ActiveCfg = Debug|Win32 | |||
| {6BD78980-9C71-4341-8775-AD19E9EC7305}.Debug|Win32.Build.0 = Debug|Win32 | |||
| {6BD78980-9C71-4341-8775-AD19E9EC7305}.Release|ARM.ActiveCfg = Release|ARM | |||
| {6BD78980-9C71-4341-8775-AD19E9EC7305}.Release|ARM.Build.0 = Release|ARM | |||
| {6BD78980-9C71-4341-8775-AD19E9EC7305}.Release|Win32.ActiveCfg = Release|Win32 | |||
| {6BD78980-9C71-4341-8775-AD19E9EC7305}.Release|Win32.Build.0 = Release|Win32 | |||
| {746EA080-5BA9-42C5-9E52-EA421C3F3AFD}.Debug|ARM.ActiveCfg = Debug|ARM | |||
| {746EA080-5BA9-42C5-9E52-EA421C3F3AFD}.Debug|ARM.Build.0 = Debug|ARM | |||
| {746EA080-5BA9-42C5-9E52-EA421C3F3AFD}.Debug|Win32.ActiveCfg = Debug|Win32 | |||
| {746EA080-5BA9-42C5-9E52-EA421C3F3AFD}.Debug|Win32.Build.0 = Debug|Win32 | |||
| {746EA080-5BA9-42C5-9E52-EA421C3F3AFD}.Release|ARM.ActiveCfg = Release|ARM | |||
| {746EA080-5BA9-42C5-9E52-EA421C3F3AFD}.Release|ARM.Build.0 = Release|ARM | |||
| {746EA080-5BA9-42C5-9E52-EA421C3F3AFD}.Release|Win32.ActiveCfg = Release|Win32 | |||
| {746EA080-5BA9-42C5-9E52-EA421C3F3AFD}.Release|Win32.Build.0 = Release|Win32 | |||
| {D450EC75-DF02-48B0-A4FB-ACA79BD894AB}.Debug|ARM.ActiveCfg = Debug|ARM | |||
| {D450EC75-DF02-48B0-A4FB-ACA79BD894AB}.Debug|ARM.Build.0 = Debug|ARM | |||
| {D450EC75-DF02-48B0-A4FB-ACA79BD894AB}.Debug|Win32.ActiveCfg = Debug|Win32 | |||
| {D450EC75-DF02-48B0-A4FB-ACA79BD894AB}.Debug|Win32.Build.0 = Debug|Win32 | |||
| {D450EC75-DF02-48B0-A4FB-ACA79BD894AB}.Release|ARM.ActiveCfg = Release|ARM | |||
| {D450EC75-DF02-48B0-A4FB-ACA79BD894AB}.Release|ARM.Build.0 = Release|ARM | |||
| {D450EC75-DF02-48B0-A4FB-ACA79BD894AB}.Release|Win32.ActiveCfg = Release|Win32 | |||
| {D450EC75-DF02-48B0-A4FB-ACA79BD894AB}.Release|Win32.Build.0 = Release|Win32 | |||
| EndGlobalSection | |||
| GlobalSection(SolutionProperties) = preSolution | |||
| HideSolutionNode = FALSE | |||
| EndGlobalSection | |||
| EndGlobal | |||
| @ -1,140 +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="Debug|ARM"> | |||
| <Configuration>Debug</Configuration> | |||
| <Platform>ARM</Platform> | |||
| </ProjectConfiguration> | |||
| <ProjectConfiguration Include="Release|Win32"> | |||
| <Configuration>Release</Configuration> | |||
| <Platform>Win32</Platform> | |||
| </ProjectConfiguration> | |||
| <ProjectConfiguration Include="Release|ARM"> | |||
| <Configuration>Release</Configuration> | |||
| <Platform>ARM</Platform> | |||
| </ProjectConfiguration> | |||
| </ItemGroup> | |||
| <PropertyGroup Label="Globals"> | |||
| <ProjectGuid>{1db09afe-fc9b-472e-a746-0e33f8ef8883}</ProjectGuid> | |||
| <RootNamespace>bcg729</RootNamespace> | |||
| <DefaultLanguage>en-US</DefaultLanguage> | |||
| <MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion> | |||
| <ProjectName>libmsbcg729</ProjectName> | |||
| </PropertyGroup> | |||
| <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | |||
| <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> | |||
| <ConfigurationType>DynamicLibrary</ConfigurationType> | |||
| <UseDebugLibraries>true</UseDebugLibraries> | |||
| <PlatformToolset>v110_wp80</PlatformToolset> | |||
| <IgnoreImportLibrary>false</IgnoreImportLibrary> | |||
| </PropertyGroup> | |||
| <PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration"> | |||
| <ConfigurationType>DynamicLibrary</ConfigurationType> | |||
| <UseDebugLibraries>false</UseDebugLibraries> | |||
| <WholeProgramOptimization>true</WholeProgramOptimization> | |||
| <PlatformToolset>v110_wp80</PlatformToolset> | |||
| <IgnoreImportLibrary>false</IgnoreImportLibrary> | |||
| </PropertyGroup> | |||
| <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | |||
| <ImportGroup Label="PropertySheets"> | |||
| <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | |||
| </ImportGroup> | |||
| <PropertyGroup Label="UserMacros" /> | |||
| <PropertyGroup> | |||
| <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> | |||
| <IntDir>$(SolutionDir)$(Platform)\$(Configuration)\$(TargetName)\</IntDir> | |||
| </PropertyGroup> | |||
| <PropertyGroup> | |||
| <GenerateManifest>false</GenerateManifest> | |||
| </PropertyGroup> | |||
| <ItemDefinitionGroup> | |||
| <ClCompile> | |||
| <WarningLevel>Level4</WarningLevel> | |||
| <AdditionalIncludeDirectories>$(ProjectDir)..\..\..\include;$(ProjectDir)..\..\..\..\linphone\ortp\include;$(ProjectDir)..\..\..\..\linphone\mediastreamer2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | |||
| <PreprocessorDefinitions>WIN32;_WINDOWS;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |||
| <BasicRuntimeChecks>Default</BasicRuntimeChecks> | |||
| <PrecompiledHeader>NotUsing</PrecompiledHeader> | |||
| <CompileAsWinRT>false</CompileAsWinRT> | |||
| <AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories> | |||
| </ClCompile> | |||
| <Link> | |||
| <SubSystem>Console</SubSystem> | |||
| <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> | |||
| <GenerateWindowsMetadata>false</GenerateWindowsMetadata> | |||
| <AdditionalDependencies>ortp.lib;mediastreamer2.lib;%(AdditionalDependencies)</AdditionalDependencies> | |||
| <AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> | |||
| <ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary> | |||
| </Link> | |||
| </ItemDefinitionGroup> | |||
| <ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'"> | |||
| <ClCompile> | |||
| <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |||
| </ClCompile> | |||
| <Link> | |||
| <GenerateDebugInformation>true</GenerateDebugInformation> | |||
| </Link> | |||
| </ItemDefinitionGroup> | |||
| <ItemDefinitionGroup Condition="'$(Configuration)'=='Release'"> | |||
| <ClCompile> | |||
| <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |||
| <Optimization>MaxSpeed</Optimization> | |||
| <StringPooling>true</StringPooling> | |||
| <FunctionLevelLinking>true</FunctionLevelLinking> | |||
| <IntrinsicFunctions>true</IntrinsicFunctions> | |||
| </ClCompile> | |||
| <Link> | |||
| <GenerateDebugInformation>false</GenerateDebugInformation> | |||
| </Link> | |||
| </ItemDefinitionGroup> | |||
| <ItemGroup> | |||
| <Reference Include="Windows"> | |||
| <IsWinMDFile>true</IsWinMDFile> | |||
| </Reference> | |||
| <Reference Include="platform.winmd"> | |||
| <IsWinMDFile>true</IsWinMDFile> | |||
| <Private>false</Private> | |||
| </Reference> | |||
| </ItemGroup> | |||
| <ItemGroup> | |||
| <ClCompile Include="..\..\..\msbcg729\bcg729_dec.c" /> | |||
| <ClCompile Include="..\..\..\msbcg729\bcg729_enc.c" /> | |||
| <ClCompile Include="..\..\..\src\adaptativeCodebookSearch.c" /> | |||
| <ClCompile Include="..\..\..\src\codebooks.c" /> | |||
| <ClCompile Include="..\..\..\src\computeAdaptativeCodebookGain.c" /> | |||
| <ClCompile Include="..\..\..\src\computeLP.c" /> | |||
| <ClCompile Include="..\..\..\src\computeWeightedSpeech.c" /> | |||
| <ClCompile Include="..\..\..\src\decodeAdaptativeCodeVector.c" /> | |||
| <ClCompile Include="..\..\..\src\decodeFixedCodeVector.c" /> | |||
| <ClCompile Include="..\..\..\src\decodeGains.c" /> | |||
| <ClCompile Include="..\..\..\src\decodeLSP.c" /> | |||
| <ClCompile Include="..\..\..\src\decoder.c" /> | |||
| <ClCompile Include="..\..\..\src\encoder.c" /> | |||
| <ClCompile Include="..\..\..\src\findOpenLoopPitchDelay.c" /> | |||
| <ClCompile Include="..\..\..\src\fixedCodebookSearch.c" /> | |||
| <ClCompile Include="..\..\..\src\gainQuantization.c" /> | |||
| <ClCompile Include="..\..\..\src\interpolateqLSP.c" /> | |||
| <ClCompile Include="..\..\..\src\LP2LSPConversion.c" /> | |||
| <ClCompile Include="..\..\..\src\LPSynthesisFilter.c" /> | |||
| <ClCompile Include="..\..\..\src\LSPQuantization.c" /> | |||
| <ClCompile Include="..\..\..\src\postFilter.c" /> | |||
| <ClCompile Include="..\..\..\src\postProcessing.c" /> | |||
| <ClCompile Include="..\..\..\src\preProcessing.c" /> | |||
| <ClCompile Include="..\..\..\src\qLSP2LP.c" /> | |||
| <ClCompile Include="..\..\..\src\utils.c" /> | |||
| </ItemGroup> | |||
| <ItemGroup> | |||
| <ClInclude Include="..\..\..\include\bcg729\decoder.h" /> | |||
| <ClInclude Include="..\..\..\include\bcg729\encoder.h" /> | |||
| </ItemGroup> | |||
| <ItemGroup> | |||
| <ProjectReference Include="..\..\..\..\linphone\mediastreamer2\build\wp8\mediastreamer2\mediastreamer2.vcxproj"> | |||
| <Project>{027bad0e-9179-48c1-9733-7aa7e2c2ec70}</Project> | |||
| </ProjectReference> | |||
| </ItemGroup> | |||
| <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | |||
| <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsPhone\v$(TargetPlatformVersion)\Microsoft.Cpp.WindowsPhone.$(TargetPlatformVersion).targets" /> | |||
| </Project> | |||
| @ -0,0 +1,37 @@ | |||
| ############################################################################ | |||
| # CMakeLists.txt | |||
| # Copyright (C) 2017 Belledonne Communications, Grenoble France | |||
| # | |||
| ############################################################################ | |||
| # | |||
| # 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
| # | |||
| ############################################################################ | |||
| set(HEADER_FILES | |||
| decoder.h | |||
| encoder.h | |||
| ) | |||
| set(BCG729_HEADER_FILES ) | |||
| foreach(HEADER_FILE ${HEADER_FILES}) | |||
| list(APPEND BCG729_HEADER_FILES "${CMAKE_CURRENT_LIST_DIR}/bcg729/${HEADER_FILE}") | |||
| endforeach() | |||
| set(BCG729_HEADER_FILES ${BCG729_HEADER_FILES} PARENT_SCOPE) | |||
| install(FILES ${BCG729_HEADER_FILES} | |||
| DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/bcg729 | |||
| PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ | |||
| ) | |||
| @ -1,17 +0,0 @@ | |||
| LOCAL_PATH:= $(call my-dir) | |||
| include $(CLEAR_VARS) | |||
| LOCAL_MODULE := libmsbcg729 | |||
| LOCAL_SRC_FILES = bcg729_enc.c bcg729_dec.c | |||
| LOCAL_C_INCLUDES += \ | |||
| $(LOCAL_PATH)/../../linphone/oRTP/include \ | |||
| $(LOCAL_PATH)/../../linphone/mediastreamer2/include \ | |||
| $(LOCAL_PATH)/../include | |||
| LOCAL_STATIC_LIBRARIES = libbcg729 | |||
| include $(BUILD_STATIC_LIBRARY) | |||
| @ -1,58 +0,0 @@ | |||
| ############################################################################ | |||
| # CMakeLists.txt | |||
| # Copyright (C) 2014 Belledonne Communications, Grenoble France | |||
| # | |||
| ############################################################################ | |||
| # | |||
| # 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
| # | |||
| ############################################################################ | |||
| set(SOURCE_FILES | |||
| bcg729_dec.c | |||
| bcg729_enc.c | |||
| ) | |||
| include_directories(${MEDIASTREAMER2_INCLUDE_DIRS}) | |||
| if(ENABLE_STATIC) | |||
| add_library(msbcg729-static STATIC ${BCG729_SOURCE_FILES} ${SOURCE_FILES}) | |||
| set_target_properties(msbcg729-static PROPERTIES OUTPUT_NAME msbcg729) | |||
| target_link_libraries(msbcg729-static ${MEDIASTREAMER2_LIBRARIES} ${ORTP_LIBRARIES}) | |||
| install(TARGETS msbcg729-static | |||
| ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/mediastreamer/plugins | |||
| PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE | |||
| ) | |||
| endif() | |||
| if(ENABLE_SHARED) | |||
| add_library(msbcg729 MODULE ${BCG729_SOURCE_FILES} ${SOURCE_FILES}) | |||
| set_target_properties(msbcg729 PROPERTIES SOVERSION 0) | |||
| target_link_libraries(msbcg729 ${MEDIASTREAMER2_LIBRARIES} ${ORTP_LIBRARIES}) | |||
| if(MSVC) | |||
| if(CMAKE_BUILD_TYPE STREQUAL "Debug") | |||
| install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/libmsbcg729.pdb | |||
| DESTINATION ${CMAKE_INSTALL_BINDIR} | |||
| PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE | |||
| ) | |||
| endif() | |||
| set_target_properties(msbcg729 PROPERTIES PREFIX "lib") | |||
| endif() | |||
| install(TARGETS msbcg729 | |||
| RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/mediastreamer/plugins | |||
| LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mediastreamer/plugins | |||
| ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/mediastreamer/plugins | |||
| PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE | |||
| ) | |||
| endif() | |||
| @ -1,15 +0,0 @@ | |||
| pluginsdir = $(libdir)/mediastreamer/plugins | |||
| plugins_LTLIBRARIES=libmsbcg729.la | |||
| libmsbcg729_la_SOURCES=bcg729_dec.c bcg729_enc.c | |||
| libmsbcg729_la_LIBADD=\ | |||
| $(ORTP_LIBS) \ | |||
| $(MEDIASTREAMER_LIBS) \ | |||
| $(top_builddir)/src/libbcg729.la | |||
| libmsbcg729_la_LDFLAGS=-module -no-undefined | |||
| AM_CPPFLAGS = -I$(top_srcdir)/include | |||
| libmsbcg729_la_CFLAGS= $(ORTP_CFLAGS) $(MEDIASTREAMER_CFLAGS) | |||
| @ -1,149 +0,0 @@ | |||
| /* | |||
| bcg729_dec.c | |||
| Copyright (C) 2011 Belledonne Communications, Grenoble, France | |||
| Author : Jehan Monnier | |||
| 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
| */ | |||
| #include "mediastreamer2/mscodecutils.h" | |||
| #include "mediastreamer2/msfilter.h" | |||
| #include "mediastreamer2/msticker.h" | |||
| #include "bcg729/decoder.h" | |||
| /* signal and bitstream frame size in byte */ | |||
| #define SIGNAL_FRAME_SIZE 160 | |||
| #define BITSTREAM_FRAME_SIZE 10 | |||
| #define NOISE_BITSTREAM_FRAME_SIZE 2 | |||
| /* decoder struct: context for decoder channel and concealment */ | |||
| struct bcg729Decoder_struct { | |||
| bcg729DecoderChannelContextStruct *decoderChannelContext; | |||
| MSConcealerContext *concealer; | |||
| }; | |||
| static void filter_init(MSFilter *f){ | |||
| f->data = ms_new0(struct bcg729Decoder_struct,1); | |||
| } | |||
| static void filter_preprocess(MSFilter *f){ | |||
| struct bcg729Decoder_struct* obj= (struct bcg729Decoder_struct*) f->data; | |||
| obj->decoderChannelContext = initBcg729DecoderChannel(); /* initialize bcg729 decoder, return channel context */ | |||
| obj->concealer = ms_concealer_context_new(UINT32_MAX); | |||
| } | |||
| static void filter_process(MSFilter *f){ | |||
| struct bcg729Decoder_struct* obj= (struct bcg729Decoder_struct*) f->data; | |||
| mblk_t *inputMessage, *outputMessage; | |||
| while((inputMessage=ms_queue_get(f->inputs[0]))) { | |||
| while(inputMessage->b_rptr<inputMessage->b_wptr) { | |||
| /* if remaining data in RTP payload have the size of a SID frame it must be one, see RFC3551 section 4.5.6 : any SID frame must be the last one of the RPT payload */ | |||
| uint8_t SIDFrameFlag = ((inputMessage->b_wptr-inputMessage->b_rptr)==NOISE_BITSTREAM_FRAME_SIZE)?1:0; | |||
| outputMessage = allocb(SIGNAL_FRAME_SIZE,0); | |||
| mblk_meta_copy(inputMessage, outputMessage); | |||
| bcg729Decoder(obj->decoderChannelContext, inputMessage->b_rptr, (SIDFrameFlag==1)?NOISE_BITSTREAM_FRAME_SIZE:BITSTREAM_FRAME_SIZE, 0, SIDFrameFlag, 0, (int16_t *)(outputMessage->b_wptr)); | |||
| outputMessage->b_wptr+=SIGNAL_FRAME_SIZE; | |||
| inputMessage->b_rptr += (SIDFrameFlag==1)?NOISE_BITSTREAM_FRAME_SIZE:BITSTREAM_FRAME_SIZE; | |||
| ms_queue_put(f->outputs[0],outputMessage); | |||
| ms_concealer_inc_sample_time(obj->concealer,f->ticker->time,10, 1); | |||
| } | |||
| freemsg(inputMessage); | |||
| } | |||
| if (ms_concealer_context_is_concealement_required(obj->concealer, f->ticker->time)) { | |||
| outputMessage = allocb(SIGNAL_FRAME_SIZE,0); | |||
| bcg729Decoder(obj->decoderChannelContext, NULL, 0, 1, 0, 0, (int16_t *)(outputMessage->b_wptr)); | |||
| outputMessage->b_wptr+=SIGNAL_FRAME_SIZE; | |||
| mblk_set_plc_flag(outputMessage, 1); | |||
| ms_queue_put(f->outputs[0],outputMessage); | |||
| ms_concealer_inc_sample_time(obj->concealer,f->ticker->time,10, 0); | |||
| } | |||
| } | |||
| static void filter_postprocess(MSFilter *f){ | |||
| struct bcg729Decoder_struct* obj= (struct bcg729Decoder_struct*) f->data; | |||
| ms_concealer_context_destroy(obj->concealer); | |||
| closeBcg729DecoderChannel(obj->decoderChannelContext); | |||
| } | |||
| static void filter_uninit(MSFilter *f){ | |||
| ms_free(f->data); | |||
| } | |||
| static int filter_have_plc(MSFilter *f, void *arg) | |||
| { | |||
| *((int *)arg) = 1; | |||
| return 0; | |||
| } | |||
| /*filter specific method*/ | |||
| static MSFilterMethod filter_methods[]={ | |||
| { MS_DECODER_HAVE_PLC , filter_have_plc }, | |||
| { 0 , NULL } | |||
| }; | |||
| #define MS_BCG729_DEC_ID MS_FILTER_PLUGIN_ID | |||
| #define MS_BCG729_DEC_NAME "MSBCG729Dec" | |||
| #define MS_BCG729_DEC_DESCRIPTION "G729 audio decoder filter" | |||
| #define MS_BCG729_DEC_CATEGORY MS_FILTER_DECODER | |||
| #define MS_BCG729_DEC_ENC_FMT "G729" | |||
| #define MS_BCG729_DEC_NINPUTS 1 | |||
| #define MS_BCG729_DEC_NOUTPUTS 1 | |||
| #define MS_BCG729_DEC_FLAGS MS_FILTER_IS_PUMP | |||
| #ifndef _MSC_VER | |||
| MSFilterDesc ms_bcg729_dec_desc={ | |||
| .id=MS_BCG729_DEC_ID, | |||
| .name=MS_BCG729_DEC_NAME, | |||
| .text=MS_BCG729_DEC_DESCRIPTION, | |||
| .category=MS_BCG729_DEC_CATEGORY, | |||
| .enc_fmt=MS_BCG729_DEC_ENC_FMT, | |||
| .ninputs=MS_BCG729_DEC_NINPUTS, /*number of inputs*/ | |||
| .noutputs=MS_BCG729_DEC_NOUTPUTS, /*number of outputs*/ | |||
| .init=filter_init, | |||
| .preprocess=filter_preprocess, | |||
| .process=filter_process, | |||
| .postprocess=filter_postprocess, | |||
| .uninit=filter_uninit, | |||
| .methods=filter_methods, | |||
| .flags=MS_BCG729_DEC_FLAGS | |||
| }; | |||
| #else | |||
| MSFilterDesc ms_bcg729_dec_desc={ | |||
| MS_BCG729_DEC_ID, | |||
| MS_BCG729_DEC_NAME, | |||
| MS_BCG729_DEC_DESCRIPTION, | |||
| MS_BCG729_DEC_CATEGORY, | |||
| MS_BCG729_DEC_ENC_FMT, | |||
| MS_BCG729_DEC_NINPUTS, | |||
| MS_BCG729_DEC_NOUTPUTS, | |||
| filter_init, | |||
| filter_preprocess, | |||
| filter_process, | |||
| filter_postprocess, | |||
| filter_uninit, | |||
| filter_methods, | |||
| MS_BCG729_DEC_FLAGS | |||
| }; | |||
| #endif | |||
| MS_FILTER_DESC_EXPORT(ms_bcg729_dec_desc) | |||
| @ -1,216 +0,0 @@ | |||
| /* | |||
| bcg729_enc.c | |||
| Copyright (C) 2011 Belledonne Communications, Grenoble, France | |||
| Author : Jehan Monnier | |||
| 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
| */ | |||
| #include "mediastreamer2/msfilter.h" | |||
| #include "mediastreamer2/mscodecutils.h" | |||
| #include "bcg729/encoder.h" | |||
| #ifdef HAVE_ms_bufferizer_fill_current_metas | |||
| #define ms_bufferizer_fill_current_metas(b,m) ms_bufferizer_fill_current_metas(b,m) | |||
| #else | |||
| #define ms_bufferizer_fill_current_metas(b,m) | |||
| #endif | |||
| /*filter common method*/ | |||
| struct bcg729Encoder_struct { | |||
| bcg729EncoderChannelContextStruct *encoderChannelContext; | |||
| MSBufferizer *bufferizer; | |||
| unsigned char ptime; | |||
| unsigned char max_ptime; | |||
| uint32_t ts; | |||
| uint8_t enableVAD; | |||
| }; | |||
| static void filter_init(MSFilter *f){ | |||
| struct bcg729Encoder_struct* obj; | |||
| f->data = ms_new0(struct bcg729Encoder_struct,1); | |||
| obj = (struct bcg729Encoder_struct*) f->data; | |||
| obj->ptime=20; | |||
| obj->max_ptime=100; | |||
| obj->enableVAD=0; | |||
| } | |||
| static void filter_preprocess(MSFilter *f){ | |||
| struct bcg729Encoder_struct* obj= (struct bcg729Encoder_struct*) f->data; | |||
| obj->encoderChannelContext = initBcg729EncoderChannel(obj->enableVAD); /* initialize bcg729 encoder, return context */ | |||
| obj->bufferizer=ms_bufferizer_new(); | |||
| } | |||
| static void filter_process(MSFilter *f){ | |||
| struct bcg729Encoder_struct* obj= (struct bcg729Encoder_struct*) f->data; | |||
| mblk_t *inputMessage; | |||
| mblk_t *outputMessage=NULL; | |||
| uint8_t inputBuffer[160]; /* 2bytes per sample at 8000Hz -> 16 bytes per ms */ | |||
| uint8_t bufferIndex=0; | |||
| /* get all input data into a buffer */ | |||
| while((inputMessage=ms_queue_get(f->inputs[0]))!=NULL){ | |||
| ms_bufferizer_put(obj->bufferizer,inputMessage); | |||
| } | |||
| /* process ptimes ms of data : (ptime in ms)/1000->ptime is seconds * 8000(sample rate) * 2(byte per sample) */ | |||
| while(ms_bufferizer_get_avail(obj->bufferizer)>=obj->ptime*16){ | |||
| uint16_t totalPacketDataLength = 0; | |||
| uint8_t bitStreamLength = 0; | |||
| outputMessage = allocb(obj->ptime,0); /* output bitStream is 80 bits long * number of samples */ | |||
| /* process buffer in 10 ms frames */ | |||
| /* RFC3551 section 4.5.6 we must end the RTP payload of G729 frames when transmitting a SID frame : bitStreamLength == 2 */ | |||
| for (bufferIndex=0; (bufferIndex<obj->ptime) && (bitStreamLength!=2); bufferIndex+=10) { | |||
| ms_bufferizer_read(obj->bufferizer,inputBuffer,160); | |||
| bcg729Encoder(obj->encoderChannelContext, (int16_t *)inputBuffer, outputMessage->b_wptr, &bitStreamLength); | |||
| outputMessage->b_wptr+=bitStreamLength; | |||
| totalPacketDataLength+=bitStreamLength; | |||
| } | |||
| obj->ts+=bufferIndex*8; | |||
| /* do not enqueue the message if no data out (DTX untransmitted frames) */ | |||
| if (totalPacketDataLength>0) { | |||
| mblk_set_timestamp_info(outputMessage,obj->ts); | |||
| ms_bufferizer_fill_current_metas(obj->bufferizer, outputMessage); | |||
| ms_queue_put(f->outputs[0],outputMessage); | |||
| } | |||
| } | |||
| } | |||
| static void filter_postprocess(MSFilter *f){ | |||
| struct bcg729Encoder_struct* obj= (struct bcg729Encoder_struct*) f->data; | |||
| ms_bufferizer_destroy(obj->bufferizer); | |||
| closeBcg729EncoderChannel(obj->encoderChannelContext); | |||
| } | |||
| static void filter_uninit(MSFilter *f){ | |||
| ms_free(f->data); | |||
| } | |||
| /*filter specific method*/ | |||
| static int filter_add_fmtp(MSFilter *f, void *arg){ | |||
| char buf[64]; | |||
| struct bcg729Encoder_struct* obj= (struct bcg729Encoder_struct*) f->data; | |||
| const char *fmtp=(const char *)arg; | |||
| buf[0] ='\0'; | |||
| if (fmtp_get_value(fmtp,"maxptime:",buf,sizeof(buf))){ | |||
| obj->max_ptime=atoi(buf); | |||
| if (obj->max_ptime <10 || obj->max_ptime >100 ) { | |||
| ms_warning("MSBCG729Enc: unknown value [%i] for maxptime, use default value (100) instead",obj->max_ptime); | |||
| obj->max_ptime=100; | |||
| } | |||
| ms_message("MSBCG729Enc: got maxptime=%i",obj->max_ptime); | |||
| } | |||
| if (fmtp_get_value(fmtp,"ptime",buf,sizeof(buf))){ | |||
| obj->ptime=atoi(buf); | |||
| if (obj->ptime > obj->max_ptime) { | |||
| obj->ptime=obj->max_ptime; | |||
| } else if (obj->ptime%10) { | |||
| //if the ptime is not a mulptiple of 10, go to the next multiple | |||
| obj->ptime = obj->ptime - obj->ptime%10 + 10; | |||
| } | |||
| ms_message("MSBCG729Enc: got ptime=%i",obj->ptime); | |||
| } | |||
| if (fmtp_get_value(fmtp,"annexb",buf,sizeof(buf))){ | |||
| if (strncmp(buf, "yes",3) == 0) { | |||
| obj->enableVAD = 1; | |||
| ms_message("MSBCG729Enc: enable VAD/DTX - AnnexB"); | |||
| } | |||
| } | |||
| /* parse annexB param here */ | |||
| return 0; | |||
| } | |||
| static MSFilterMethod filter_methods[]={ | |||
| { MS_FILTER_ADD_FMTP , filter_add_fmtp }, | |||
| { 0, NULL} | |||
| }; | |||
| #define MS_BCG729_ENC_ID MS_FILTER_PLUGIN_ID | |||
| #define MS_BCG729_ENC_NAME "MSBCG729Enc" | |||
| #define MS_BCG729_ENC_DESCRIPTION "G729 audio encoder filter" | |||
| #define MS_BCG729_ENC_CATEGORY MS_FILTER_ENCODER | |||
| #define MS_BCG729_ENC_ENC_FMT "G729" | |||
| #define MS_BCG729_ENC_NINPUTS 1 | |||
| #define MS_BCG729_ENC_NOUTPUTS 1 | |||
| #define MS_BCG729_ENC_FLAGS 0 | |||
| #ifndef _MSC_VER | |||
| MSFilterDesc ms_bcg729_enc_desc={ | |||
| .id=MS_BCG729_ENC_ID, | |||
| .name=MS_BCG729_ENC_NAME, | |||
| .text=MS_BCG729_ENC_DESCRIPTION, | |||
| .category=MS_BCG729_ENC_CATEGORY, | |||
| .enc_fmt=MS_BCG729_ENC_ENC_FMT, | |||
| .ninputs=MS_BCG729_ENC_NINPUTS, /*number of inputs*/ | |||
| .noutputs=MS_BCG729_ENC_NOUTPUTS, /*number of outputs*/ | |||
| .init=filter_init, | |||
| .preprocess=filter_preprocess, | |||
| .process=filter_process, | |||
| .postprocess=filter_postprocess, | |||
| .uninit=filter_uninit, | |||
| .methods=filter_methods, | |||
| .flags=MS_BCG729_ENC_FLAGS | |||
| }; | |||
| #else | |||
| MSFilterDesc ms_bcg729_enc_desc={ | |||
| MS_BCG729_ENC_ID, | |||
| MS_BCG729_ENC_NAME, | |||
| MS_BCG729_ENC_DESCRIPTION, | |||
| MS_BCG729_ENC_CATEGORY, | |||
| MS_BCG729_ENC_ENC_FMT, | |||
| MS_BCG729_ENC_NINPUTS, | |||
| MS_BCG729_ENC_NOUTPUTS, | |||
| filter_init, | |||
| filter_preprocess, | |||
| filter_process, | |||
| filter_postprocess, | |||
| filter_uninit, | |||
| filter_methods, | |||
| MS_BCG729_ENC_FLAGS | |||
| }; | |||
| #endif | |||
| MS_FILTER_DESC_EXPORT(ms_bcg729_enc_desc) | |||
| #ifdef _MSC_VER | |||
| #define MS_PLUGIN_DECLARE(type) __declspec(dllexport) type | |||
| #else | |||
| #define MS_PLUGIN_DECLARE(type) type | |||
| #endif | |||
| extern MSFilterDesc ms_bcg729_dec_desc; | |||
| #ifndef VERSION | |||
| #define VERSION "debug" | |||
| #endif | |||
| MS_PLUGIN_DECLARE(void) libmsbcg729_init(MSFactory * factory){ | |||
| ms_factory_register_filter(factory, &ms_bcg729_enc_desc); | |||
| ms_factory_register_filter(factory, &ms_bcg729_dec_desc); | |||
| ms_message(" libmsbcg729 " VERSION " plugin loaded"); | |||
| } | |||