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

Consumer: log sync RTP packet details

上级 43bcedd5
...@@ -365,9 +365,14 @@ namespace RTC ...@@ -365,9 +365,14 @@ namespace RTC
if (profile != this->effectiveProfile) if (profile != this->effectiveProfile)
return; return;
// Whether this is the first packet after re-sync.
bool isSyncPacket = false;
// Check whether sequence number and timestamp sync is required. // Check whether sequence number and timestamp sync is required.
if (this->syncRequired) if (this->syncRequired)
{ {
isSyncPacket = true;
this->seqNum = ++this->maxSeqNum; this->seqNum = ++this->maxSeqNum;
auto now = static_cast<uint32_t>(DepLibUV::GetTime()); auto now = static_cast<uint32_t>(DepLibUV::GetTime());
...@@ -420,6 +425,21 @@ namespace RTC ...@@ -420,6 +425,21 @@ namespace RTC
// Rewrite packet timestamp. // Rewrite packet timestamp.
packet->SetTimestamp(this->rtpTimestamp); packet->SetTimestamp(this->rtpTimestamp);
if (isSyncPacket)
{
MS_DEBUG_TAG(
rtp,
"sending sync packet [ssrc:%" PRIu32 ", seq:%" PRIu16 ", ts:%" PRIu32
"], from original [ssrc:%" PRIu32 ", seq:%" PRIu16 ", ts:%" PRIu32 ", profile:%s]",
packet->GetSsrc(),
packet->GetSequenceNumber(),
packet->GetTimestamp(),
ssrc,
this->lastRecvSeqNum,
this->lastRecvRtpTimestamp,
RTC::RtpEncodingParameters::profile2String[profile].c_str());
}
// Process the packet. // Process the packet.
if (this->rtpStream->ReceivePacket(packet)) if (this->rtpStream->ReceivePacket(packet))
{ {
...@@ -431,12 +451,6 @@ namespace RTC ...@@ -431,12 +451,6 @@ namespace RTC
if (retransmissionNeeded) if (retransmissionNeeded)
{ {
MS_DEBUG_TAG(
rtp,
"retransmitting packet [ssrc:%" PRIu32 ", seq:%" PRIu16 "]",
packet->GetSsrc(),
packet->GetSequenceNumber());
// Send the packet. // Send the packet.
this->transport->SendRtpPacket(packet); this->transport->SendRtpPacket(packet);
...@@ -449,7 +463,7 @@ namespace RTC ...@@ -449,7 +463,7 @@ namespace RTC
MS_DEBUG_TAG( MS_DEBUG_TAG(
rtp, rtp,
"failed to send packet [ssrc:%" PRIu32 ", seq:%" PRIu16 ", ts:%" PRIu32 "failed to send packet [ssrc:%" PRIu32 ", seq:%" PRIu16 ", ts:%" PRIu32
"], from original [ssrc:%" PRIu32 ", seq:%" PRIu16 ", ts:%" PRIu32 "], profile:%s", "], from original [ssrc:%" PRIu32 ", seq:%" PRIu16 ", ts:%" PRIu32 ", profile:%s]",
packet->GetSsrc(), packet->GetSsrc(),
packet->GetSequenceNumber(), packet->GetSequenceNumber(),
packet->GetTimestamp(), packet->GetTimestamp(),
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论