提交 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 @@ ...@@ -4,7 +4,6 @@
#include "RTC/Producer.hpp" #include "RTC/Producer.hpp"
#include "Logger.hpp" #include "Logger.hpp"
#include "MediaSoupError.hpp" #include "MediaSoupError.hpp"
#include "RTC/Codecs/Codecs.hpp"
#include "RTC/RTCP/FeedbackPsPli.hpp" #include "RTC/RTCP/FeedbackPsPli.hpp"
#include "RTC/RTCP/FeedbackRtp.hpp" #include "RTC/RTCP/FeedbackRtp.hpp"
#include "RTC/RTCP/FeedbackRtpNack.hpp" #include "RTC/RTCP/FeedbackRtpNack.hpp"
...@@ -190,6 +189,11 @@ namespace RTC ...@@ -190,6 +189,11 @@ namespace RTC
{ {
rtpStream = this->rtpStreams[ssrc]; 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. // Process the packet.
if (!rtpStream->ReceivePacket(packet)) if (!rtpStream->ReceivePacket(packet))
return; return;
...@@ -198,6 +202,11 @@ namespace RTC ...@@ -198,6 +202,11 @@ namespace RTC
{ {
rtpStream = this->mapRtxStreams[ssrc]; 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. // Process the packet.
if (!rtpStream->ReceiveRtxPacket(packet)) if (!rtpStream->ReceiveRtxPacket(packet))
return; return;
...@@ -209,15 +218,6 @@ namespace RTC ...@@ -209,15 +218,6 @@ namespace RTC
return; 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; RTC::RtpEncodingParameters::Profile profile;
try try
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// #define MS_LOG_DEV // #define MS_LOG_DEV
#include "RTC/RtpStreamRecv.hpp" #include "RTC/RtpStreamRecv.hpp"
#include "RTC/Codecs/Codecs.hpp"
#include "DepLibUV.hpp" #include "DepLibUV.hpp"
#include "Logger.hpp" #include "Logger.hpp"
...@@ -38,6 +39,10 @@ namespace RTC ...@@ -38,6 +39,10 @@ namespace RTC
// Calculate Jitter. // Calculate Jitter.
CalculateJitter(packet->GetTimestamp()); CalculateJitter(packet->GetTimestamp());
// Process the packet at codec level.
if (packet->GetPayloadType() == GetPayloadType())
Codecs::ProcessRtpPacket(packet, GetMimeType());
// Pass the packet to the NackGenerator. // Pass the packet to the NackGenerator.
if (this->params.useNack) if (this->params.useNack)
this->nackGenerator->ReceivePacket(packet); this->nackGenerator->ReceivePacket(packet);
...@@ -106,6 +111,10 @@ namespace RTC ...@@ -106,6 +111,10 @@ namespace RTC
packet->SetExtendedSequenceNumber( packet->SetExtendedSequenceNumber(
this->cycles + static_cast<uint32_t>(packet->GetSequenceNumber())); 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 // Pass the packet to the NackGenerator and return true just if this was a
// NACKed packet. // NACKed packet.
if (this->params.useNack) if (this->params.useNack)
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论