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

Clean and remove old/useless/dangerous RtpStream stuff

上级 9f2897d2
......@@ -45,12 +45,13 @@ namespace RTC
bool IsHealthy();
protected:
void InitSeq(uint16_t seq);
bool UpdateSeq(RTC::RtpPacket* packet);
private:
void InitSeq(uint16_t seq);
/* Pure virtual methods that must be implemented by the subclass. */
protected:
virtual void OnInitSeq() = 0;
virtual void CheckHealth() = 0;
/* Pure virtual methods inherited from Timer::Listener. */
......@@ -68,8 +69,6 @@ namespace RTC
uint32_t cycles{ 0 }; // Shifted count of seq. number cycles.
uint32_t baseSeq{ 0 }; // Base seq number.
uint32_t badSeq{ 0 }; // Last 'bad' seq number + 1.
uint32_t expectedPrior{ 0 }; // Packet expected at last interval.
uint32_t receivedPrior{ 0 }; // Packet received at last interval.
// Others.
uint32_t maxTimestamp{ 0 }; // Highest timestamp seen.
Timer* healthCheckTimer{ nullptr };
......
......@@ -35,7 +35,6 @@ namespace RTC
/* Pure virtual methods inherited from RtpStream. */
protected:
void OnInitSeq() override;
virtual void CheckHealth() override;
/* Pure virtual methods inherited from RTC::NackGenerator. */
......@@ -47,6 +46,8 @@ namespace RTC
// Passed by argument.
Listener* listener{ nullptr };
// Others.
uint32_t expectedPrior{ 0 }; // Packet expected at last interval.
uint32_t receivedPrior{ 0 }; // Packet received at last interval.
uint32_t lastSrTimestamp{ 0 }; // The middle 32 bits out of 64 in the NTP timestamp received in
// the most recent sender report.
uint64_t lastSrReceived{ 0 }; // Wallclock time representing the most recent sender report
......
......@@ -44,7 +44,6 @@ namespace RTC
/* Pure virtual methods inherited from RtpStream. */
protected:
void OnInitSeq() override;
void CheckHealth() override;
private:
......
......@@ -223,7 +223,6 @@ namespace RTC
return;
this->syncRequired = true;
this->rtpStream->ClearRetransmissionBuffer();
}
void Consumer::AddProfile(const RTC::RtpEncodingParameters::Profile profile)
......@@ -361,6 +360,11 @@ namespace RTC
// Resynchronize the stream.
this->syncRequired = true;
// Clear RTP retransmission buffer to avoid congesting the receiver by
// sending useless retransmissions (now that we are sending a newer key
// frame).
this->rtpStream->ClearRetransmissionBuffer();
}
}
......
......@@ -122,13 +122,7 @@ namespace RTC
this->baseSeq = seq;
this->maxSeq = seq;
this->badSeq = RtpSeqMod + 1; // So seq == badSeq is false.
this->cycles = 0;
this->receivedPrior = 0;
this->expectedPrior = 0;
this->maxTimestamp = 0; // Also reset the highest seen RTP timestamp.
// Call the OnInitSeq method of the child.
OnInitSeq();
}
bool RtpStream::UpdateSeq(RTC::RtpPacket* packet)
......
......@@ -207,11 +207,6 @@ namespace RTC
this->jitter += (1. / 16.) * (static_cast<double>(d) - this->jitter);
}
void RtpStreamRecv::OnInitSeq()
{
// Do nothing.
}
void RtpStreamRecv::CheckHealth()
{
auto now = DepLibUV::GetTime();
......
......@@ -410,14 +410,6 @@ namespace RTC
(*newBufferIt).packet = packet->Clone(store);
}
void RtpStreamSend::OnInitSeq()
{
MS_TRACE();
// Clear the RTP buffer.
ClearRetransmissionBuffer();
}
void RtpStreamSend::CheckHealth()
{
MS_TRACE();
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论