Skip to content

Commit

Permalink
Do not count padding bitrate as video bitrate stat (#1488)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcague authored Oct 24, 2019
1 parent d094beb commit 7693e93
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion erizo/src/erizo/rtp/StatsHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,16 @@ void StatsCalculator::processRtpPacket(std::shared_ptr<DataPacket> packet) {
}
getStatsInfo()[ssrc].insertStat("bitrateCalculated", MovingIntervalRateStat{kRateStatIntervalSize,
kRateStatIntervals, 8.});
getStatsInfo()[ssrc].insertStat("mediaBitrateCalculated", MovingIntervalRateStat{kRateStatIntervalSize,
kRateStatIntervals, 8.});
}
getStatsInfo()[ssrc]["bitrateCalculated"] += len;
getStatsInfo()["total"]["bitrateCalculated"] += len;
if (!packet->is_padding) {
getStatsInfo()[ssrc]["mediaBitrateCalculated"] += len;
}
if (packet->type == VIDEO_PACKET) {
stream_->setVideoBitrate(getStatsInfo()[ssrc]["bitrateCalculated"].value());
stream_->setVideoBitrate(getStatsInfo()[ssrc]["mediaBitrateCalculated"].value());
if (packet->is_keyframe) {
incrStat(ssrc, "keyFrames");
}
Expand Down

0 comments on commit 7693e93

Please sign in to comment.