提交 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 @@
#include "handles/Timer.hpp"
#include <json/json.h>
#include <map>
#include <set>
#include <string>
#include <unordered_set>
#include <set>
#include <vector>
namespace RTC
......
......@@ -66,7 +66,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 probation{ 0 }; // Seq. packets till source is valid.
uint32_t received{ 0 }; // Packets received.
uint32_t expectedPrior{ 0 }; // Packet expected at last interval.
uint32_t receivedPrior{ 0 }; // Packet received at last interval.
......
......@@ -359,7 +359,7 @@ namespace RTC
if (packet->GetExtendedSequenceNumber() > this->maxRecvExtendedSeqNum)
{
this->maxRecvExtendedSeqNum = packet->GetExtendedSequenceNumber();
this->maxRecvSeqNum = this->lastRecvSeqNum;
this->maxRecvSeqNum = this->lastRecvSeqNum;
}
// Rewrite packet SSRC.
......
......@@ -9,11 +9,11 @@ namespace RTC
{
/* Static. */
constexpr uint32_t MaxPacketAge{ 10000 };
constexpr size_t MaxNackPackets{ 500 };
constexpr uint32_t MaxPacketAge{ 2500 };
constexpr size_t MaxNackPackets{ 300 };
constexpr uint32_t DefaultRtt{ 100 };
constexpr uint8_t MaxNackRetries{ 8 };
constexpr uint64_t TimerInterval{ 25 };
constexpr uint8_t MaxNackRetries{ 3 };
constexpr uint64_t TimerInterval{ 50 };
/* Instance methods. */
......
......@@ -593,7 +593,7 @@ namespace RTC
for (auto& kv : this->mapRtxStreams)
{
auto rtxSsrc = kv.first;
auto rtxSsrc = kv.first;
auto* mediaStream = kv.second;
if (mediaStream == rtpStream)
......@@ -763,7 +763,9 @@ namespace RTC
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];
......
......@@ -4,8 +4,8 @@
#include "Logger.hpp"
#include "MediaSoupError.hpp"
#include "RTC/RtpDictionaries.hpp"
#include <unordered_set>
#include <set>
#include <unordered_set>
namespace RTC
{
......@@ -305,7 +305,7 @@ namespace RTC
for (auto& encoding : this->encodings)
{
auto profile = encoding.profile;
auto pair = profiles.insert(profile);
auto pair = profiles.insert(profile);
if (!pair.second)
MS_THROW_ERROR("duplicated encoding.profile");
......
......@@ -10,9 +10,8 @@ namespace RTC
{
/* Static. */
static constexpr uint32_t MinSequential{ 0 };
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 uint16_t HealthCheckPeriod{ 1000 };
......@@ -48,22 +47,18 @@ namespace RTC
{
InitSeq(seq);
this->started = true;
this->maxSeq = seq - 1;
this->probation = MinSequential;
this->started = true;
this->maxSeq = seq - 1;
}
// If not a valid packet ignore it.
if (!UpdateSeq(packet))
{
if (this->probation == 0u)
{
MS_WARN_TAG(
rtp,
"invalid packet [ssrc:%" PRIu32 ", seq:%" PRIu16 "]",
packet->GetSsrc(),
packet->GetSequenceNumber());
}
MS_WARN_TAG(
rtp,
"invalid packet [ssrc:%" PRIu32 ", seq:%" PRIu16 "]",
packet->GetSsrc(),
packet->GetSequenceNumber());
return false;
}
......@@ -103,35 +98,6 @@ namespace RTC
uint16_t seq = packet->GetSequenceNumber();
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)
{
// In order, with permissible gap.
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论