- remove references to Sevana libraries
This commit is contained in:
parent
defe8531e7
commit
21fb865d80
|
|
@ -526,24 +526,13 @@ void AgentImpl::processGetMediaStats(JsonCpp::Value& request, JsonCpp::Value& an
|
||||||
{
|
{
|
||||||
PSession session = sessionIter->second;
|
PSession session = sessionIter->second;
|
||||||
VariantMap result;
|
VariantMap result;
|
||||||
bool includePvqa = request["include_pvqa"].asBool();
|
session->getSessionInfo(Session::InfoOptions::Detailed,
|
||||||
#if defined(USE_AQUA_LIBRARY)
|
|
||||||
bool includeAqua = request["include_aqua"].asBool();
|
|
||||||
std::string aquaReference = request["aqua_reference_audio"].asString();
|
|
||||||
#endif
|
|
||||||
session->getSessionInfo(includePvqa ? Session::InfoOptions::Detailed : Session::InfoOptions::Standard,
|
|
||||||
result);
|
result);
|
||||||
|
|
||||||
if (result.exists(SessionInfo_AudioCodec))
|
if (result.exists(SessionInfo_AudioCodec))
|
||||||
answer["codec"] = result[SessionInfo_AudioCodec].asStdString();
|
answer["codec"] = result[SessionInfo_AudioCodec].asStdString();
|
||||||
if (result.exists(SessionInfo_NetworkMos))
|
if (result.exists(SessionInfo_NetworkMos))
|
||||||
answer["network_mos"] = result[SessionInfo_NetworkMos].asFloat();
|
answer["network_mos"] = result[SessionInfo_NetworkMos].asFloat();
|
||||||
#if defined(USE_PVQA_LIBRARY)
|
|
||||||
if (result.exists(SessionInfo_PvqaMos))
|
|
||||||
answer["pvqa_mos"] = result[SessionInfo_PvqaMos].asFloat();
|
|
||||||
if (result.exists(SessionInfo_PvqaReport))
|
|
||||||
answer["pvqa_report"] = CsvReportToJson(result[SessionInfo_PvqaReport].asStdString());
|
|
||||||
#endif
|
|
||||||
if (result.exists(SessionInfo_PacketLoss))
|
if (result.exists(SessionInfo_PacketLoss))
|
||||||
answer["rtp_lost"] = result[SessionInfo_LostRtp].asInt();
|
answer["rtp_lost"] = result[SessionInfo_LostRtp].asInt();
|
||||||
if (result.exists(SessionInfo_DroppedRtp))
|
if (result.exists(SessionInfo_DroppedRtp))
|
||||||
|
|
@ -566,69 +555,6 @@ void AgentImpl::processGetMediaStats(JsonCpp::Value& request, JsonCpp::Value& an
|
||||||
if (result.exists(SessionInfo_RemotePeer))
|
if (result.exists(SessionInfo_RemotePeer))
|
||||||
answer["rtp_remotepeer"] = result[SessionInfo_RemotePeer].asStdString();
|
answer["rtp_remotepeer"] = result[SessionInfo_RemotePeer].asStdString();
|
||||||
|
|
||||||
#if defined(USE_AQUA_LIBRARY)
|
|
||||||
/* if (includeAqua)
|
|
||||||
{
|
|
||||||
answer["incoming_audio"] = mAquaIncoming.hexstring();
|
|
||||||
answer["incoming_audio_samplerate"] = AUDIO_SAMPLERATE;
|
|
||||||
answer["incoming_audio_channels"] = AUDIO_CHANNELS;
|
|
||||||
|
|
||||||
ICELogInfo(<< "Running AQuA analyzer.");
|
|
||||||
ByteBuffer referenceAudio;
|
|
||||||
// Read AQuA reference audio from file if available
|
|
||||||
if (aquaReference.empty())
|
|
||||||
{
|
|
||||||
ICELogCritical(<< "AQuA reference audio file is not set, skipping analyzing.");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
auto sa = mAquaMap[sessionIter->first];
|
|
||||||
if (sa) {
|
|
||||||
Audio::WavFileReader reader;
|
|
||||||
reader.open(strx::makeTstring(aquaReference));
|
|
||||||
|
|
||||||
if (reader.isOpened()) {
|
|
||||||
char buffer[1024];
|
|
||||||
int wasRead = 0;
|
|
||||||
do {
|
|
||||||
wasRead = reader.read(buffer, 1024);
|
|
||||||
if (wasRead > 0)
|
|
||||||
referenceAudio.appendBuffer(buffer, wasRead);
|
|
||||||
} while (wasRead == 1024);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ICELogCritical(<< "Failed to read AQuA reference audio, error code: " << reader.lastError());
|
|
||||||
}
|
|
||||||
|
|
||||||
sevana::aqua::audio_buffer test(mAquaIncoming.data(), mAquaIncoming.size()),
|
|
||||||
reference(referenceAudio.data(), referenceAudio.size());
|
|
||||||
test.mRate = AUDIO_SAMPLERATE;
|
|
||||||
reference.mRate = AUDIO_SAMPLERATE;
|
|
||||||
test.mChannels = AUDIO_CHANNELS;
|
|
||||||
reference.mChannels = AUDIO_CHANNELS;
|
|
||||||
ICELogInfo(
|
|
||||||
<< "Comparing test audio " << mAquaIncoming.size() << " bytes with reference audio " << referenceAudio.size() << " bytes.");
|
|
||||||
auto r = sa->compare(reference, test);
|
|
||||||
if (r.mErrorCode) {
|
|
||||||
ICELogInfo(
|
|
||||||
<< "Error code: " << r.mErrorCode << ", msg: " << r.mErrorMessage);
|
|
||||||
} else {
|
|
||||||
ICELogInfo(<< "MOS: " << r.mMos << ", faults: " << r.mFaultsText);
|
|
||||||
}
|
|
||||||
answer["aqua_mos"] = r.mMos;
|
|
||||||
answer["aqua_report"] = r.mFaultsText;
|
|
||||||
|
|
||||||
if (r.mErrorCode) {
|
|
||||||
answer["aqua_error_code"] = r.mErrorCode;
|
|
||||||
answer["aqua_error_message"] = r.mErrorMessage;
|
|
||||||
}
|
|
||||||
closeAqua(sessionIter->first);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Remove test audio
|
|
||||||
mAquaIncoming.clear(); mAquaOutgoing.clear();
|
|
||||||
}*/
|
|
||||||
#endif
|
|
||||||
|
|
||||||
answer["status"] = Status_Ok;
|
answer["status"] = Status_Ok;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -446,28 +446,19 @@ void Session::getSessionInfo(Session::InfoOptions options, VariantMap& info)
|
||||||
|
|
||||||
// Iterate all session providers
|
// Iterate all session providers
|
||||||
stat.reset();
|
stat.reset();
|
||||||
Stream* media = NULL;
|
Stream* media = nullptr;
|
||||||
for (unsigned streamIndex = 0; streamIndex < mStreamList.size(); streamIndex++)
|
for (Stream& stream: mStreamList)
|
||||||
{
|
|
||||||
Stream& stream = mStreamList[streamIndex];
|
|
||||||
if (stream.provider())
|
|
||||||
{
|
{
|
||||||
|
if (!stream.provider())
|
||||||
|
continue;
|
||||||
|
|
||||||
media = &stream;
|
media = &stream;
|
||||||
MT::Statistics s = stream.provider()->getStatistics();
|
MT::Statistics s = stream.provider()->getStatistics();
|
||||||
#if defined(USE_PVQA_LIBRARY) && !defined(TARGET_SERVER)
|
|
||||||
if (options != InfoOptions::Standard)
|
|
||||||
{
|
|
||||||
// This information is available AFTER audio stream is deleted
|
|
||||||
info[SessionInfo_PvqaMos] = s.mPvqaMos;
|
|
||||||
info[SessionInfo_PvqaReport] = s.mPvqaReport;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
info[SessionInfo_NetworkMos] = static_cast<float>(s.calculateMos(4.14));
|
info[SessionInfo_NetworkMos] = static_cast<float>(s.calculateMos(4.14));
|
||||||
info[SessionInfo_AudioCodec] = s.mCodecName;
|
info[SessionInfo_AudioCodec] = s.mCodecName;
|
||||||
|
|
||||||
stat += s;
|
stat += s;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
info[SessionInfo_ReceivedTraffic] = static_cast<int>(stat.mReceived);
|
info[SessionInfo_ReceivedTraffic] = static_cast<int>(stat.mReceived);
|
||||||
info[SessionInfo_SentTraffic] = static_cast<int>(stat.mSent);
|
info[SessionInfo_SentTraffic] = static_cast<int>(stat.mSent);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue