1
0
mirror of https://github.com/danog/libtgvoip.git synced 2024-11-26 12:14:39 +01:00

Better logs

This commit is contained in:
Daniil Gentili 2020-03-28 21:49:53 +01:00
parent 64922b21a7
commit d2244c5856
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
4 changed files with 11 additions and 8 deletions

View File

@ -108,7 +108,7 @@ double AudioPacketSender::setPacketLoss(double percent)
if (percent > 2)
{
resendCount = std::clamp(percent / 2, 0.0, 4.0);
resendCount = std::clamp(percent / 2, 0.0, 3.0);
}
/*else if (percent > 5)
{

View File

@ -169,6 +169,7 @@ void VoIPController::UpdateRTT()
{
waitingForAcks = false;
}
LOGI("RTT=%lf", rttHistory[0])
//LOGI("%.3lf/%.3lf, rtt diff %.3lf, waiting=%d, queue=%d", rttHistory[0], rttHistory[8], v, waitingForAcks, sendQueue->Size());
for (auto &stm : incomingStreams)
{

View File

@ -140,7 +140,7 @@ public:
}
std::string print() const override
{
std::stringstream res;
std::ostringstream res;
res << ((data && data->Length()) ? "Data packet" : extraEC ? "EC packet" : extraSignaling ? "Signaling packet" : nopPacket ? "NOP packet" : "Empty packet");
res << " (seq=" << seq << ", legacySeq=" << legacySeq;
#ifdef LOG_PACKETS
@ -205,4 +205,4 @@ struct DebugLoggedPacket
int32_t length;
};
*/
} // namespace tgvoip
} // namespace tgvoip

View File

@ -7,7 +7,7 @@
#define FOURCC(a, b, c, d) ((uint32_t)d | ((uint32_t)c << 8) | ((uint32_t)b << 16) | ((uint32_t)a << 24))
#define PRINT_FOURCC(x) (char)(x >> 24), (char)(x >> 16), (char)(x >> 8), (char)x
#define STRING_FOURCC(x) std::string((char *)&x, 4)
#define STREAM_FOURCC(x) (char)(x >> 24) << (char)(x >> 16) << (char)(x >> 8) << (char)x
namespace tgvoip
{
@ -57,7 +57,9 @@ public:
};
std::string print() const override
{
return STRING_FOURCC(codec);
std::ostringstream s;
s << STREAM_FOURCC(codec);
return s.str();
}
size_t getSize(const VersionInfo &ver) const override
{
@ -90,7 +92,7 @@ public:
std::string print() const override
{
std::stringstream ss;
std::ostringstream ss;
ss << "StreamInfo id=" << (int)streamId << ", type=" << type << ", codec=" << codec.print() << ", frameDuration=" << frameDuration << ", enabled=" << enabled;
return ss.str();
}
@ -326,7 +328,7 @@ struct ExtraInitAck : public Extra
std::string print() const override
{
std::stringstream s;
std::ostringstream s;
s << "ExtraInitAck (peerVersion=" << peerVersion << ", minVersion=" << minVersion << ", streams: " << streams.print() << ")";
return s.str();
}
@ -373,4 +375,4 @@ struct ExtraPong : public Extra
}
virtual ~ExtraPong() = default;
};
} // namespace tgvoip
} // namespace tgvoip