Commit bddafa83 authored by Ghislain MARY's avatar Ghislain MARY

Add option to enable build of G.726 codec when building with CMake.

parent 81c12579
......@@ -84,6 +84,7 @@ cmake_dependent_option(ENABLE_QSA "Enable QSA (QNX Sound Architecture) support."
cmake_dependent_option(ENABLE_OSS "Enable OSS support." NO "ENABLE_SOUND;LINUX_OR_BSD" NO)
cmake_dependent_option(ENABLE_PORTAUDIO "Enable portaudio native support." NO "ENABLE_SOUND" NO)
cmake_dependent_option(ENABLE_PULSEAUDIO "Enable pulseaudio support." YES "ENABLE_SOUND" NO)
option(ENABLE_G726 "Build mediastreamer2 with the G726 codec." NO)
option(ENABLE_GSM "Build mediastreamer2 with the GSM codec." YES)
option(ENABLE_BV16 "Build mediastreamer2 with the BV16 codec." YES)
option(ENABLE_OPUS "Build mediastreamer2 with the OPUS codec." YES)
......@@ -184,6 +185,9 @@ if(ENABLE_ZRTP)
set(ENABLE_ZRTP OFF CACHE BOOL "Build mediastreamer2 with ZRTP support." FORCE)
endif()
endif()
if(ENABLE_G726)
find_package(SpanDSP REQUIRED)
endif()
if(ENABLE_GSM)
find_package(GSM)
if(NOT GSM_FOUND)
......@@ -338,6 +342,9 @@ endif()
if(SRTP_FOUND)
include_directories(${SRTP_INCLUDE_DIRS})
endif()
if(SPANDSP_FOUND)
include_directories(${SPANDSP_INCLUDE_DIRS})
endif()
if(GSM_FOUND)
include_directories(${GSM_INCLUDE_DIRS})
endif()
......
############################################################################
# FindSpanDSP.txt
# Copyright (C) 2016 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
#
# - Find the spandsp include file and library
#
# SPANDSP_FOUND - system has spandsp
# SPANDSP_INCLUDE_DIRS - the spandsp include directory
# SPANDSP_LIBRARIES - The libraries needed to use spandsp
find_path(SPANDSP_INCLUDE_DIRS
NAMES spandsp.h
PATH_SUFFIXES include
)
if(SPANDSP_INCLUDE_DIRS)
set(HAVE_SPANDSP_H 1)
endif()
find_library(SPANDSP_LIBRARIES
NAMES spandsp
PATH_SUFFIXES bin lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SpanDSP
DEFAULT_MSG
SPANDSP_INCLUDE_DIRS SPANDSP_LIBRARIES HAVE_SPANDSP_H
)
mark_as_advanced(SPANDSP_INCLUDE_DIRS SPANDSP_LIBRARIES HAVE_SPANDSP_H)
......@@ -238,6 +238,9 @@ if(WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_
list(APPEND VOIP_SOURCE_FILES_C audiofilters/winsnd3.c)
endif()
if(ENABLE_G726)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/g726.c)
endif()
if(GSM_FOUND)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/gsm.c)
endif()
......@@ -496,6 +499,9 @@ endif()
if(SRTP_FOUND)
list(APPEND VOIP_LIBS ${SRTP_LIBRARIES})
endif()
if(SPANDSP_FOUND)
list(APPEND VOIP_LIBS ${SPANDSP_LIBRARIES})
endif()
if(GSM_FOUND)
list(APPEND VOIP_LIBS ${GSM_LIBRARIES})
endif()
......
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