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

- RtpStream: remove probation stuff (not in use anyhow)

- NackGenerator: be less aggressive
上级 64f12fdd
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
#include "handles/Timer.hpp" #include "handles/Timer.hpp"
#include <json/json.h> #include <json/json.h>
#include <map> #include <map>
#include <set>
#include <string> #include <string>
#include <unordered_set> #include <unordered_set>
#include <set>
#include <vector> #include <vector>
namespace RTC namespace RTC
......
...@@ -66,7 +66,6 @@ namespace RTC ...@@ -66,7 +66,6 @@ namespace RTC
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.
uint32_t badSeq{ 0 }; // Last 'bad' seq number + 1. uint32_t badSeq{ 0 }; // Last 'bad' seq number + 1.
uint32_t probation{ 0 }; // Seq. packets till source is valid.
uint32_t received{ 0 }; // Packets received. uint32_t received{ 0 }; // Packets received.
uint32_t expectedPrior{ 0 }; // Packet expected at last interval. uint32_t expectedPrior{ 0 }; // Packet expected at last interval.
uint32_t receivedPrior{ 0 }; // Packet received at last interval. uint32_t receivedPrior{ 0 }; // Packet received at last interval.
......
...@@ -9,11 +9,11 @@ namespace RTC ...@@ -9,11 +9,11 @@ namespace RTC
{ {
/* Static. */ /* Static. */
constexpr uint32_t MaxPacketAge{ 10000 }; constexpr uint32_t MaxPacketAge{ 2500 };
constexpr size_t MaxNackPackets{ 500 }; constexpr size_t MaxNackPackets{ 300 };
constexpr uint32_t DefaultRtt{ 100 }; constexpr uint32_t DefaultRtt{ 100 };
constexpr uint8_t MaxNackRetries{ 8 }; constexpr uint8_t MaxNackRetries{ 3 };
constexpr uint64_t TimerInterval{ 25 }; constexpr uint64_t TimerInterval{ 50 };
/* Instance methods. */ /* Instance methods. */
......
...@@ -763,7 +763,9 @@ namespace RTC ...@@ -763,7 +763,9 @@ namespace RTC
auto rtpStreamRecv = static_cast<RtpStreamRecv*>(rtpStream); auto rtpStreamRecv = static_cast<RtpStreamRecv*>(rtpStream);
MS_ASSERT(this->profiles.find(rtpStreamRecv) != this->profiles.end(), "stream not present in profiles map"); MS_ASSERT(
this->profiles.find(rtpStreamRecv) != this->profiles.end(),
"stream not present in profiles map");
auto& profiles = this->profiles[rtpStreamRecv]; auto& profiles = this->profiles[rtpStreamRecv];
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
#include "Logger.hpp" #include "Logger.hpp"
#include "MediaSoupError.hpp" #include "MediaSoupError.hpp"
#include "RTC/RtpDictionaries.hpp" #include "RTC/RtpDictionaries.hpp"
#include <unordered_set>
#include <set> #include <set>
#include <unordered_set>
namespace RTC namespace RTC
{ {
......
...@@ -10,9 +10,8 @@ namespace RTC ...@@ -10,9 +10,8 @@ namespace RTC
{ {
/* Static. */ /* Static. */
static constexpr uint32_t MinSequential{ 0 };
static constexpr uint16_t MaxDropout{ 3000 }; static constexpr uint16_t MaxDropout{ 3000 };
static constexpr uint16_t MaxMisorder{ 100 }; static constexpr uint16_t MaxMisorder{ 300 };
static constexpr uint32_t RtpSeqMod{ 1 << 16 }; static constexpr uint32_t RtpSeqMod{ 1 << 16 };
static constexpr uint16_t HealthCheckPeriod{ 1000 }; static constexpr uint16_t HealthCheckPeriod{ 1000 };
...@@ -50,20 +49,16 @@ namespace RTC ...@@ -50,20 +49,16 @@ namespace RTC
this->started = true; this->started = true;
this->maxSeq = seq - 1; this->maxSeq = seq - 1;
this->probation = MinSequential;
} }
// If not a valid packet ignore it. // If not a valid packet ignore it.
if (!UpdateSeq(packet)) if (!UpdateSeq(packet))
{
if (this->probation == 0u)
{ {
MS_WARN_TAG( MS_WARN_TAG(
rtp, rtp,
"invalid packet [ssrc:%" PRIu32 ", seq:%" PRIu16 "]", "invalid packet [ssrc:%" PRIu32 ", seq:%" PRIu16 "]",
packet->GetSsrc(), packet->GetSsrc(),
packet->GetSequenceNumber()); packet->GetSequenceNumber());
}
return false; return false;
} }
...@@ -103,35 +98,6 @@ namespace RTC ...@@ -103,35 +98,6 @@ namespace RTC
uint16_t seq = packet->GetSequenceNumber(); uint16_t seq = packet->GetSequenceNumber();
uint16_t udelta = seq - this->maxSeq; uint16_t udelta = seq - this->maxSeq;
/*
* Source is not valid until MinSequential packets with
* sequential sequence numbers have been received.
*/
if (this->probation != 0u)
{
// Packet is in sequence.
if (seq == this->maxSeq + 1)
{
this->probation--;
this->maxSeq = seq;
if (this->probation == 0)
{
InitSeq(seq);
this->received++;
return true;
}
}
else
{
this->probation = MinSequential - 1;
this->maxSeq = seq;
}
return false;
}
if (udelta < MaxDropout) if (udelta < MaxDropout)
{ {
// In order, with permissible gap. // In order, with permissible gap.
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论