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

Fill Consumer::Disable()

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