提交 02654b75 authored 作者: José Luis Millán's avatar José Luis Millán

RtpStream stats: do not add 'rtt' attribute when its value is 0

上级 0de4dbf6
......@@ -206,13 +206,15 @@ namespace RTC
RTC::RtpStream::FillJsonStats(jsonObject);
jsonObject["timestamp"] = now;
jsonObject["type"] = "inbound-rtp";
jsonObject["jitter"] = this->jitter;
jsonObject["roundTripTime"] = this->rtt;
jsonObject["packetCount"] = this->transmissionCounter.GetPacketCount();
jsonObject["byteCount"] = this->transmissionCounter.GetBytes();
jsonObject["bitrate"] = this->transmissionCounter.GetBitrate(now);
jsonObject["timestamp"] = now;
jsonObject["type"] = "inbound-rtp";
jsonObject["jitter"] = this->jitter;
jsonObject["packetCount"] = this->transmissionCounter.GetPacketCount();
jsonObject["byteCount"] = this->transmissionCounter.GetBytes();
jsonObject["bitrate"] = this->transmissionCounter.GetBitrate(now);
if (this->rtt != 0.0f)
jsonObject["roundTripTime"] = this->rtt;
if (GetSpatialLayers() > 1 || GetTemporalLayers() > 1)
{
......
......@@ -44,12 +44,14 @@ namespace RTC
RTC::RtpStream::FillJsonStats(jsonObject);
jsonObject["timestamp"] = now;
jsonObject["type"] = "outbound-rtp";
jsonObject["roundTripTime"] = this->rtt;
jsonObject["packetCount"] = this->transmissionCounter.GetPacketCount();
jsonObject["byteCount"] = this->transmissionCounter.GetBytes();
jsonObject["bitrate"] = this->transmissionCounter.GetBitrate(now);
jsonObject["timestamp"] = now;
jsonObject["type"] = "outbound-rtp";
jsonObject["packetCount"] = this->transmissionCounter.GetPacketCount();
jsonObject["byteCount"] = this->transmissionCounter.GetBytes();
jsonObject["bitrate"] = this->transmissionCounter.GetBitrate(now);
if (this->rtt != 0.0f)
jsonObject["roundTripTime"] = this->rtt;
}
bool RtpStreamSend::ReceivePacket(RTC::RtpPacket* packet)
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论