Commit 0e3af8f2 authored by Ghislain MARY's avatar Ghislain MARY

Include g729 support in mediastreamer2 instead of using a plugin.

parent 4a3adb04
......@@ -90,7 +90,8 @@ option(ENABLE_BV16 "Build mediastreamer2 with the BV16 codec." YES)
option(ENABLE_OPUS "Build mediastreamer2 with the OPUS codec." YES)
option(ENABLE_SPEEX_CODEC "Build mediastreamer2 with the SPEEX codec." YES)
option(ENABLE_SPEEX_DSP "Build mediastreamer2 with the SPEEX DSP support." YES)
option(ENABLE_G729B_CNG "Build mediastremer2 with G729 annex B cng." NO)
option(ENABLE_G729 "Build mediastreamer2 with the G729 codec." YES)
option(ENABLE_G729B_CNG "Build mediastreamer2 with G729 annex B cng." NO)
cmake_dependent_option(ENABLE_RESAMPLE "Build mediastreamer2 with the resampling capability." YES "ENABLE_SPEEX_DSP" NO)
option(ENABLE_VIDEO "Build mediastreamer2 with video support." YES)
......@@ -320,11 +321,12 @@ if(ENABLE_SOUND AND NOT(WIN32 OR ENABLE_ALSA OR ENABLE_ARTSC OR ENABLE_MACSND OR
message(FATAL_ERROR "Could not find a support sound driver API. Use -DENABLE_SOUND=NO if you don't care about having sound.")
endif()
if(ENABLE_G729B_CNG)
if(ENABLE_G729 OR ENABLE_G729B_CNG)
find_package(Bcg729 1.0.1)
if(NOT BCG729_FOUND)
message(WARNING "Could not find bcg729 , mediastreamer2 will be compiled without G729 AnnexB in RFC3389 .")
set(ENABLE_G729_CNG OFF CACHE BOOL "Build mediastreamer2 with g729 CNG." FORCE)
message(WARNING "Could not find bcg729, mediastreamer2 will be compiled without G729 codec and G729 AnnexB in RFC3389.")
set(ENABLE_G729 OFF CACHE BOOL "Build mediastreamer2 with the G729 codec." FORCE)
set(ENABLE_G729_CNG OFF CACHE BOOL "Build mediastreamer2 with G729 Annex B cng." FORCE)
endif()
endif()
......@@ -539,7 +541,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/mediastreamer-config.h.cmake ${CMAKE_
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/mediastreamer-config.h PROPERTIES GENERATED ON)
add_definitions("-DHAVE_CONFIG_H")
set(MEDIASTREAMER2_CPPFLAGS ${ORTP_CPPFLAGS} ${BZRTP_CPPFLAGS} ${BCTOOLBOX_CPPFLAGS})
set(MEDIASTREAMER2_CPPFLAGS ${ORTP_CPPFLAGS} ${BZRTP_CPPFLAGS} ${BCTOOLBOX_CPPFLAGS} ${BCG729_CPPFLAGS})
if(ENABLE_STATIC)
list(APPEND MEDIASTREAMER2_CPPFLAGS "-DMS2_STATIC")
endif()
......
......@@ -1165,6 +1165,27 @@ fi
AM_CONDITIONAL(LIBBZRTP,test x$zrtp != xfalse)
dnl check for bcg729 presence to use for G729 codec
AC_ARG_ENABLE(g729,
[AS_HELP_STRING([--enable-g729], [Turn on or off usage of G729 codec (default=no)])],
[case "${enableval}" in
yes) g729=true ;;
no) g729=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-g729) ;;
esac],
[g729=false]
)
if test "$g729" = "true" ; then
PKG_CHECK_MODULES(LIBBCG729, libbcg729 >= 1.0)
LIBS="$LIBS $LIBBCG729_LIBS"
CFLAGS="$CFLAGS $LIBBCG729_CFLAGS"
else
echo "G729 codec is disabled."
fi
AM_CONDITIONAL(BUILD_G729,test x$g729 != xfalse)
dnl check for bcg729 annexB presence to use for VAD/DTX (RFC3389 : Real-time Transport Protocol (RTP) Payload for Comfort Noise (CN))
AC_ARG_ENABLE(g729bCN,
[AS_HELP_STRING([--enable-g729bCN], [Turn on or off usage of G729AnnexB in RFC3389 implementation of Comfort Noise Payload (default=no)])],
......@@ -1186,6 +1207,7 @@ if test "$g729bCN" = "true" ; then
else
echo "G729 AnnexB in RFC3389 is disabled."
fi
AM_CONDITIONAL(LIBBCG729,test x$g729bCN != xfalse)
dnl ##################################################
......
......@@ -159,7 +159,9 @@ typedef enum MSFilterId{
MS_BV16_ENC_ID,
MS_UDP_SEND_ID,
MS_PCAP_FILE_PLAYER_ID,
MS_OGL_ID
MS_OGL_ID,
MS_G729_DEC_ID,
MS_G729_ENC_ID
} MSFilterId;
#endif
......@@ -252,6 +252,9 @@ endif()
if(ENABLE_G726)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/g726.c)
endif()
if(BCG729_FOUND AND ENABLE_G729)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/g729.c)
endif()
if(GSM_FOUND)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/gsm.c)
endif()
......@@ -617,8 +620,10 @@ endif()
if(TURBOJPEG_FOUND)
list(APPEND VOIP_LIBS ${TURBOJPEG_LIBRARIES})
endif()
if (BCGG729_FOUND)
add_definitions(-DHAVE_G729B=1)
if(BCG729_FOUND)
if(ENABLE_G729_CNG)
add_definitions("-DHAVE_G729B=1")
endif()
list(APPEND VOIP_LIBS ${BCG729_LIBRARIES})
endif()
set(MS2_VOIP_DEPENDENCIES ms2-git-version ms2-voipdescs-header)
......
......@@ -177,6 +177,10 @@ if BUILD_G726
libmediastreamer_voip_la_SOURCES+= audiofilters/g726.c
endif
if BUILD_G729
libmediastreamer_voip_la_SOURCES+= audiofilters/g729.c
endif
if BUILD_OPUS
libmediastreamer_voip_la_SOURCES+= audiofilters/msopus.c
endif
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment