提交 8103bcf3 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Producer and `Consumer stats: Always show roundTripTime (even if calculated…

Producer and `Consumer stats: Always show roundTripTime (even if calculated value is 0) after a roundTripTime > 0 has been seen
上级 0ea1cdbb
...@@ -112,7 +112,6 @@ export interface ConsumerStat ...@@ -112,7 +112,6 @@ export interface ConsumerStat
timestamp: number; timestamp: number;
ssrc: number; ssrc: number;
rtxSsrc?: number; rtxSsrc?: number;
rid?: string;
kind: string; kind: string;
mimeType: string; mimeType: string;
packetsLost: number; packetsLost: number;
......
...@@ -123,6 +123,7 @@ namespace RTC ...@@ -123,6 +123,7 @@ namespace RTC
uint64_t lastSenderReportNtpMs{ 0 }; // NTP timestamp in last Sender Report (in ms). uint64_t lastSenderReportNtpMs{ 0 }; // NTP timestamp in last Sender Report (in ms).
uint32_t lastSenderReporTs{ 0 }; // RTP timestamp in last Sender Report. uint32_t lastSenderReporTs{ 0 }; // RTP timestamp in last Sender Report.
float rtt{ 0 }; float rtt{ 0 };
bool hasRtt{ false };
// Instance of RtxStream. // Instance of RtxStream.
RTC::RtxStream* rtxStream{ nullptr }; RTC::RtxStream* rtxStream{ nullptr };
......
...@@ -71,6 +71,9 @@ namespace RTC ...@@ -71,6 +71,9 @@ namespace RTC
if (this->params.rtxSsrc) if (this->params.rtxSsrc)
jsonObject["rtxSsrc"] = this->params.rtxSsrc; jsonObject["rtxSsrc"] = this->params.rtxSsrc;
if (this->hasRtt)
jsonObject["roundTripTime"] = this->rtt;
} }
void RtpStream::SetRtx(uint8_t payloadType, uint32_t ssrc) void RtpStream::SetRtx(uint8_t payloadType, uint32_t ssrc)
......
...@@ -234,9 +234,6 @@ namespace RTC ...@@ -234,9 +234,6 @@ namespace RTC
} }
} }
} }
if (this->rtt != 0.0f)
jsonObject["roundTripTime"] = this->rtt;
} }
bool RtpStreamRecv::ReceivePacket(RTC::RtpPacket* packet) bool RtpStreamRecv::ReceivePacket(RTC::RtpPacket* packet)
...@@ -570,6 +567,9 @@ namespace RTC ...@@ -570,6 +567,9 @@ namespace RTC
this->rtt = (rtt >> 16) * 1000; this->rtt = (rtt >> 16) * 1000;
this->rtt += (static_cast<float>(rtt & 0x0000FFFF) / 65536) * 1000; this->rtt += (static_cast<float>(rtt & 0x0000FFFF) / 65536) * 1000;
if (this->rtt > 0.0f)
this->hasRtt = true;
// Tell it to the NackGenerator. // Tell it to the NackGenerator.
if (this->params.useNack) if (this->params.useNack)
this->nackGenerator->UpdateRtt(static_cast<uint32_t>(this->rtt)); this->nackGenerator->UpdateRtt(static_cast<uint32_t>(this->rtt));
......
...@@ -47,9 +47,6 @@ namespace RTC ...@@ -47,9 +47,6 @@ namespace RTC
jsonObject["packetCount"] = this->transmissionCounter.GetPacketCount(); jsonObject["packetCount"] = this->transmissionCounter.GetPacketCount();
jsonObject["byteCount"] = this->transmissionCounter.GetBytes(); jsonObject["byteCount"] = this->transmissionCounter.GetBytes();
jsonObject["bitrate"] = this->transmissionCounter.GetBitrate(nowMs); jsonObject["bitrate"] = this->transmissionCounter.GetBitrate(nowMs);
if (this->rtt != 0.0f)
jsonObject["roundTripTime"] = this->rtt;
} }
void RtpStreamSend::SetRtx(uint8_t payloadType, uint32_t ssrc) void RtpStreamSend::SetRtx(uint8_t payloadType, uint32_t ssrc)
...@@ -168,6 +165,9 @@ namespace RTC ...@@ -168,6 +165,9 @@ namespace RTC
this->rtt = (rtt >> 16) * 1000; this->rtt = (rtt >> 16) * 1000;
this->rtt += (static_cast<float>(rtt & 0x0000FFFF) / 65536) * 1000; this->rtt += (static_cast<float>(rtt & 0x0000FFFF) / 65536) * 1000;
if (this->rtt > 0.0f)
this->hasRtt = true;
this->packetsLost = report->GetTotalLost(); this->packetsLost = report->GetTotalLost();
this->fractionLost = report->GetFractionLost(); this->fractionLost = report->GetFractionLost();
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论