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

RtpStreamRecv: Don't route RTX packets not identified as nacked packets.

上级 b99eebca
......@@ -41,7 +41,7 @@ namespace RTC
explicit NackGenerator(Listener* listener);
~NackGenerator() override;
void ReceivePacket(RTC::RtpPacket* packet);
bool ReceivePacket(RTC::RtpPacket* packet);
private:
void AddPacketsToNackList(uint32_t seq32Start, uint32_t seq32End);
......
......@@ -33,7 +33,8 @@ namespace RTC
this->timer->Destroy();
}
void NackGenerator::ReceivePacket(RTC::RtpPacket* packet)
// Returns true if this is a found nacked packet. False otherwise.
bool NackGenerator::ReceivePacket(RTC::RtpPacket* packet)
{
MS_TRACE();
......@@ -44,7 +45,7 @@ namespace RTC
this->lastSeq32 = seq32;
this->started = true;
return;
return false;
}
// If a key frame remove all the items in the nack list older than this seq.
......@@ -54,13 +55,13 @@ namespace RTC
// Obviously never nacked, so ignore.
if (seq32 == this->lastSeq32)
{
return;
return false;
}
if (seq32 == this->lastSeq32 + 1)
{
this->lastSeq32++;
return;
return false;
}
// May be an out of order packet, or already handled retransmitted packet,
......@@ -79,6 +80,8 @@ namespace RTC
packet->GetSequenceNumber());
this->nackList.erase(it);
return true;
}
// Out of order packet or already handled NACKed packet.
else
......@@ -89,9 +92,9 @@ namespace RTC
", seq:%" PRIu16 "]",
packet->GetSsrc(),
packet->GetSequenceNumber());
}
return;
return false;
}
}
// Otherwise we may have lost some packets.
......@@ -105,6 +108,8 @@ namespace RTC
this->listener->OnNackGeneratorNackRequired(nackBatch);
MayRunTimer();
return false;
}
void NackGenerator::AddPacketsToNackList(uint32_t seq32Start, uint32_t seq32End)
......
......@@ -106,11 +106,12 @@ namespace RTC
packet->SetExtendedSequenceNumber(
this->cycles + static_cast<uint32_t>(packet->GetSequenceNumber()));
// Pass the packet to the NackGenerator.
// Pass the packet to the NackGenerator and return true just if this was a
// NACked packet.
if (this->params.useNack)
this->nackGenerator->ReceivePacket(packet);
return this->nackGenerator->ReceivePacket(packet);
return true;
return false;
}
RTC::RTCP::ReceiverReport* RtpStreamRecv::GetRtcpReceiverReport()
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论