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

Just set "abs-send-time" RTP extension if simulcast or SVC.

上级 dd28d401
...@@ -885,6 +885,8 @@ namespace RTC ...@@ -885,6 +885,8 @@ namespace RTC
} }
// Add http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time. // Add http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time.
// NOTE: Just if this is simulcast or SVC.
if (this->type == RTC::RtpParameters::Type::SIMULCAST || this->type == RTC::RtpParameters::Type::SVC)
{ {
extenLen = 3u; extenLen = 3u;
......
...@@ -871,7 +871,7 @@ namespace RTC ...@@ -871,7 +871,7 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
// Update http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time. // Update http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time if present.
{ {
uint8_t extenLen; uint8_t extenLen;
uint8_t* extenValue = packet->GetExtension( uint8_t* extenValue = packet->GetExtension(
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "Utils.hpp" #include "Utils.hpp"
#include "Channel/Notifier.hpp" #include "Channel/Notifier.hpp"
#include "RTC/RTCP/FeedbackPsRemb.hpp" #include "RTC/RTCP/FeedbackPsRemb.hpp"
#include "RTC/RtpDictionaries.hpp"
#include <cmath> // std::pow() #include <cmath> // std::pow()
#include <iterator> // std::ostream_iterator #include <iterator> // std::ostream_iterator
#include <sstream> // std::ostringstream #include <sstream> // std::ostringstream
...@@ -747,7 +748,7 @@ namespace RTC ...@@ -747,7 +748,7 @@ namespace RTC
} }
} }
void WebRtcTransport::SendRtpPacket(RTC::RtpPacket* packet, RTC::Consumer* /*consumer*/) void WebRtcTransport::SendRtpPacket(RTC::RtpPacket* packet, RTC::Consumer* consumer)
{ {
MS_TRACE(); MS_TRACE();
...@@ -770,12 +771,22 @@ namespace RTC ...@@ -770,12 +771,22 @@ namespace RTC
this->iceSelectedTuple->Send(data, len); this->iceSelectedTuple->Send(data, len);
// Feed the REMB client. // Feed the REMB client if this is a simulcast or SVC Consumer.
if (this->rembClient) // clang-format off
if (
this->rembClient &&
(
consumer->GetType() == RTC::RtpParameters::Type::SIMULCAST ||
consumer->GetType() == RTC::RtpParameters::Type::SVC
)
)
// clang-format on
{ {
static uint32_t absSendTime; uint8_t extenLen;
uint8_t* extenValue = packet->GetExtension(
static_cast<uint8_t>(RTC::RtpHeaderExtensionUri::Type::ABS_SEND_TIME), extenLen);
if (packet->ReadAbsSendTime(absSendTime)) if (extenValue && extenLen == 3)
this->rembClient->ReceiveRtpPacket(packet); this->rembClient->ReceiveRtpPacket(packet);
} }
} }
...@@ -1116,12 +1127,17 @@ namespace RTC ...@@ -1116,12 +1127,17 @@ namespace RTC
// Set REMB client bitrate estimator: // Set REMB client bitrate estimator:
// - if not already set, and // - if not already set, and
// - Consumer is simulcast or SVC, and
// - there is abs-send-time RTP header extension, and // - there is abs-send-time RTP header extension, and
// - there is "remb" in codecs RTCP feedback. // - there is "remb" in codecs RTCP feedback.
// //
// clang-format off // clang-format off
if ( if (
!this->rembClient && !this->rembClient &&
(
consumer->GetType() == RTC::RtpParameters::Type::SIMULCAST ||
consumer->GetType() == RTC::RtpParameters::Type::SVC
) &&
rtpHeaderExtensionIds.absSendTime != 0u && rtpHeaderExtensionIds.absSendTime != 0u &&
std::any_of( std::any_of(
codecs.begin(), codecs.end(), [](const RTC::RtpCodecParameters& codec) codecs.begin(), codecs.end(), [](const RTC::RtpCodecParameters& codec)
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论