stats: use decoded framerate for inbound-rtp framesPerSecond

instead of the framerate received on the network. This is specified in
  https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-framespersecond

BUG=webrtc:13765

Change-Id: I9a0a89d29de49ac5257254deae9b7e5212e09363
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267409
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/main@{#37422}
This commit is contained in:
Philipp Hancke
2022-07-04 18:24:46 +02:00
committed by WebRTC LUCI CQ
parent f82e8fa911
commit 3719a0c4e8
2 changed files with 9 additions and 3 deletions

View File

@ -550,8 +550,8 @@ void SetInboundRTPStreamStatsFromVideoReceiverInfo(
inbound_video->frame_height =
static_cast<uint32_t>(video_receiver_info.frame_height);
}
if (video_receiver_info.framerate_rcvd > 0) {
inbound_video->frames_per_second = video_receiver_info.framerate_rcvd;
if (video_receiver_info.framerate_decoded > 0) {
inbound_video->frames_per_second = video_receiver_info.framerate_decoded;
}
if (video_receiver_info.qp_sum)
inbound_video->qp_sum = *video_receiver_info.qp_sum;

View File

@ -2189,9 +2189,14 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Video) {
video_media_info.receivers[0].decoder_implementation_name = "";
video_media_info.receivers[0].min_playout_delay_ms = 50;
// Note: these two values intentionally differ,
// only the decoded one should show up.
video_media_info.receivers[0].framerate_rcvd = 15;
video_media_info.receivers[0].framerate_decoded = 5;
RtpCodecParameters codec_parameters;
codec_parameters.payload_type = 42;
codec_parameters.kind = cricket::MEDIA_TYPE_AUDIO;
codec_parameters.kind = cricket::MEDIA_TYPE_VIDEO;
codec_parameters.name = "dummy";
codec_parameters.clock_rate = 0;
video_media_info.receive_codecs.insert(
@ -2239,6 +2244,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Video) {
// `expected_video.content_type` should be undefined.
// `expected_video.decoder_implementation` should be undefined.
expected_video.min_playout_delay = 0.05;
expected_video.frames_per_second = 5;
ASSERT_TRUE(report->Get(expected_video.id()));
EXPECT_EQ(