提交 4c517583 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

RtpStream: rewordings

上级 d0e6c9fe
......@@ -72,7 +72,7 @@ namespace RTC
virtual void Pause() = 0;
virtual void Resume() = 0;
void ResetScore(uint8_t score, bool notify);
uint32_t GetRate(uint64_t now);
uint32_t GetBitrate(uint64_t now);
uint8_t GetFractionLost() const;
float GetLossPercentage() const;
uint64_t GetMaxPacketMs() const;
......@@ -103,10 +103,10 @@ namespace RTC
uint32_t packetsLost{ 0 };
uint8_t fractionLost{ 0 };
size_t packetsDiscarded{ 0 };
size_t packetsRepaired{ 0 };
size_t packetsRetransmitted{ 0 };
size_t packetsRepaired{ 0 };
size_t nackCount{ 0 };
size_t nackRtpPacketCount{ 0 };
size_t nackPacketCount{ 0 };
size_t pliCount{ 0 };
size_t firCount{ 0 };
size_t repairedPrior{ 0 }; // Packets repaired at last interval.
......@@ -183,7 +183,7 @@ namespace RTC
return this->params.temporalLayers;
}
inline uint32_t RtpStream::GetRate(uint64_t now)
inline uint32_t RtpStream::GetBitrate(uint64_t now)
{
return this->transmissionCounter.GetRate(now);
}
......
......@@ -29,6 +29,7 @@ namespace RTC
void FillJsonStats(json& jsonObject) override;
bool ReceivePacket(RTC::RtpPacket* packet) override;
bool ReceiveRtxPacket(RTC::RtpPacket* packet);
uint32_t GetRate(uint64_t now);
RTC::RTCP::ReceiverReport* GetRtcpReceiverReport();
void ReceiveRtcpSenderReport(RTC::RTCP::SenderReport* report);
void RequestKeyFrame();
......
......@@ -222,7 +222,7 @@ namespace RTC
{
auto& rtpStream = kv.second;
rate += rtpStream->GetRate(now);
rate += rtpStream->GetBitrate(now);
}
return rate;
......
......@@ -52,22 +52,23 @@ namespace RTC
uint64_t now = DepLibUV::GetTime();
jsonObject["timestamp"] = now;
jsonObject["ssrc"] = this->params.ssrc;
jsonObject["kind"] = RtpCodecMimeType::type2String[this->params.mimeType.type];
jsonObject["mimeType"] = this->params.mimeType.ToString();
jsonObject["packetCount"] = this->transmissionCounter.GetPacketCount();
jsonObject["byteCount"] = this->transmissionCounter.GetBytes();
jsonObject["bitrate"] = this->transmissionCounter.GetRate(now);
jsonObject["packetsLost"] = this->packetsLost;
jsonObject["fractionLost"] = this->fractionLost;
jsonObject["packetsDiscarded"] = this->packetsDiscarded;
jsonObject["packetsRepaired"] = this->packetsRepaired;
jsonObject["nackCount"] = this->nackCount;
jsonObject["nackRtpPacketCount"] = this->nackRtpPacketCount;
jsonObject["pliCount"] = this->pliCount;
jsonObject["firCount"] = this->firCount;
jsonObject["score"] = this->score;
jsonObject["timestamp"] = now;
jsonObject["ssrc"] = this->params.ssrc;
jsonObject["kind"] = RtpCodecMimeType::type2String[this->params.mimeType.type];
jsonObject["mimeType"] = this->params.mimeType.ToString();
jsonObject["packetCount"] = this->transmissionCounter.GetPacketCount();
jsonObject["byteCount"] = this->transmissionCounter.GetBytes();
jsonObject["bitrate"] = this->transmissionCounter.GetRate(now);
jsonObject["packetsLost"] = this->packetsLost;
jsonObject["fractionLost"] = this->fractionLost;
jsonObject["packetsDiscarded"] = this->packetsDiscarded;
jsonObject["packetsRetransmitted"] = this->packetsRetransmitted;
jsonObject["packetsRepaired"] = this->packetsRepaired;
jsonObject["nackCount"] = this->nackCount;
jsonObject["nackPacketCount"] = this->nackPacketCount;
jsonObject["pliCount"] = this->pliCount;
jsonObject["firCount"] = this->firCount;
jsonObject["score"] = this->score;
if (!this->params.rid.empty())
jsonObject["rid"] = this->params.rid;
......
......@@ -70,12 +70,13 @@ namespace RTC
if (packet->GetPayloadType() == GetPayloadType())
RTC::Codecs::ProcessRtpPacket(packet, GetMimeType());
// Pass the packet to the NackGenerator.
if (this->params.useNack && this->nackGenerator->ReceivePacket(packet))
// Pass the packet to the NackGenerator if there is no RTX, so if the
// NackGenerator returns true it means that it was a NACKed packet.
if (this->params.useNack && !HasRtx() && this->nackGenerator->ReceivePacket(packet))
{
// Mark the packet as retransmitted and repaired.
RTC::RtpStream::PacketRepaired(packet);
RTC::RtpStream::PacketRetransmitted(packet);
RTC::RtpStream::PacketRepaired(packet);
}
// Ensure the inactivityCheckPeriodicTimer runs (unless DTX is enabled).
......@@ -85,6 +86,7 @@ namespace RTC
this->inactivityCheckPeriodicTimer->Restart();
}
// Increase transmission counter.
this->transmissionCounter.Update(packet);
return true;
......@@ -513,7 +515,7 @@ namespace RTC
}
this->nackCount++;
this->nackRtpPacketCount += numPacketsRequested;
this->nackPacketCount += numPacketsRequested;
packet.Serialize(RTC::RTCP::Buffer);
......
......@@ -63,6 +63,9 @@ namespace RTC
if (!this->storage.empty())
StorePacket(packet);
// Increase transmission counter.
this->transmissionCounter.Update(packet);
return true;
}
......@@ -76,7 +79,7 @@ namespace RTC
{
RTC::RTCP::FeedbackRtpNackItem* item = *it;
this->nackRtpPacketCount += item->CountRequestedPackets();
this->nackPacketCount += item->CountRequestedPackets();
FillRetransmissionContainer(item->GetPacketId(), item->GetLostPacketBitmask());
......
......@@ -318,7 +318,7 @@ namespace RTC
if (!IsActive())
return 0u;
return this->rtpStream->GetRate(now);
return this->rtpStream->GetBitrate(now);
}
float SimpleConsumer::GetLossPercentage() const
......
......@@ -490,7 +490,7 @@ namespace RTC
if (!IsActive())
return 0u;
return this->rtpStream->GetRate(now);
return this->rtpStream->GetBitrate(now);
}
float SimulcastConsumer::GetLossPercentage() const
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论