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