stats: expose minPlayoutDelay as nonstandard stat

This currently only exists as a goog legacy stat and has no spec
equivalent according to
  https://docs.google.com/document/d/1z-D4SngG36WPiMuRvWeTMN7mWQXrf1XKZwVl3Nf1BIE/edit
Yet it is useful to debug issues sometimes. Exposing it as a
nonstandard stat will make it show up in chrome://webrtc-internals,
removing a need to switch to the legacy stats API there.

BUG=webrtc:14118

Change-Id: I506357ad54ff33df3ba46fb81558aa32187ac8e9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264420
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37055}
This commit is contained in:
Philipp Hancke
2022-05-30 12:37:04 +02:00
committed by WebRTC LUCI CQ
parent 865d9c519f
commit 6fb8d1a2d7
5 changed files with 17 additions and 3 deletions

View File

@ -553,6 +553,9 @@ class RTC_EXPORT RTCInboundRTPStreamStats final
RTCStatsMember<uint32_t> pli_count;
RTCStatsMember<uint32_t> nack_count;
RTCStatsMember<uint64_t> qp_sum;
// The former googMinPlayoutDelayMs (in seconds).
RTCNonStandardStatsMember<double> min_playout_delay;
};
// https://w3c.github.io/webrtc-stats/#outboundrtpstats-dict*

View File

@ -569,6 +569,9 @@ void SetInboundRTPStreamStatsFromVideoReceiverInfo(
video_receiver_info.total_inter_frame_delay;
inbound_video->total_squared_inter_frame_delay =
video_receiver_info.total_squared_inter_frame_delay;
inbound_video->min_playout_delay =
static_cast<double>(video_receiver_info.min_playout_delay_ms) /
rtc::kNumMillisecsPerSec;
if (video_receiver_info.last_packet_received_timestamp_ms) {
inbound_video->last_packet_received_timestamp = static_cast<double>(
*video_receiver_info.last_packet_received_timestamp_ms);

View File

@ -2156,6 +2156,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Video) {
video_media_info.receivers[0].estimated_playout_ntp_timestamp_ms =
absl::nullopt;
video_media_info.receivers[0].decoder_implementation_name = "";
video_media_info.receivers[0].min_playout_delay_ms = 50;
RtpCodecParameters codec_parameters;
codec_parameters.payload_type = 42;
@ -2204,6 +2205,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Video) {
// `expected_video.last_packet_received_timestamp` should be undefined.
// `expected_video.content_type` should be undefined.
// `expected_video.decoder_implementation` should be undefined.
expected_video.min_playout_delay = 0.05;
ASSERT_TRUE(report->Get(expected_video.id()));
EXPECT_EQ(

View File

@ -927,6 +927,8 @@ class RTCStatsReportVerifier {
// The integration test is not set up to test screen share; don't require
// this to be present.
verifier.MarkMemberTested(inbound_stream.content_type, true);
verifier.TestMemberIsNonNegative<double>(
inbound_stream.min_playout_delay);
} else {
verifier.TestMemberIsUndefined(inbound_stream.frames_decoded);
verifier.TestMemberIsUndefined(inbound_stream.key_frames_decoded);
@ -940,6 +942,7 @@ class RTCStatsReportVerifier {
verifier.TestMemberIsUndefined(
inbound_stream.total_squared_inter_frame_delay);
verifier.TestMemberIsUndefined(inbound_stream.content_type);
verifier.TestMemberIsUndefined(inbound_stream.min_playout_delay);
}
return verifier.ExpectAllMembersSuccessfullyTested();
}

View File

@ -718,7 +718,8 @@ WEBRTC_RTCSTATS_IMPL(
&fir_count,
&pli_count,
&nack_count,
&qp_sum)
&qp_sum,
&min_playout_delay)
// clang-format on
RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(const std::string& id,
@ -777,7 +778,8 @@ RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(std::string&& id,
fir_count("firCount"),
pli_count("pliCount"),
nack_count("nackCount"),
qp_sum("qpSum") {}
qp_sum("qpSum"),
min_playout_delay("minPlayoutDelay") {}
RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
const RTCInboundRTPStreamStats& other)
@ -832,7 +834,8 @@ RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
fir_count(other.fir_count),
pli_count(other.pli_count),
nack_count(other.nack_count),
qp_sum(other.qp_sum) {}
qp_sum(other.qp_sum),
min_playout_delay(other.min_playout_delay) {}
RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {}