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

RtpStreamRecv: Initialize NackGenerator in the constructor (if params.useNack is set)

上级 87b171b4
...@@ -117,8 +117,7 @@ gulp.task('test:worker', shell.task( ...@@ -117,8 +117,7 @@ gulp.task('test:worker', shell.task(
'Debug' : 'Release'}/mediasoup-worker-test --invisibles --use-colour=yes` 'Debug' : 'Release'}/mediasoup-worker-test --invisibles --use-colour=yes`
], ],
{ {
verbose : true, verbose : true
env : { DEBUG: '*ABORT* *WARN*' }
} }
)); ));
......
...@@ -37,6 +37,7 @@ namespace RTC ...@@ -37,6 +37,7 @@ namespace RTC
if (!this->started) if (!this->started)
{ {
InitSeq(seq); InitSeq(seq);
this->started = true; this->started = true;
this->maxSeq = seq - 1; this->maxSeq = seq - 1;
this->probation = MinSequential; this->probation = MinSequential;
......
...@@ -13,6 +13,9 @@ namespace RTC ...@@ -13,6 +13,9 @@ namespace RTC
: RtpStream::RtpStream(params), listener(listener) : RtpStream::RtpStream(params), listener(listener)
{ {
MS_TRACE(); MS_TRACE();
if (this->params.useNack)
this->nackGenerator.reset(new RTC::NackGenerator(this));
} }
RtpStreamRecv::~RtpStreamRecv() RtpStreamRecv::~RtpStreamRecv()
...@@ -127,7 +130,7 @@ namespace RTC ...@@ -127,7 +130,7 @@ namespace RTC
this->cycles + static_cast<uint32_t>(packet->GetSequenceNumber())); this->cycles + static_cast<uint32_t>(packet->GetSequenceNumber()));
// Pass the packet to the NackGenerator. // Pass the packet to the NackGenerator.
if (this->params.useNack && this->nackGenerator) if (this->params.useNack)
this->nackGenerator->ReceivePacket(packet); this->nackGenerator->ReceivePacket(packet);
return true; return true;
...@@ -230,10 +233,7 @@ namespace RTC ...@@ -230,10 +233,7 @@ namespace RTC
void RtpStreamRecv::OnInitSeq() void RtpStreamRecv::OnInitSeq()
{ {
MS_TRACE(); // Do nothing.
// Request a full frame so dropped video packets don't cause lag.
RequestFullFrame();
} }
void RtpStreamRecv::OnNackGeneratorNackRequired(const std::vector<uint16_t>& seqNumbers) void RtpStreamRecv::OnNackGeneratorNackRequired(const std::vector<uint16_t>& seqNumbers)
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include "RTC/RtpPacket.hpp" #include "RTC/RtpPacket.hpp"
#include "RTC/RtpStream.hpp" #include "RTC/RtpStream.hpp"
#include "RTC/RtpStreamRecv.hpp" #include "RTC/RtpStreamRecv.hpp"
#include "Logger.hpp"
#include <vector> #include <vector>
using namespace RTC; using namespace RTC;
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论