Commit 6e1214ca authored by Ghislain MARY's avatar Ghislain MARY

The plugin part is no longer a plugin and is now integrated in mediastreamer2.

parent 781e209a
......@@ -26,10 +26,12 @@
# BCG729_FOUND - system has bcg729
# BCG729_INCLUDE_DIRS - the bcg729 include directory
# BCG729_LIBRARIES - The libraries needed to use bcg729
# BCG729_CPPFLAGS - The compilation flags needed to use bcg729
include("${CMAKE_CURRENT_LIST_DIR}/Bcg729Targets.cmake")
get_filename_component(BCG729_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(BCG729_INCLUDE_DIRS "${BCG729_CMAKE_DIR}/../../../include")
set(BCG729_LIBRARIES bcg729)
set(BCG729_CPPFLAGS @BCG729_CPPFLAGS@)
set(BCG729_FOUND 1)
......@@ -37,28 +37,9 @@ set(VERSION "${PACKAGE_VERSION}")
option(ENABLE_SHARED "Build shared library." YES)
option(ENABLE_STATIC "Build static library." YES)
option(ENABLE_TESTS "Enable compilation of the tests." NO)
option(ENABLE_MSPLUGIN "Enable compilation of the mediastreamer2 plugin." YES)
include(GNUInstallDirs)
if(ENABLE_MSPLUGIN)
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
include("${EP_ms2_CONFIG_DIR}/Mediastreamer2Config.cmake")
include("${EP_ortp_CONFIG_DIR}/ORTPConfig.cmake")
else()
find_package(Mediastreamer2)
find_package(ORTP)
endif()
if(NOT MEDIASTREAMER2_FOUND)
message(WARNING "Could not find the mediastreamer2 libraries!")
set(ENABLE_MSPLUGIN OFF CACHE BOOL "Enable compilation of the mediastreamer2 plugin." FORCE)
endif()
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
include_directories(
include
......@@ -71,6 +52,12 @@ if(MSVC)
include_directories(${MSVC_INCLUDE_DIR})
endif()
set(BCG729_CPPFLAGS )
if(ENABLE_STATIC)
set(BCG729_STATIC 1)
list(APPEND BCG729_CPPFLAGS "-DBCG729_STATIC")
endif()
add_definitions(-DHAVE_CONFIG_H)
if(MSVC)
add_definitions("/W3")
......@@ -81,41 +68,39 @@ else()
endif()
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
add_subdirectory(include)
add_subdirectory(src)
if(ENABLE_MSPLUGIN)
add_subdirectory(msbcg729)
endif()
if(ENABLE_TESTS AND NOT ENABLE_MSPLUGIN)
if(ENABLE_TESTS)
add_subdirectory(test)
endif()
if (NOT ENABLE_MSPLUGIN)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/Bcg729ConfigVersion.cmake"
VERSION ${PACKAGE_VERSION}
COMPATIBILITY AnyNewerVersion
)
export(EXPORT Bcg729Targets
FILE "${CMAKE_CURRENT_BINARY_DIR}/Bcg729Targets.cmake"
)
configure_file(Bcg729Config.cmake
"${CMAKE_CURRENT_BINARY_DIR}/Bcg729Config.cmake"
COPYONLY
)
set(CONFIG_PACKAGE_LOCATION "${CMAKE_INSTALL_DATADIR}/Bcg729/cmake")
install(EXPORT Bcg729Targets
FILE Bcg729Targets.cmake
DESTINATION ${CONFIG_PACKAGE_LOCATION}
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/Bcg729Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/Bcg729ConfigVersion.cmake"
DESTINATION ${CONFIG_PACKAGE_LOCATION}
)
endif()
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/Bcg729ConfigVersion.cmake"
VERSION ${PACKAGE_VERSION}
COMPATIBILITY AnyNewerVersion
)
export(EXPORT Bcg729Targets
FILE "${CMAKE_CURRENT_BINARY_DIR}/Bcg729Targets.cmake"
)
configure_file(Bcg729Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/Bcg729Config.cmake"
@ONLY
)
set(CONFIG_PACKAGE_LOCATION "${CMAKE_INSTALL_DATADIR}/Bcg729/cmake")
install(EXPORT Bcg729Targets
FILE Bcg729Targets.cmake
DESTINATION ${CONFIG_PACKAGE_LOCATION}
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/Bcg729Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/Bcg729ConfigVersion.cmake"
DESTINATION ${CONFIG_PACKAGE_LOCATION}
)
# CPack settings
set(CPACK_PACKAGE_NAME "bcg729")
......
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = bcg729.spec Bcg729Config.cmake CMakeLists.txt config.h.cmake msbcg729/CMakeLists.txt src/CMakeLists.txt
EXTRA_DIST = bcg729.spec Bcg729Config.cmake CMakeLists.txt config.h.cmake src/CMakeLists.txt
SUBDIRS = include src
if BUILD_MSBCG729
SUBDIRS += msbcg729
endif
if RUN_TESTS
SUBDIRS += test
endif
......
......@@ -23,8 +23,7 @@ Compilation
### Dependencies
If you want build bcg729 as Mediastreamer's plugin, you need to have *Mediastreamer[1]* installed on your system.
Otherwise, no dependency is requested.
No dependency is requested.
### Build procedure
......@@ -44,7 +43,6 @@ Building by Autotools way is deprecated. Use [CMake][cmake-website] to configure
* `ENABLE_SHARED=NO` : do not build the shared library
* `ENABLE_STATIC=NO` : do not build the static library
* `ENABLE_TESTS=NO` : do not build non-regression tests
* `ENABLE_MSPLUGIN=NO` : do not build the Mediastreamer plugin version
### Note for packagers
......@@ -73,8 +71,5 @@ Tests suite
---------------------------------------
[1] Mediastreamer2: git://git.linphone.org/mediastreamer2.git *or* <http://www.linphone.org/releases/sources/mediastreamer>
[bcg729-patern]: http://www.belledonne-communications.com/downloads/bcg729-patterns.zip
[cmake-website]: https://cmake.org/
......@@ -2,7 +2,7 @@
## rpmbuild options
Summary: Bcg729 codec plugin for mediastreamer2
Summary: Bcg729 codec implementation
Name: bcg729
Version: 1.0
Release: 1
......@@ -14,7 +14,7 @@ Source0: %{name}-%{version}.tar.gz
Requires: bash >= 2.0
%description
BCG729 codec plugin for mediastreamer2.
BCG729 codec implementation.
%package devel
Summary: Development libraries for bcg729
......@@ -22,7 +22,7 @@ Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
BCG729 codec plugin for mediastreamer2.
BCG729 codec implementation.
%prep
%setup -q
......

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
<?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>
\ No newline at end of file
......@@ -28,3 +28,5 @@
#cmakedefine PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"
#cmakedefine PACKAGE_URL "@PACKAGE_URL@"
#cmakedefine VERSION "@VERSION@"
#cmakedefine BCG729_STATIC
......@@ -24,39 +24,12 @@ AC_ARG_ENABLE([tests],
AS_HELP_STRING([--disable-tests], [Disable the tests]))
AM_CONDITIONAL([RUN_TESTS], [test "x$enable_tests" != "xno"])
dnl configure option to disable mediastreamer plugin
AC_ARG_ENABLE([msplugin],
AS_HELP_STRING([--disable-msplugin], [Disable the mediastreamer plugin]),
enable_msplugin="$enableval",
enable_msplugin="yes"
)
CFLAGS="$CFLAGS -Wall"
if test $GCC = yes && test $wall_werror = yes; then
CFLAGS="$CFLAGS -Werror "
fi
dnl check for libraries that have pkg-config files installed
PKG_CHECK_MODULES(ORTP, ortp >= 0.21.0,[found_ortp=true],foo=bar)
PKG_CHECK_MODULES(MEDIASTREAMER, mediastreamer >= 2.8.99,[found_ms2=true],foo=bar)
if test x${found_ms2}x${found_ortp}x${enable_msplugin} = xtruextruexyes ; then
build_msbcg729=true
else
ORTP_CFLAGS=
ORTP_LIBS=
MEDIASTREAMER_CFLAGS=
MEDIASTREAMER_LIBS=
fi
AC_SUBST(ORTP_CFLAGS)
AC_SUBST(ORTP_LIBS)
AC_SUBST(MEDIASTREAMER_CFLAGS)
AC_SUBST(MEDIASTREAMER_LIBS)
AM_CONDITIONAL(BUILD_MSBCG729, test x$build_msbcg729 = xtrue)
VISIBILITY_CFLAGS=
case "$target_os" in
*mingw*)
......@@ -88,7 +61,6 @@ AC_CONFIG_FILES([
src/Makefile
include/Makefile
include/bcg729/Makefile
msbcg729/Makefile
test/Makefile
test/bin/Makefile
libbcg729.pc
......
############################################################################
# CMakeLists.txt
# Copyright (C) 2014 Belledonne Communications, Grenoble France
# Copyright (C) 2017 Belledonne Communications, Grenoble France
#
############################################################################
#
......@@ -20,39 +20,18 @@
#
############################################################################
set(SOURCE_FILES
bcg729_dec.c
bcg729_enc.c
set(HEADER_FILES
decoder.h
encoder.h
)
include_directories(${MEDIASTREAMER2_INCLUDE_DIRS})
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)
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()
install(FILES ${BCG729_HEADER_FILES}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/bcg729
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
......@@ -2,8 +2,5 @@ bcg729_includedir=$(includedir)/bcg729
public_headers=encoder.h decoder.h
bcg729_include_HEADERS=
if !BUILD_MSBCG729
bcg729_include_HEADERS+=$(public_headers)
endif
bcg729_include_HEADERS=$(public_headers)
......@@ -24,9 +24,17 @@ typedef struct bcg729DecoderChannelContextStruct_struct bcg729DecoderChannelCont
#include <stdint.h>
#ifdef _WIN32
#define BCG729_VISIBILITY
#ifdef BCG729_STATIC
#define BCG729_VISIBILITY
#else
#ifdef BCG729_EXPORTS
#define BCG729_VISIBILITY __declspec(dllexport)
#else
#define BCG729_VISIBILITY __declspec(dllimport)
#endif
#endif
#else
#define BCG729_VISIBILITY __attribute__ ((visibility ("default")))
#define BCG729_VISIBILITY __attribute__ ((visibility ("default")))
#endif
/*****************************************************************************/
......@@ -35,7 +43,7 @@ typedef struct bcg729DecoderChannelContextStruct_struct bcg729DecoderChannelCont
/* - the decoder channel context data */
/* */
/*****************************************************************************/
BCG729_VISIBILITY bcg729DecoderChannelContextStruct *initBcg729DecoderChannel();
BCG729_VISIBILITY bcg729DecoderChannelContextStruct *initBcg729DecoderChannel(void);
/*****************************************************************************/
/* closeBcg729DecoderChannel : free memory of context structure */
......
......@@ -24,9 +24,17 @@
typedef struct bcg729EncoderChannelContextStruct_struct bcg729EncoderChannelContextStruct;
#ifdef _WIN32
#define BCG729_VISIBILITY
#ifdef BCG729_STATIC
#define BCG729_VISIBILITY
#else
#ifdef BCG729_EXPORTS
#define BCG729_VISIBILITY __declspec(dllexport)
#else
#define BCG729_VISIBILITY __declspec(dllimport)
#endif
#endif
#else
#define BCG729_VISIBILITY __attribute__ ((visibility ("default")))
#define BCG729_VISIBILITY __attribute__ ((visibility ("default")))
#endif
/*****************************************************************************/
......
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)
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)
/*
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,