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

Fix REMB

上级 5d623558
...@@ -195,6 +195,11 @@ namespace RTC ...@@ -195,6 +195,11 @@ namespace RTC
packet->AddExtensionMapping( packet->AddExtensionMapping(
RtpHeaderExtensionUri::Type::RTP_STREAM_ID, this->headerExtensionIds.rid); RtpHeaderExtensionUri::Type::RTP_STREAM_ID, this->headerExtensionIds.rid);
} }
if (this->headerExtensionIds.absSendTime != 0u)
{
packet->AddExtensionMapping(
RtpHeaderExtensionUri::Type::ABS_SEND_TIME, this->headerExtensionIds.absSendTime);
}
// Get the associated Producer. // Get the associated Producer.
RTC::Producer* producer = this->rtpListener.GetProducer(packet); RTC::Producer* producer = this->rtpListener.GetProducer(packet);
......
...@@ -201,8 +201,8 @@ namespace RTC ...@@ -201,8 +201,8 @@ namespace RTC
// Let's clone the RTP packet so we can mangle the payload (if needed) and other // Let's clone the RTP packet so we can mangle the payload (if needed) and other
// stuff that would change its size. // stuff that would change its size.
packet = packet->Clone(ClonedPacketBuffer);
clonedPacket.reset(packet->Clone(ClonedPacketBuffer)); clonedPacket.reset(packet->Clone(ClonedPacketBuffer));
packet = clonedPacket.get();
// Process the packet. // Process the packet.
if (!rtpStream->ReceivePacket(packet)) if (!rtpStream->ReceivePacket(packet))
...@@ -214,8 +214,8 @@ namespace RTC ...@@ -214,8 +214,8 @@ namespace RTC
// Let's clone the RTP packet so we can mangle the payload (if needed) and other // Let's clone the RTP packet so we can mangle the payload (if needed) and other
// stuff that would change its size. // stuff that would change its size.
packet = packet->Clone(ClonedPacketBuffer);
clonedPacket.reset(packet->Clone(ClonedPacketBuffer)); clonedPacket.reset(packet->Clone(ClonedPacketBuffer));
packet = clonedPacket.get();
// Process the packet. // Process the packet.
if (!rtpStream->ReceiveRtxPacket(packet)) if (!rtpStream->ReceiveRtxPacket(packet))
......
...@@ -708,12 +708,25 @@ namespace RTC ...@@ -708,12 +708,25 @@ namespace RTC
} }
// Apply the Transport RTP header extension ids so the RTP listener can use them. // Apply the Transport RTP header extension ids so the RTP listener can use them.
if (this->headerExtensionIds.rid != 0u) if (this->headerExtensionIds.rid != 0u)
{ {
packet->AddExtensionMapping( packet->AddExtensionMapping(
RtpHeaderExtensionUri::Type::RTP_STREAM_ID, this->headerExtensionIds.rid); RtpHeaderExtensionUri::Type::RTP_STREAM_ID, this->headerExtensionIds.rid);
} }
if (this->headerExtensionIds.absSendTime != 0u)
{
packet->AddExtensionMapping(
RtpHeaderExtensionUri::Type::ABS_SEND_TIME, this->headerExtensionIds.absSendTime);
}
// Feed the remote bitrate estimator (REMB).
uint32_t absSendTime;
if (packet->ReadAbsSendTime(&absSendTime))
{
this->remoteBitrateEstimator->IncomingPacket(
DepLibUV::GetTime(), packet->GetPayloadLength(), *packet, absSendTime);
}
// Get the associated Producer. // Get the associated Producer.
RTC::Producer* producer = this->rtpListener.GetProducer(packet); RTC::Producer* producer = this->rtpListener.GetProducer(packet);
...@@ -742,15 +755,6 @@ namespace RTC ...@@ -742,15 +755,6 @@ namespace RTC
// Pass the RTP packet to the corresponding Producer. // Pass the RTP packet to the corresponding Producer.
producer->ReceiveRtpPacket(packet); producer->ReceiveRtpPacket(packet);
// Feed the remote bitrate estimator (REMB).
uint32_t absSendTime;
if (packet->ReadAbsSendTime(&absSendTime))
{
this->remoteBitrateEstimator->IncomingPacket(
DepLibUV::GetTime(), packet->GetPayloadLength(), *packet, absSendTime);
}
delete packet; delete packet;
} }
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论