- more changes for sevana enabled builds
This commit is contained in:
parent
0f4cedb949
commit
7b78c3ce73
|
|
@ -59,7 +59,9 @@ set (rtphone_engine engine)
|
||||||
|
|
||||||
option (USE_AMR_CODEC "Use AMR codec. Requires libraries." OFF)
|
option (USE_AMR_CODEC "Use AMR codec. Requires libraries." OFF)
|
||||||
option (USE_EVS_CODEC "Use EVS codec." OFF)
|
option (USE_EVS_CODEC "Use EVS codec." OFF)
|
||||||
|
option (USE_SEVANA_LIB "Build with Sevana libraries" OFF)
|
||||||
|
|
||||||
|
# PIC code by default
|
||||||
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
|
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
|
|
||||||
if (NOT DEFINED LIB_PLATFORM)
|
if (NOT DEFINED LIB_PLATFORM)
|
||||||
|
|
@ -82,6 +84,11 @@ if (CMAKE_SYSTEM MATCHES "Darwin*")
|
||||||
add_definitions (-DTARGET_OSX)
|
add_definitions (-DTARGET_OSX)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (USE_SEVANA_LIB)
|
||||||
|
add_definitions( -DUSE_AQUA_LIBRARY -DUSE_PVQA_LIBRARY)
|
||||||
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libs/pvqa/include)
|
||||||
|
endif()
|
||||||
|
|
||||||
set (RTPHONE_SOURCES
|
set (RTPHONE_SOURCES
|
||||||
${rtphone_engine}/media/MT_Statistics.cpp
|
${rtphone_engine}/media/MT_Statistics.cpp
|
||||||
${rtphone_engine}/media/MT_WebRtc.cpp
|
${rtphone_engine}/media/MT_WebRtc.cpp
|
||||||
|
|
@ -203,4 +210,5 @@ target_include_directories(rtphone
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/libs/json
|
${CMAKE_CURRENT_SOURCE_DIR}/libs/json
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# For MSVC static builds
|
||||||
configure_msvc_runtime()
|
configure_msvc_runtime()
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ void AgentImpl::processConfig(Json::Value &d, Json::Value &answer)
|
||||||
#if !defined(TARGET_ANDROID) && defined(USE_AQUA_LIBRARY)
|
#if !defined(TARGET_ANDROID) && defined(USE_AQUA_LIBRARY)
|
||||||
std::string aquaLicense = d["aqua-license"].asString();
|
std::string aquaLicense = d["aqua-license"].asString();
|
||||||
if (!aquaLicense.empty())
|
if (!aquaLicense.empty())
|
||||||
sevana::aqua::initializeLibrary(aquaLicense);
|
sevana::aqua::initialize(aquaLicense.c_str(), aquaLicense.size());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::string transport = d["transport"].asString();
|
std::string transport = d["transport"].asString();
|
||||||
|
|
@ -333,13 +333,13 @@ void AgentImpl::processStartSession(Json::Value& request, Json::Value& answer)
|
||||||
|
|
||||||
#if defined(USE_AQUA_LIBRARY)
|
#if defined(USE_AQUA_LIBRARY)
|
||||||
std::string temp_path = request["aqua_temp_path"].asString();
|
std::string temp_path = request["aqua_temp_path"].asString();
|
||||||
std::string config = "-avlp on -smtnrm on -decor off -mprio off -npnt auto -voip off -enorm off -g711 on -spfrcor off -grad off -tmc on -miter 1 -trim a 10";
|
std::string config = "-avlp on -smtnrm on -decor off -mprio off -npnt auto -voip off -enorm off -g711 on -spfrcor off -grad off -tmc on -miter 1 -trim a 10 -output json";
|
||||||
if (temp_path.size())
|
/*if (temp_path.size())
|
||||||
config += " -fau " + temp_path;
|
config += " -fau " + temp_path; */
|
||||||
|
|
||||||
auto qc = std::make_shared<sevana::aqua>();
|
auto qc = std::make_shared<sevana::aqua>();
|
||||||
qc->setTempPath(temp_path);
|
//qc->setTempPath(temp_path);
|
||||||
qc->configureWith(MT::SevanaAqua::parseConfig(config));
|
qc->configure_with(sevana::aqua::parse(config));
|
||||||
|
|
||||||
mAquaMap[sessionIter->first] = qc;
|
mAquaMap[sessionIter->first] = qc;
|
||||||
dynamic_cast<AudioProvider*>(audioProvider.get())->configureMediaObserver(this, (void*)qc.get());
|
dynamic_cast<AudioProvider*>(audioProvider.get())->configureMediaObserver(this, (void*)qc.get());
|
||||||
|
|
@ -551,24 +551,16 @@ void AgentImpl::processGetMediaStats(Json::Value& request, Json::Value& answer)
|
||||||
while (wasRead == 1024);
|
while (wasRead == 1024);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MT::PSevanaAqua sa = mAquaMap[sessionIter->first];
|
|
||||||
MT::SevanaAqua::AudioBuffer test(mAquaIncoming.data(), mAquaIncoming.size()),
|
auto sa = mAquaMap[sessionIter->first];
|
||||||
|
sevana::aqua::audio_buffer test(mAquaIncoming.data(), mAquaIncoming.size()),
|
||||||
reference(referenceAudio.data(), referenceAudio.size());
|
reference(referenceAudio.data(), referenceAudio.size());
|
||||||
test.mRate = AUDIO_SAMPLERATE; reference.mRate = AUDIO_SAMPLERATE;
|
test.mRate = AUDIO_SAMPLERATE; reference.mRate = AUDIO_SAMPLERATE;
|
||||||
test.mChannels = AUDIO_CHANNELS; reference.mChannels = AUDIO_CHANNELS;
|
test.mChannels = AUDIO_CHANNELS; reference.mChannels = AUDIO_CHANNELS;
|
||||||
|
|
||||||
MT::SevanaAqua::CompareResult r = sa->compare(reference, test);
|
auto r = sa->compare(reference, test);
|
||||||
answer["aqua_mos"] = r.mMos;
|
answer["aqua_mos"] = r.mMos;
|
||||||
|
answer["aqua_report"] = r.mFaultsText;
|
||||||
if (r.mFaults)
|
|
||||||
{
|
|
||||||
Json::Value json(r.mReport);
|
|
||||||
Json::Value faults = r.mFaults->toJson();
|
|
||||||
json["faults"] = faults;
|
|
||||||
answer["aqua_report"] = json.toStyledString();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
answer["aqua_report"] = r.mReport;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -745,7 +737,7 @@ void AgentImpl::onMedia(const void* data, int length, MT::Stream::MediaDirection
|
||||||
mOutgoingAudioDump->write(data, length);*/
|
mOutgoingAudioDump->write(data, length);*/
|
||||||
|
|
||||||
// User tag points to accumulator object which includes
|
// User tag points to accumulator object which includes
|
||||||
MT::SevanaAqua* sa = reinterpret_cast<MT::SevanaAqua*>(userTag);
|
// auto* sa = reinterpret_cast<sevana::aqua*>(userTag);
|
||||||
|
|
||||||
switch (direction)
|
switch (direction)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ protected:
|
||||||
|
|
||||||
#if defined(USE_AQUA_LIBRARY)
|
#if defined(USE_AQUA_LIBRARY)
|
||||||
// Keys are the same as used in mSessionMap
|
// Keys are the same as used in mSessionMap
|
||||||
typedef std::map<int, std::shared_ptr<sevana::aqua> AquaMap;
|
typedef std::map<int, std::shared_ptr<sevana::aqua>> AquaMap;
|
||||||
AquaMap mAquaMap;
|
AquaMap mAquaMap;
|
||||||
ByteBuffer mAquaIncoming, mAquaOutgoing;
|
ByteBuffer mAquaIncoming, mAquaOutgoing;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue