提交 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
...@@ -209,11 +209,13 @@ namespace RTC ...@@ -209,11 +209,13 @@ namespace RTC
jsonObject["timestamp"] = now; jsonObject["timestamp"] = now;
jsonObject["type"] = "inbound-rtp"; jsonObject["type"] = "inbound-rtp";
jsonObject["jitter"] = this->jitter; jsonObject["jitter"] = this->jitter;
jsonObject["roundTripTime"] = this->rtt;
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(now); jsonObject["bitrate"] = this->transmissionCounter.GetBitrate(now);
if (this->rtt != 0.0f)
jsonObject["roundTripTime"] = this->rtt;
if (GetSpatialLayers() > 1 || GetTemporalLayers() > 1) if (GetSpatialLayers() > 1 || GetTemporalLayers() > 1)
{ {
jsonObject["bitrateByLayer"] = json::object(); jsonObject["bitrateByLayer"] = json::object();
......
...@@ -46,10 +46,12 @@ namespace RTC ...@@ -46,10 +46,12 @@ namespace RTC
jsonObject["timestamp"] = now; jsonObject["timestamp"] = now;
jsonObject["type"] = "outbound-rtp"; jsonObject["type"] = "outbound-rtp";
jsonObject["roundTripTime"] = this->rtt;
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(now); jsonObject["bitrate"] = this->transmissionCounter.GetBitrate(now);
if (this->rtt != 0.0f)
jsonObject["roundTripTime"] = this->rtt;
} }
bool RtpStreamSend::ReceivePacket(RTC::RtpPacket* packet) bool RtpStreamSend::ReceivePacket(RTC::RtpPacket* packet)
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论