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

worker: add new Producer stats field 'rtxPacketsDiscarded' (#536)

上级 784d43b8
...@@ -129,6 +129,7 @@ export type ProducerStat = ...@@ -129,6 +129,7 @@ export type ProducerStat =
byteCount: number; byteCount: number;
bitrate: number; bitrate: number;
roundTripTime?: number; roundTripTime?: number;
rtxPacketsDiscarded?: number;
// RtpStreamRecv specific. // RtpStreamRecv specific.
jitter: number; jitter: number;
bitrateByLayer?: any; bitrateByLayer?: any;
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "RTC/RTCP/SenderReport.hpp" #include "RTC/RTCP/SenderReport.hpp"
#include "RTC/RtpDictionaries.hpp" #include "RTC/RtpDictionaries.hpp"
#include "RTC/RtpPacket.hpp" #include "RTC/RtpPacket.hpp"
#include "RTC/RtxStream.hpp"
#include <json.hpp> #include <json.hpp>
#include <string> #include <string>
...@@ -68,6 +67,10 @@ namespace RTC ...@@ -68,6 +67,10 @@ namespace RTC
{ {
return static_cast<float>(this->fractionLost) * 100 / 256; return static_cast<float>(this->fractionLost) * 100 / 256;
} }
size_t GetPacketsDiscarded() const
{
return this->packetsDiscarded;
}
bool ReceivePacket(RTC::RtpPacket* packet); bool ReceivePacket(RTC::RtpPacket* packet);
RTC::RTCP::ReceiverReport* GetRtcpReceiverReport(); RTC::RTCP::ReceiverReport* GetRtcpReceiverReport();
void ReceiveRtcpSenderReport(RTC::RTCP::SenderReport* report); void ReceiveRtcpSenderReport(RTC::RTCP::SenderReport* report);
......
...@@ -72,6 +72,9 @@ namespace RTC ...@@ -72,6 +72,9 @@ namespace RTC
if (this->params.rtxSsrc) if (this->params.rtxSsrc)
jsonObject["rtxSsrc"] = this->params.rtxSsrc; jsonObject["rtxSsrc"] = this->params.rtxSsrc;
if (this->rtxStream)
jsonObject["rtxPacketsDiscarded"] = this->rtxStream->GetPacketsDiscarded();
if (this->hasRtt) if (this->hasRtt)
jsonObject["roundTripTime"] = this->rtt; jsonObject["roundTripTime"] = this->rtt;
} }
......
...@@ -100,7 +100,7 @@ namespace RTC ...@@ -100,7 +100,7 @@ namespace RTC
this->producerRtpStreams.begin(), this->consumableRtpEncodings.size(), nullptr); this->producerRtpStreams.begin(), this->consumableRtpEncodings.size(), nullptr);
// Create the encoding context. // Create the encoding context.
auto* mediaCodec = this->rtpParameters.GetCodecForEncoding(encoding); const auto* mediaCodec = this->rtpParameters.GetCodecForEncoding(encoding);
if (!RTC::Codecs::Tools::IsValidTypeForCodec(this->type, mediaCodec->mimeType)) if (!RTC::Codecs::Tools::IsValidTypeForCodec(this->type, mediaCodec->mimeType))
{ {
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论