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

Process RTP packet at payload/codec level within RtpStreamRecv so NackGenerator…

Process RTP packet at payload/codec level within RtpStreamRecv so NackGenerator can check packet->IsKeyFrame().
上级 4290f78b
......@@ -4,7 +4,6 @@
#include "RTC/Producer.hpp"
#include "Logger.hpp"
#include "MediaSoupError.hpp"
#include "RTC/Codecs/Codecs.hpp"
#include "RTC/RTCP/FeedbackPsPli.hpp"
#include "RTC/RTCP/FeedbackRtp.hpp"
#include "RTC/RTCP/FeedbackRtpNack.hpp"
......@@ -190,6 +189,11 @@ namespace RTC
{
rtpStream = this->rtpStreams[ssrc];
// Let's clone the RTP packet so we can mangle the payload (if needed) and other
// stuff that would change its size.
packet = packet->Clone(ClonedPacketBuffer);
clonedPacket.reset(packet->Clone(ClonedPacketBuffer));
// Process the packet.
if (!rtpStream->ReceivePacket(packet))
return;
......@@ -198,6 +202,11 @@ namespace RTC
{
rtpStream = this->mapRtxStreams[ssrc];
// Let's clone the RTP packet so we can mangle the payload (if needed) and other
// stuff that would change its size.
packet = packet->Clone(ClonedPacketBuffer);
clonedPacket.reset(packet->Clone(ClonedPacketBuffer));
// Process the packet.
if (!rtpStream->ReceiveRtxPacket(packet))
return;
......@@ -209,15 +218,6 @@ namespace RTC
return;
}
// Let's clone the RTP packet so we can mangle the payload (if needed) and other
// stuff that would change its size.
packet = packet->Clone(ClonedPacketBuffer);
clonedPacket.reset(packet->Clone(ClonedPacketBuffer));
// Process the packet at codec level.
if (packet->GetPayloadType() == rtpStream->GetPayloadType())
Codecs::ProcessRtpPacket(packet, rtpStream->GetMimeType());
RTC::RtpEncodingParameters::Profile profile;
try
......
......@@ -2,6 +2,7 @@
// #define MS_LOG_DEV
#include "RTC/RtpStreamRecv.hpp"
#include "RTC/Codecs/Codecs.hpp"
#include "DepLibUV.hpp"
#include "Logger.hpp"
......@@ -38,6 +39,10 @@ namespace RTC
// Calculate Jitter.
CalculateJitter(packet->GetTimestamp());
// Process the packet at codec level.
if (packet->GetPayloadType() == GetPayloadType())
Codecs::ProcessRtpPacket(packet, GetMimeType());
// Pass the packet to the NackGenerator.
if (this->params.useNack)
this->nackGenerator->ReceivePacket(packet);
......@@ -106,6 +111,10 @@ namespace RTC
packet->SetExtendedSequenceNumber(
this->cycles + static_cast<uint32_t>(packet->GetSequenceNumber()));
// Process the packet at codec level.
if (packet->GetPayloadType() == GetPayloadType())
Codecs::ProcessRtpPacket(packet, GetMimeType());
// Pass the packet to the NackGenerator and return true just if this was a
// NACKed packet.
if (this->params.useNack)
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论