mirror of
https://github.com/danog/libtgvoip.git
synced 2024-11-26 12:14:39 +01:00
Better logs
This commit is contained in:
parent
64922b21a7
commit
d2244c5856
@ -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)
|
||||
{
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user