Unverified 提交 56eda745 authored 作者: José Luis Millán's avatar José Luis Millán 提交者: GitHub

RTC Logger (#1048)

RtcLogger: RtpPacket
上级 feaaf202
#ifndef MS_RTC_RTC_LOGGER_HPP
#define MS_RTC_RTC_LOGGER_HPP
#include "common.hpp"
#include <absl/container/flat_hash_map.h>
namespace RTC
{
namespace RtcLogger
{
class RtpPacket
{
public:
enum class DropReason : uint8_t
{
NONE = 0,
PRODUCER_NOT_FOUND,
RECV_RTP_STREAM_NOT_FOUND,
RECV_RTP_STREAM_DISCARDED,
CONSUMER_INACTIVE,
INVALID_TARGET_LAYER,
UNSUPPORTED_PAYLOAD_TYPE,
NOT_A_KEYFRAME,
SPATIAL_LAYER_MISMATCH,
TOO_HIGH_TIMESTAMP_EXTRA_NEEDED,
PACKET_PREVIOUS_TO_SPATIAL_LAYER_SWITCH,
DROPPED_BY_CODEC,
SEND_RTP_STREAM_DISCARDED,
};
static absl::flat_hash_map<DropReason, std::string> dropReason2String;
RtpPacket() = default;
~RtpPacket() = default;
void Sent();
void Dropped(DropReason dropReason);
private:
void Log() const;
void Clear();
public:
uint64_t timestamp;
std::string recvTransportId{};
std::string sendTransportId{};
std::string routerId{};
std::string producerId{};
std::string consumerId{};
uint32_t recvRtpTimestamp;
uint32_t sendRtpTimestamp;
uint16_t recvSeqNumber;
uint16_t sendSeqNumber;
bool dropped;
DropReason dropReason{ DropReason::NONE };
};
}; // namespace RtcLogger
} // namespace RTC
#endif
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "common.hpp" #include "common.hpp"
#include "Utils.hpp" #include "Utils.hpp"
#include "RTC/Codecs/PayloadDescriptorHandler.hpp" #include "RTC/Codecs/PayloadDescriptorHandler.hpp"
#include "RTC/RtcLogger.hpp"
#include <absl/container/flat_hash_map.h> #include <absl/container/flat_hash_map.h>
#include <array> #include <array>
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
...@@ -606,6 +607,9 @@ namespace RTC ...@@ -606,6 +607,9 @@ namespace RTC
void ShiftPayload(size_t payloadOffset, size_t shift, bool expand = true); void ShiftPayload(size_t payloadOffset, size_t shift, bool expand = true);
public:
RtcLogger::RtpPacket logger;
private: private:
void ParseExtensions(); void ParseExtensions();
......
...@@ -38,6 +38,12 @@ if get_option('ms_log_file_line') ...@@ -38,6 +38,12 @@ if get_option('ms_log_file_line')
] ]
endif endif
if get_option('ms_rtc_logger_rtp')
cpp_args += [
'-DMS_RTC_LOGGER_RTP',
]
endif
common_sources = [ common_sources = [
'src/lib.cpp', 'src/lib.cpp',
'src/DepLibSRTP.cpp', 'src/DepLibSRTP.cpp',
...@@ -85,6 +91,7 @@ common_sources = [ ...@@ -85,6 +91,7 @@ common_sources = [
'src/RTC/Producer.cpp', 'src/RTC/Producer.cpp',
'src/RTC/RateCalculator.cpp', 'src/RTC/RateCalculator.cpp',
'src/RTC/Router.cpp', 'src/RTC/Router.cpp',
'src/RTC/RtcLogger.cpp',
'src/RTC/RtpListener.cpp', 'src/RTC/RtpListener.cpp',
'src/RTC/RtpObserver.cpp', 'src/RTC/RtpObserver.cpp',
'src/RTC/RtpPacket.cpp', 'src/RTC/RtpPacket.cpp',
......
option('ms_log_trace', type : 'boolean', value : false, description : 'When enabled, logs the current method/function if current log level is "debug"') option('ms_log_trace', type : 'boolean', value : false, description : 'When enabled, logs the current method/function if current log level is "debug"')
option('ms_log_file_line', type : 'boolean', value : false, description : 'When enabled, all the logging macros print more verbose information, including current file and line') option('ms_log_file_line', type : 'boolean', value : false, description : 'When enabled, all the logging macros print more verbose information, including current file and line')
option('ms_rtc_logger_rtp', type : 'boolean', value : false, description : 'When enabled, prints a line with information for each RTP packet')
...@@ -201,8 +201,14 @@ namespace RTC ...@@ -201,8 +201,14 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
packet->logger.consumerId = this->id;
if (!IsActive()) if (!IsActive())
{
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::CONSUMER_INACTIVE);
return; return;
}
auto payloadType = packet->GetPayloadType(); auto payloadType = packet->GetPayloadType();
...@@ -212,6 +218,8 @@ namespace RTC ...@@ -212,6 +218,8 @@ namespace RTC
{ {
MS_DEBUG_DEV("payload type not supported [payloadType:%" PRIu8 "]", payloadType); MS_DEBUG_DEV("payload type not supported [payloadType:%" PRIu8 "]", payloadType);
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::UNSUPPORTED_PAYLOAD_TYPE);
return; return;
} }
...@@ -223,7 +231,11 @@ namespace RTC ...@@ -223,7 +231,11 @@ namespace RTC
// If we need to sync, support key frames and this is not a key frame, ignore // If we need to sync, support key frames and this is not a key frame, ignore
// the packet. // the packet.
if (syncRequired && this->keyFrameSupported && !packet->IsKeyFrame()) if (syncRequired && this->keyFrameSupported && !packet->IsKeyFrame())
{
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::NOT_A_KEYFRAME);
return; return;
}
// Whether this is the first packet after re-sync. // Whether this is the first packet after re-sync.
const bool isSyncPacket = syncRequired; const bool isSyncPacket = syncRequired;
...@@ -252,6 +264,9 @@ namespace RTC ...@@ -252,6 +264,9 @@ namespace RTC
packet->SetSsrc(ssrc); packet->SetSsrc(ssrc);
packet->SetSequenceNumber(seq); packet->SetSequenceNumber(seq);
packet->logger.sendRtpTimestamp = packet->GetTimestamp();
packet->logger.sendSeqNumber = seq;
if (isSyncPacket) if (isSyncPacket)
{ {
MS_DEBUG_TAG( MS_DEBUG_TAG(
......
...@@ -672,6 +672,8 @@ namespace RTC ...@@ -672,6 +672,8 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
packet->logger.producerId = this->id;
// Reset current packet. // Reset current packet.
this->currentRtpPacket = nullptr; this->currentRtpPacket = nullptr;
...@@ -684,6 +686,8 @@ namespace RTC ...@@ -684,6 +686,8 @@ namespace RTC
{ {
MS_WARN_TAG(rtp, "no stream found for received packet [ssrc:%" PRIu32 "]", packet->GetSsrc()); MS_WARN_TAG(rtp, "no stream found for received packet [ssrc:%" PRIu32 "]", packet->GetSsrc());
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::RECV_RTP_STREAM_NOT_FOUND);
return ReceiveRtpPacketResult::DISCARDED; return ReceiveRtpPacketResult::DISCARDED;
} }
...@@ -705,6 +709,8 @@ namespace RTC ...@@ -705,6 +709,8 @@ namespace RTC
if (this->mapSsrcRtpStream.size() > numRtpStreamsBefore) if (this->mapSsrcRtpStream.size() > numRtpStreamsBefore)
NotifyNewRtpStream(rtpStream); NotifyNewRtpStream(rtpStream);
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::RECV_RTP_STREAM_DISCARDED);
return result; return result;
} }
} }
...@@ -716,8 +722,12 @@ namespace RTC ...@@ -716,8 +722,12 @@ namespace RTC
// Process the packet. // Process the packet.
if (!rtpStream->ReceiveRtxPacket(packet)) if (!rtpStream->ReceiveRtxPacket(packet))
{
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::RECV_RTP_STREAM_NOT_FOUND);
return result; return result;
} }
}
// Should not happen. // Should not happen.
else else
{ {
......
...@@ -706,6 +706,8 @@ namespace RTC ...@@ -706,6 +706,8 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
packet->logger.routerId = this->id;
auto& consumers = this->mapProducerConsumers.at(producer); auto& consumers = this->mapProducerConsumers.at(producer);
if (!consumers.empty()) if (!consumers.empty())
......
#define MS_CLASS "RTC::RtcLogger"
// #define MS_LOG_DEV_LEVEL 3
#include "RTC/RtcLogger.hpp"
#include "Logger.hpp"
namespace RTC
{
namespace RtcLogger
{
// clang-format off
absl::flat_hash_map<RtpPacket::DropReason, std::string> RtpPacket::dropReason2String = {
{ RtpPacket::DropReason::NONE, "None" },
{ RtpPacket::DropReason::PRODUCER_NOT_FOUND, "ProducerNotFound" },
{ RtpPacket::DropReason::RECV_RTP_STREAM_NOT_FOUND, "RecvRtpStreamNotFound" },
{ RtpPacket::DropReason::RECV_RTP_STREAM_DISCARDED, "RecvRtpStreamDiscarded" },
{ RtpPacket::DropReason::CONSUMER_INACTIVE, "ConsumerInactive" },
{ RtpPacket::DropReason::INVALID_TARGET_LAYER, "InvalidTargetLayer" },
{ RtpPacket::DropReason::UNSUPPORTED_PAYLOAD_TYPE, "UnsupportedPayloadType" },
{ RtpPacket::DropReason::NOT_A_KEYFRAME, "NotAKeyframe" },
{ RtpPacket::DropReason::SPATIAL_LAYER_MISMATCH, "SpatialLayerMismatch" },
{ RtpPacket::DropReason::TOO_HIGH_TIMESTAMP_EXTRA_NEEDED, "TooHighTimestampExtraNeeded" },
{ RtpPacket::DropReason::PACKET_PREVIOUS_TO_SPATIAL_LAYER_SWITCH, "PacketPreviousToSpatialLayerSwitch" },
{ RtpPacket::DropReason::DROPPED_BY_CODEC, "DroppedByCodec" },
{ RtpPacket::DropReason::SEND_RTP_STREAM_DISCARDED, "SendRtpStreamDiscarded" },
};
// clang-format on
void RtpPacket::Sent()
{
MS_TRACE();
this->dropped = false;
Log();
Clear();
}
void RtpPacket::Dropped(DropReason dropReason)
{
MS_TRACE();
this->dropped = true;
this->dropReason = dropReason;
Log();
Clear();
}
void RtpPacket::Log() const
{
#ifdef MS_RTC_LOGGER_RTP
MS_TRACE();
std::cout << "{";
std::cout << "\"timestamp\": " << this->timestamp;
if (!this->recvTransportId.empty())
{
std::cout << ", \"recvTransportId\": \"" << this->recvTransportId << "\"";
}
if (!this->sendTransportId.empty())
{
std::cout << ", \"sendTransportId\": \"" << this->sendTransportId << "\"";
}
if (!this->routerId.empty())
{
std::cout << ", \"routerId\": \"" << this->routerId << "\"";
}
if (!this->producerId.empty())
{
std::cout << ", \"producerId\": \"" << this->producerId << "\"";
}
if (!this->consumerId.empty())
{
std::cout << ", \"consumerId\": \"" << this->consumerId << "\"";
}
std::cout << ", \"recvRtpTimestamp\": " << this->recvRtpTimestamp;
std::cout << ", \"sendRtpTimestamp\": " << this->sendRtpTimestamp;
std::cout << ", \"recvSeqNumber\": " << this->recvSeqNumber;
std::cout << ", \"sendSeqNumber\": " << this->sendSeqNumber;
std::cout << ", \"dropped\": " << (this->dropped ? "true" : "false");
std::cout << ", \"dropReason\": '" << dropReason2String[this->dropReason] << "'";
std::cout << "}" << std::endl;
#endif
}
void RtpPacket::Clear()
{
MS_TRACE();
this->sendTransportId = {};
this->routerId = {};
this->producerId = {};
this->sendSeqNumber = { 0 };
this->dropped = { false };
this->dropReason = { DropReason::NONE };
}
} // namespace RtcLogger
} // namespace RTC
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// #define MS_LOG_DEV_LEVEL 3 // #define MS_LOG_DEV_LEVEL 3
#include "RTC/RtpPacket.hpp" #include "RTC/RtpPacket.hpp"
#include "DepLibUV.hpp"
#include "Logger.hpp" #include "Logger.hpp"
#include <cstring> // std::memcpy(), std::memmove(), std::memset() #include <cstring> // std::memcpy(), std::memmove(), std::memset()
#include <iterator> // std::ostream_iterator #include <iterator> // std::ostream_iterator
...@@ -139,6 +140,14 @@ namespace RTC ...@@ -139,6 +140,14 @@ namespace RTC
// Parse RFC 5285 header extension. // Parse RFC 5285 header extension.
ParseExtensions(); ParseExtensions();
// Avoid retrieving the time if RTC logger is disabled.
#ifdef MS_RTC_LOGGER_RTP
// Initialize logger.
this->logger.timestamp = DepLibUV::GetTimeMs();
this->logger.recvRtpTimestamp = this->GetTimestamp();
this->logger.recvSeqNumber = this->GetSequenceNumber();
#endif
} }
RtpPacket::~RtpPacket() RtpPacket::~RtpPacket()
......
...@@ -265,8 +265,14 @@ namespace RTC ...@@ -265,8 +265,14 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
packet->logger.consumerId = this->id;
if (!IsActive()) if (!IsActive())
{
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::CONSUMER_INACTIVE);
return; return;
}
auto payloadType = packet->GetPayloadType(); auto payloadType = packet->GetPayloadType();
...@@ -276,6 +282,8 @@ namespace RTC ...@@ -276,6 +282,8 @@ namespace RTC
{ {
MS_DEBUG_DEV("payload type not supported [payloadType:%" PRIu8 "]", payloadType); MS_DEBUG_DEV("payload type not supported [payloadType:%" PRIu8 "]", payloadType);
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::UNSUPPORTED_PAYLOAD_TYPE);
return; return;
} }
...@@ -292,13 +300,19 @@ namespace RTC ...@@ -292,13 +300,19 @@ namespace RTC
this->rtpSeqManager.Drop(packet->GetSequenceNumber()); this->rtpSeqManager.Drop(packet->GetSequenceNumber());
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::DROPPED_BY_CODEC);
return; return;
} }
// If we need to sync, support key frames and this is not a key frame, ignore // If we need to sync, support key frames and this is not a key frame, ignore
// the packet. // the packet.
if (this->syncRequired && this->keyFrameSupported && !packet->IsKeyFrame()) if (this->syncRequired && this->keyFrameSupported && !packet->IsKeyFrame())
{
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::NOT_A_KEYFRAME);
return; return;
}
// Whether this is the first packet after re-sync. // Whether this is the first packet after re-sync.
const bool isSyncPacket = this->syncRequired; const bool isSyncPacket = this->syncRequired;
...@@ -327,6 +341,9 @@ namespace RTC ...@@ -327,6 +341,9 @@ namespace RTC
packet->SetSsrc(this->rtpParameters.encodings[0].ssrc); packet->SetSsrc(this->rtpParameters.encodings[0].ssrc);
packet->SetSequenceNumber(seq); packet->SetSequenceNumber(seq);
packet->logger.sendRtpTimestamp = packet->GetTimestamp();
packet->logger.sendSeqNumber = seq;
if (isSyncPacket) if (isSyncPacket)
{ {
MS_DEBUG_TAG( MS_DEBUG_TAG(
......
...@@ -664,11 +664,21 @@ namespace RTC ...@@ -664,11 +664,21 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
packet->logger.consumerId = this->id;
if (!IsActive()) if (!IsActive())
{
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::CONSUMER_INACTIVE);
return; return;
}
if (this->targetTemporalLayer == -1) if (this->targetTemporalLayer == -1)
{
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::INVALID_TARGET_LAYER);
return; return;
}
auto payloadType = packet->GetPayloadType(); auto payloadType = packet->GetPayloadType();
...@@ -678,6 +688,8 @@ namespace RTC ...@@ -678,6 +688,8 @@ namespace RTC
{ {
MS_DEBUG_DEV("payload type not supported [payloadType:%" PRIu8 "]", payloadType); MS_DEBUG_DEV("payload type not supported [payloadType:%" PRIu8 "]", payloadType);
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::UNSUPPORTED_PAYLOAD_TYPE);
return; return;
} }
...@@ -690,7 +702,11 @@ namespace RTC ...@@ -690,7 +702,11 @@ namespace RTC
{ {
// Ignore if not a key frame. // Ignore if not a key frame.
if (!packet->IsKeyFrame()) if (!packet->IsKeyFrame())
{
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::NOT_A_KEYFRAME);
return; return;
}
shouldSwitchCurrentSpatialLayer = true; shouldSwitchCurrentSpatialLayer = true;
...@@ -702,12 +718,18 @@ namespace RTC ...@@ -702,12 +718,18 @@ namespace RTC
// drop it. // drop it.
else if (spatialLayer != this->currentSpatialLayer) else if (spatialLayer != this->currentSpatialLayer)
{ {
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::SPATIAL_LAYER_MISMATCH);
return; return;
} }
// If we need to sync and this is not a key frame, ignore the packet. // If we need to sync and this is not a key frame, ignore the packet.
if (this->syncRequired && !packet->IsKeyFrame()) if (this->syncRequired && !packet->IsKeyFrame())
{
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::NOT_A_KEYFRAME);
return; return;
}
// Whether this is the first packet after re-sync. // Whether this is the first packet after re-sync.
const bool isSyncPacket = this->syncRequired; const bool isSyncPacket = this->syncRequired;
...@@ -814,6 +836,8 @@ namespace RTC ...@@ -814,6 +836,8 @@ namespace RTC
this->syncRequired = false; this->syncRequired = false;
this->spatialLayerToSync = -1; this->spatialLayerToSync = -1;
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::TOO_HIGH_TIMESTAMP_EXTRA_NEEDED);
return; return;
} }
...@@ -854,6 +878,9 @@ namespace RTC ...@@ -854,6 +878,9 @@ namespace RTC
if (SeqManager<uint16_t>::IsSeqLowerThan( if (SeqManager<uint16_t>::IsSeqLowerThan(
packet->GetSequenceNumber(), this->snReferenceSpatialLayer)) packet->GetSequenceNumber(), this->snReferenceSpatialLayer))
{ {
packet->logger.Dropped(
RtcLogger::RtpPacket::DropReason::PACKET_PREVIOUS_TO_SPATIAL_LAYER_SWITCH);
return; return;
} }
else if (SeqManager<uint16_t>::IsSeqHigherThan( else if (SeqManager<uint16_t>::IsSeqHigherThan(
...@@ -898,6 +925,8 @@ namespace RTC ...@@ -898,6 +925,8 @@ namespace RTC
{ {
this->rtpSeqManager.Drop(packet->GetSequenceNumber()); this->rtpSeqManager.Drop(packet->GetSequenceNumber());
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::DROPPED_BY_CODEC);
return; return;
} }
...@@ -921,6 +950,9 @@ namespace RTC ...@@ -921,6 +950,9 @@ namespace RTC
packet->SetSequenceNumber(seq); packet->SetSequenceNumber(seq);
packet->SetTimestamp(timestamp); packet->SetTimestamp(timestamp);
packet->logger.sendRtpTimestamp = timestamp;
packet->logger.sendSeqNumber = seq;
if (isSyncPacket) if (isSyncPacket)
{ {
MS_DEBUG_TAG( MS_DEBUG_TAG(
...@@ -959,6 +991,8 @@ namespace RTC ...@@ -959,6 +991,8 @@ namespace RTC
origSsrc, origSsrc,
origSeq, origSeq,
origTimestamp); origTimestamp);
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::SEND_RTP_STREAM_DISCARDED);
} }
// Restore packet fields. // Restore packet fields.
......
...@@ -593,8 +593,14 @@ namespace RTC ...@@ -593,8 +593,14 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
packet->logger.consumerId = this->id;
if (!IsActive()) if (!IsActive())
{
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::CONSUMER_INACTIVE);
return; return;
}
// clang-format off // clang-format off
if ( if (
...@@ -603,6 +609,8 @@ namespace RTC ...@@ -603,6 +609,8 @@ namespace RTC
) )
// clang-format on // clang-format on
{ {
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::INVALID_TARGET_LAYER);
return; return;
} }
...@@ -614,12 +622,18 @@ namespace RTC ...@@ -614,12 +622,18 @@ namespace RTC
{ {
MS_DEBUG_DEV("payload type not supported [payloadType:%" PRIu8 "]", payloadType); MS_DEBUG_DEV("payload type not supported [payloadType:%" PRIu8 "]", payloadType);
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::UNSUPPORTED_PAYLOAD_TYPE);
return; return;
} }
// If we need to sync and this is not a key frame, ignore the packet. // If we need to sync and this is not a key frame, ignore the packet.
if (this->syncRequired && !packet->IsKeyFrame()) if (this->syncRequired && !packet->IsKeyFrame())
{
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::NOT_A_KEYFRAME);
return; return;
}
// Whether this is the first packet after re-sync. // Whether this is the first packet after re-sync.
const bool isSyncPacket = this->syncRequired; const bool isSyncPacket = this->syncRequired;
...@@ -646,6 +660,8 @@ namespace RTC ...@@ -646,6 +660,8 @@ namespace RTC
{ {
this->rtpSeqManager.Drop(packet->GetSequenceNumber()); this->rtpSeqManager.Drop(packet->GetSequenceNumber());
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::DROPPED_BY_CODEC);
return; return;
} }
...@@ -673,6 +689,9 @@ namespace RTC ...@@ -673,6 +689,9 @@ namespace RTC
packet->SetSsrc(this->rtpParameters.encodings[0].ssrc); packet->SetSsrc(this->rtpParameters.encodings[0].ssrc);
packet->SetSequenceNumber(seq); packet->SetSequenceNumber(seq);
packet->logger.sendRtpTimestamp = packet->GetTimestamp();
packet->logger.sendSeqNumber = seq;
if (marker) if (marker)
{ {
packet->SetMarker(true); packet->SetMarker(true);
......
...@@ -1692,6 +1692,8 @@ namespace RTC ...@@ -1692,6 +1692,8 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
packet->logger.recvTransportId = this->id;
// 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.
packet->SetMidExtensionId(this->recvRtpHeaderExtensionIds.mid); packet->SetMidExtensionId(this->recvRtpHeaderExtensionIds.mid);
packet->SetRidExtensionId(this->recvRtpHeaderExtensionIds.rid); packet->SetRidExtensionId(this->recvRtpHeaderExtensionIds.rid);
...@@ -1712,6 +1714,8 @@ namespace RTC ...@@ -1712,6 +1714,8 @@ namespace RTC
if (!producer) if (!producer)
{ {
packet->logger.Dropped(RtcLogger::RtpPacket::DropReason::PRODUCER_NOT_FOUND);
MS_WARN_TAG( MS_WARN_TAG(
rtp, rtp,
"no suitable Producer for received RTP packet [ssrc:%" PRIu32 ", payloadType:%" PRIu8 "]", "no suitable Producer for received RTP packet [ssrc:%" PRIu32 ", payloadType:%" PRIu8 "]",
...@@ -2663,6 +2667,9 @@ namespace RTC ...@@ -2663,6 +2667,9 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
packet->logger.sendTransportId = this->id;
packet->logger.Sent();
// Update abs-send-time if present. // Update abs-send-time if present.
packet->UpdateAbsSendTime(DepLibUV::GetTimeMs()); packet->UpdateAbsSendTime(DepLibUV::GetTimeMs());
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论