Add RTCStats for keyFramesEncoded, keyFramesDecoded.

This implements the correspondingly named JavaScript fields defined in
https://w3c.github.io/webrtc-stats/#inboundrtpstats-dict* and
https://w3c.github.io/webrtc-stats/#outboundrtpstats-dict*.

Bug: webrtc:7066
Change-Id: I431045bca80bf5faf27132c54f59c1f723c92952
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/143683
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28404}
This commit is contained in:
Rasmus Brandt
2019-06-27 14:29:34 +02:00
committed by Commit Bot
parent 478cb46435
commit 2efae7786e
9 changed files with 57 additions and 0 deletions

View File

@ -2708,6 +2708,12 @@ TEST_P(PeerConnectionIntegrationTest, NewGetStatsManyAudioAndManyVideoStreams) {
for (const auto& stat : outbound_stream_stats) {
ASSERT_TRUE(stat->bytes_sent.is_defined());
EXPECT_LT(0u, *stat->bytes_sent);
if (*stat->kind == "video") {
ASSERT_TRUE(stat->key_frames_encoded.is_defined());
EXPECT_GT(*stat->key_frames_encoded, 0u);
ASSERT_TRUE(stat->frames_encoded.is_defined());
EXPECT_GE(*stat->frames_encoded, *stat->key_frames_encoded);
}
ASSERT_TRUE(stat->track_id.is_defined());
const auto* track_stat =
caller_report->GetAs<webrtc::RTCMediaStreamTrackStats>(*stat->track_id);
@ -2726,6 +2732,12 @@ TEST_P(PeerConnectionIntegrationTest, NewGetStatsManyAudioAndManyVideoStreams) {
for (const auto& stat : inbound_stream_stats) {
ASSERT_TRUE(stat->bytes_received.is_defined());
EXPECT_LT(0u, *stat->bytes_received);
if (*stat->kind == "video") {
ASSERT_TRUE(stat->key_frames_decoded.is_defined());
EXPECT_GT(*stat->key_frames_decoded, 0u);
ASSERT_TRUE(stat->frames_decoded.is_defined());
EXPECT_GE(*stat->frames_decoded, *stat->key_frames_decoded);
}
ASSERT_TRUE(stat->track_id.is_defined());
const auto* track_stat =
callee_report->GetAs<webrtc::RTCMediaStreamTrackStats>(*stat->track_id);