提交 0d87ad6c authored 作者: José Luis Millán's avatar José Luis Millán

Remove redundant RTP counter

上级 e18e1c19
...@@ -93,7 +93,6 @@ namespace RTC ...@@ -93,7 +93,6 @@ namespace RTC
uint64_t lastRtcpSentTime{ 0 }; uint64_t lastRtcpSentTime{ 0 };
uint16_t maxRtcpInterval{ 0 }; uint16_t maxRtcpInterval{ 0 };
// RTP counters. // RTP counters.
RTC::RtpDataCounter transmittedCounter;
RTC::RtpDataCounter retransmittedCounter; RTC::RtpDataCounter retransmittedCounter;
// RTP sequence number and timestamp. // RTP sequence number and timestamp.
RTC::SeqManager<uint16_t> rtpSeqManager; RTC::SeqManager<uint16_t> rtpSeqManager;
...@@ -137,7 +136,7 @@ namespace RTC ...@@ -137,7 +136,7 @@ namespace RTC
inline uint32_t Consumer::GetTransmissionRate(uint64_t now) inline uint32_t Consumer::GetTransmissionRate(uint64_t now)
{ {
return this->transmittedCounter.GetRate(now) + this->retransmittedCounter.GetRate(now); return this->rtpStream->GetRate(now) + this->retransmittedCounter.GetRate(now);
} }
} // namespace RTC } // namespace RTC
......
...@@ -40,7 +40,7 @@ namespace RTC ...@@ -40,7 +40,7 @@ namespace RTC
virtual Json::Value ToJson(); virtual Json::Value ToJson();
virtual bool ReceivePacket(RTC::RtpPacket* packet); virtual bool ReceivePacket(RTC::RtpPacket* packet);
uint32_t GetBitRate(); uint32_t GetRate(uint64_t now);
uint32_t GetSsrc(); uint32_t GetSsrc();
uint8_t GetPayloadType(); uint8_t GetPayloadType();
const RTC::RtpCodecMimeType& GetMimeType() const; const RTC::RtpCodecMimeType& GetMimeType() const;
......
...@@ -274,7 +274,6 @@ namespace RTC ...@@ -274,7 +274,6 @@ namespace RTC
// Reset RTCP and RTP counter stuff. // Reset RTCP and RTP counter stuff.
this->lastRtcpSentTime = 0; this->lastRtcpSentTime = 0;
this->transmittedCounter.Reset();
this->retransmittedCounter.Reset(); this->retransmittedCounter.Reset();
} }
...@@ -402,9 +401,6 @@ namespace RTC ...@@ -402,9 +401,6 @@ namespace RTC
{ {
// Send the packet. // Send the packet.
this->transport->SendRtpPacket(packet); this->transport->SendRtpPacket(packet);
// Update transmitted RTP data counter.
this->transmittedCounter.Update(packet);
} }
else else
{ {
......
...@@ -52,7 +52,9 @@ namespace RTC ...@@ -52,7 +52,9 @@ namespace RTC
Json::Value json(Json::objectValue); Json::Value json(Json::objectValue);
json[JsonStringBitRate] = Json::UInt{ GetBitRate() }; uint64_t now = DepLibUV::GetTime();
json[JsonStringBitRate] = Json::UInt{ GetRate(now) };
json[JsonStringJitter] = Json::UInt{ this->jitter }; json[JsonStringJitter] = Json::UInt{ this->jitter };
json[JsonStringParams] = this->params.ToJson(); json[JsonStringParams] = this->params.ToJson();
json[JsonStringPacketCount] = static_cast<Json::UInt>(this->counter.GetPacketCount()); json[JsonStringPacketCount] = static_cast<Json::UInt>(this->counter.GetPacketCount());
...@@ -108,10 +110,8 @@ namespace RTC ...@@ -108,10 +110,8 @@ namespace RTC
return true; return true;
} }
uint32_t RtpStream::GetBitRate() uint32_t RtpStream::GetRate(uint64_t now)
{ {
uint64_t now = DepLibUV::GetTime();
return this->counter.GetRate(now); return this->counter.GetRate(now);
} }
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论