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

Fill Consumer::Disable()

上级 820e9564
......@@ -54,6 +54,7 @@ namespace RTC
uint32_t GetRate(uint64_t now);
size_t GetPacketCount() const;
size_t GetBytes() const;
void Reset();
private:
RateCalculator rate;
......@@ -68,12 +69,12 @@ namespace RTC
{
uint64_t now = DepLibUV::GetTime();
this->Reset(now);
Reset(now);
}
inline void RateCalculator::Reset()
{
this->Reset(this->oldestTime);
Reset(this->oldestTime);
}
inline void RateCalculator::Reset(uint64_t now)
......@@ -98,6 +99,13 @@ namespace RTC
{
return this->bytes;
}
inline void RtpDataCounter::Reset()
{
rate.Reset();
this->packets = 0;
this->bytes = 0;
}
} // namespace RTC
#endif
......@@ -43,8 +43,9 @@ namespace RTC
// Given as argument.
RtpStream::Params params;
// Others.
bool started{ false }; // Whether at least a RTP packet has been received.
// https://tools.ietf.org/html/rfc3550#appendix-A.1 stuff.
// Whether at least a RTP packet has been received.
// https://tools.ietf.org/html/rfc3550#appendix-A.1 stuff.
bool started{ false };
uint16_t maxSeq{ 0 }; // Highest seq. number seen.
uint32_t cycles{ 0 }; // Shifted count of seq. number cycles.
uint32_t baseSeq{ 0 }; // Base seq number.
......
......@@ -168,11 +168,10 @@ namespace RTC
this->rtpStream = nullptr;
}
// TODO: Probably reset all this stuff:
// uint64_t lastRtcpSentTime{ 0 };
// uint16_t maxRtcpInterval{ 0 };
// RTC::RtpDataCounter transmittedCounter;
// RTC::RtpDataCounter retransmittedCounter;
// Reset RTCP and RTP counter stuff.
this->lastRtcpSentTime = 0;
this->transmittedCounter.Reset();
this->retransmittedCounter.Reset();
}
void Consumer::SendRtpPacket(RTC::RtpPacket* packet)
......
......@@ -161,8 +161,6 @@ namespace RTC
this->badSeq = (seq + 1) & (RtpSeqMod - 1);
// TODO: This avois a full frame to pass when the Consumer was paused and later
// resumed. No. Period. We should allow the packet (return true here).
return false;
}
}
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论