Commit 6ebc8033 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(CallModel): supports FPS stats

parent 2c978d43
...@@ -323,6 +323,14 @@ ...@@ -323,6 +323,14 @@
<source>callErrorNotAcceptable</source> <source>callErrorNotAcceptable</source>
<translation>Remote party cannot accept the call.</translation> <translation>Remote party cannot accept the call.</translation>
</message> </message>
<message>
<source>callStatsReceivedFramerate</source>
<translation>Received framerate</translation>
</message>
<message>
<source>callStatsSentFramerate</source>
<translation>Sent framerate</translation>
</message>
</context> </context>
<context> <context>
<name>CallSipAddress</name> <name>CallSipAddress</name>
......
...@@ -323,6 +323,14 @@ ...@@ -323,6 +323,14 @@
<source>callErrorNotAcceptable</source> <source>callErrorNotAcceptable</source>
<translation>Le correspondant ne peut accepter votre appel.</translation> <translation>Le correspondant ne peut accepter votre appel.</translation>
</message> </message>
<message>
<source>callStatsReceivedFramerate</source>
<translation>FPS reçues</translation>
</message>
<message>
<source>callStatsSentFramerate</source>
<translation>FPS envoyées</translation>
</message>
</context> </context>
<context> <context>
<name>CallSipAddress</name> <name>CallSipAddress</name>
......
...@@ -566,7 +566,6 @@ inline QVariantMap createStat (const QString &key, const QString &value) { ...@@ -566,7 +566,6 @@ inline QVariantMap createStat (const QString &key, const QString &value) {
} }
void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callStats, QVariantList &statsList) { void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callStats, QVariantList &statsList) {
QString family;
shared_ptr<const linphone::CallParams> params = mCall->getCurrentParams(); shared_ptr<const linphone::CallParams> params = mCall->getCurrentParams();
shared_ptr<const linphone::PayloadType> payloadType; shared_ptr<const linphone::PayloadType> payloadType;
...@@ -581,6 +580,7 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt ...@@ -581,6 +580,7 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt
return; return;
} }
QString family;
switch (callStats->getIpFamilyOfRemote()) { switch (callStats->getIpFamilyOfRemote()) {
case linphone::AddressFamilyInet: case linphone::AddressFamilyInet:
family = QStringLiteral("IPv4"); family = QStringLiteral("IPv4");
...@@ -596,37 +596,40 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt ...@@ -596,37 +596,40 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt
statsList.clear(); statsList.clear();
statsList << ::createStat(tr("callStatsCodec"), payloadType statsList << ::createStat(tr("callStatsCodec"), payloadType
? QString("%1 / %2kHz").arg(Utils::coreStringToAppString(payloadType->getMimeType())).arg(payloadType->getClockRate() / 1000) ? QStringLiteral("%1 / %2kHz").arg(Utils::coreStringToAppString(payloadType->getMimeType())).arg(payloadType->getClockRate() / 1000)
: ""); : "");
statsList << ::createStat(tr("callStatsUploadBandwidth"), QString("%1 kbits/s").arg(int(callStats->getUploadBandwidth()))); statsList << ::createStat(tr("callStatsUploadBandwidth"), QStringLiteral("%1 kbits/s").arg(int(callStats->getUploadBandwidth())));
statsList << ::createStat(tr("callStatsDownloadBandwidth"), QString("%1 kbits/s").arg(int(callStats->getDownloadBandwidth()))); statsList << ::createStat(tr("callStatsDownloadBandwidth"), QStringLiteral("%1 kbits/s").arg(int(callStats->getDownloadBandwidth())));
statsList << ::createStat(tr("callStatsIceState"), iceStateToString(callStats->getIceState())); statsList << ::createStat(tr("callStatsIceState"), iceStateToString(callStats->getIceState()));
statsList << ::createStat(tr("callStatsIpFamily"), family); statsList << ::createStat(tr("callStatsIpFamily"), family);
statsList << ::createStat(tr("callStatsSenderLossRate"), QString("%1 %").arg(callStats->getSenderLossRate())); statsList << ::createStat(tr("callStatsSenderLossRate"), QStringLiteral("%1 %").arg(callStats->getSenderLossRate()));
statsList << ::createStat(tr("callStatsReceiverLossRate"), QString("%1 %").arg(callStats->getReceiverLossRate())); statsList << ::createStat(tr("callStatsReceiverLossRate"), QStringLiteral("%1 %").arg(callStats->getReceiverLossRate()));
switch (callStats->getType()) { switch (callStats->getType()) {
case linphone::StreamTypeAudio: case linphone::StreamTypeAudio:
statsList << ::createStat(tr("callStatsJitterBuffer"), QString("%1 ms").arg(callStats->getJitterBufferSizeMs())); statsList << ::createStat(tr("callStatsJitterBuffer"), QStringLiteral("%1 ms").arg(callStats->getJitterBufferSizeMs()));
break; break;
case linphone::StreamTypeVideo: { case linphone::StreamTypeVideo: {
QString sentVideoDefinitionName = ::Utils::coreStringToAppString(params->getSentVideoDefinition()->getName()); const QString sentVideoDefinitionName = ::Utils::coreStringToAppString(params->getSentVideoDefinition()->getName());
QString sentVideoDefinition = QString("%1x%2") const QString sentVideoDefinition = QStringLiteral("%1x%2")
.arg(params->getSentVideoDefinition()->getWidth()) .arg(params->getSentVideoDefinition()->getWidth())
.arg(params->getSentVideoDefinition()->getHeight()); .arg(params->getSentVideoDefinition()->getHeight());
statsList << ::createStat(tr("callStatsSentVideoDefinition"), sentVideoDefinition == sentVideoDefinitionName statsList << ::createStat(tr("callStatsSentVideoDefinition"), sentVideoDefinition == sentVideoDefinitionName
? sentVideoDefinition ? sentVideoDefinition
: QString("%1 (%2)").arg(sentVideoDefinition).arg(sentVideoDefinitionName)); : QStringLiteral("%1 (%2)").arg(sentVideoDefinition).arg(sentVideoDefinitionName));
QString receivedVideoDefinitionName = ::Utils::coreStringToAppString(params->getReceivedVideoDefinition()->getName()); const QString receivedVideoDefinitionName = ::Utils::coreStringToAppString(params->getReceivedVideoDefinition()->getName());
QString receivedVideoDefinition = QString("%1x%2") const QString receivedVideoDefinition = QString("%1x%2")
.arg(params->getReceivedVideoDefinition()->getWidth()) .arg(params->getReceivedVideoDefinition()->getWidth())
.arg(params->getReceivedVideoDefinition()->getHeight()); .arg(params->getReceivedVideoDefinition()->getHeight());
statsList << ::createStat(tr("callStatsReceivedVideoDefinition"), receivedVideoDefinition == receivedVideoDefinitionName statsList << ::createStat(tr("callStatsReceivedVideoDefinition"), receivedVideoDefinition == receivedVideoDefinitionName
? receivedVideoDefinition ? receivedVideoDefinition
: QString("%1 (%2)").arg(receivedVideoDefinition).arg(receivedVideoDefinitionName)); : QString("%1 (%2)").arg(receivedVideoDefinition).arg(receivedVideoDefinitionName));
statsList << ::createStat(tr("callStatsReceivedFramerate"), QStringLiteral("%1 FPS").arg(params->getReceivedFramerate()));
statsList << ::createStat(tr("callStatsSentFramerate"), QStringLiteral("%1 FPS").arg(params->getSentFramerate()));
} break; } break;
default: default:
......
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