- fixes for minimalistic builds (without AMR / EVS / Opus codecs)

This commit is contained in:
Dmytro Bogovych 2021-01-21 13:53:25 +02:00
parent 1007d752bc
commit 33465c33a1
3 changed files with 17 additions and 13 deletions

View File

@ -57,10 +57,10 @@ set (CMAKE_CXX_STANDARD_REQUIRED ON)
set (rtphone_libs libs)
set (rtphone_engine engine)
set (USE_AMR_CODEC OFF CACHE BOOL "Use AMR codec. Requires libraries." OFF)
set (USE_EVS_CODEC OFF CACHE BOOL "Use EVS codec." OFF)
set (USE_OPUS_CODEC OFF CACHE BOOL "Use Opus codec." OFF)
set (USE_SEVANA_LIB OFF CACHE BOOL "Build with Sevana libraries" OFF)
set (USE_AMR_CODEC FALSE CACHED BOOL "Use AMR codec. Requires libraries.")
set (USE_EVS_CODEC FALSE CACHED BOOL "Use EVS codec." )
set (USE_OPUS_CODEC FALSE CACHED BOOL "Use Opus codec." )
set (USE_SEVANA_LIB FALSE CACHED BOOL "Build with Sevana libraries" )
# PIC code by default
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
@ -86,6 +86,7 @@ if (CMAKE_SYSTEM MATCHES "Darwin*")
endif()
if (USE_SEVANA_LIB)
message("Use Sevana libraries")
add_definitions( -DUSE_AQUA_LIBRARY -DUSE_PVQA_LIBRARY)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libs/pvqa/include)
endif()

View File

@ -8,10 +8,10 @@ set (CMAKE_CXX_STANDARD_REQUIRED ON)
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
# Set of variables to control references to codecs
set (USE_AMR_CODEC OFF CACHE BOOL "Use AMR codec. Requires libraries." OFF)
set (USE_EVS_CODEC OFF CACHE BOOL "Use EVS codec." OFF)
set (USE_OPUS_CODEC OFF CACHE BOOL "Use Opus codec." OFF)
set (USE_SEVANA_LIB OFF CACHE BOOL "Build with Sevana libraries" OFF)
set (USE_AMR_CODEC OFF CACHE BOOL "Use AMR codec. Requires libraries.")
set (USE_EVS_CODEC OFF CACHE BOOL "Use EVS codec." )
set (USE_OPUS_CODEC OFF CACHE BOOL "Use Opus codec." )
set (USE_SEVANA_LIB OFF CACHE BOOL "Build with Sevana libraries" )
set (SOURCES
MT_Statistics.cpp
@ -46,16 +46,19 @@ set (SOURCES
)
if (USE_AMR_CODEC)
message("AMR NB and WB codecs will be included.")
add_definitions(-DUSE_AMR_CODEC)
set(SOURCES ${SOURCES} MT_AmrCodec.cpp MT_AmrCodec.h)
endif()
if (USE_EVS_CODEC)
message("EVS codec will be included.")
add_definitions (-DUSE_EVS_CODEC)
set (SOURCES ${SOURCES} MT_EvsCodec.cpp MT_EvsCodec.h)
endif()
if (USE_OPUS_CODEC)
message("Opus codec will be included.")
add_definitions(-DUSE_OPUS_CODEC)
endif()

View File

@ -1,4 +1,4 @@
/* Copyright(C) 2007-2018 VoIPobjects (voipobjects.com)
/* Copyright(C) 2007-2021 VoIPobjects (voipobjects.com)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -13,7 +13,7 @@
#include "../audio/Audio_Interface.h"
#include "../audio/Audio_Resampler.h"
#if !defined(TARGET_ANDROID) && !defined(TARGET_OPENWRT) && !defined(TARGET_WIN) && !defined(TARGET_RPI)
#if !defined(TARGET_ANDROID) && !defined(TARGET_OPENWRT) && !defined(TARGET_WIN) && !defined(TARGET_RPI) && defined(USE_AMR_CODEC)
# include "MT_AmrCodec.h"
#endif
@ -49,8 +49,8 @@ int RtpBuffer::Packet::rate() const
// ------------ RtpBuffer ----------------
RtpBuffer::RtpBuffer(Statistics& stat)
:mStat(stat), mSsrc(0), mHigh(RTP_BUFFER_HIGH), mLow(RTP_BUFFER_LOW), mPrebuffer(RTP_BUFFER_PREBUFFER),
mFirstPacketWillGo(true),
mReturnedCounter(0), mAddCounter(0), mFetchedPacket(std::shared_ptr<RTPPacket>(), 0, 0)
mFirstPacketWillGo(true), mReturnedCounter(0), mAddCounter(0),
mFetchedPacket(std::shared_ptr<RTPPacket>(), 0, 0)
{
}
@ -694,7 +694,7 @@ float AudioReceiver::calculatePvqaMos(int rate, std::string& report)
void AudioReceiver::processStatisticsWithAmrCodec(Codec* c)
{
#if !defined(TARGET_ANDROID) && !defined(TARGET_OPENWRT) && !defined(TARGET_WIN) && !defined(TARGET_RPI)
#if !defined(TARGET_ANDROID) && !defined(TARGET_OPENWRT) && !defined(TARGET_WIN) && !defined(TARGET_RPI) && defined(USE_AMR_CODEC)
AmrNbCodec* nb = dynamic_cast<AmrNbCodec*>(c);
AmrWbCodec* wb = dynamic_cast<AmrWbCodec*>(c);