Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Unified Diff: webrtc/video/receive_statistics_proxy_unittest.cc

Issue 2995143002: Report max interframe delay over window insdead of interframe delay sum (Closed)
Patch Set: Implement more Kwiberg@ comments Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/video/receive_statistics_proxy.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/receive_statistics_proxy_unittest.cc
diff --git a/webrtc/video/receive_statistics_proxy_unittest.cc b/webrtc/video/receive_statistics_proxy_unittest.cc
index d37d2035485334127083b21c5d572b70b1c588a2..07d5fc5c6da6ff0a9956207229ba090ef2f16c24 100644
--- a/webrtc/video/receive_statistics_proxy_unittest.cc
+++ b/webrtc/video/receive_statistics_proxy_unittest.cc
@@ -98,26 +98,63 @@ TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameIncreasesQpSum) {
statistics_proxy_->GetStats().qp_sum);
}
-TEST_F(ReceiveStatisticsProxyTest,
- OnDecodedFrameIncreasesInterframeDelayMsSum) {
- const uint64_t kInterframeDelayMs1 = 100;
- const uint64_t kInterframeDelayMs2 = 200;
- EXPECT_EQ(0u, statistics_proxy_->GetStats().interframe_delay_sum_ms);
+TEST_F(ReceiveStatisticsProxyTest, ReportsMaxInterframeDelay) {
+ const int64_t kInterframeDelayMs1 = 100;
+ const int64_t kInterframeDelayMs2 = 200;
+ const int64_t kInterframeDelayMs3 = 100;
+ EXPECT_EQ(-1, statistics_proxy_->GetStats().interframe_delay_max_ms);
statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(3u),
VideoContentType::UNSPECIFIED);
- EXPECT_EQ(0u, statistics_proxy_->GetStats().interframe_delay_sum_ms);
+ EXPECT_EQ(-1, statistics_proxy_->GetStats().interframe_delay_max_ms);
fake_clock_.AdvanceTimeMilliseconds(kInterframeDelayMs1);
statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(127u),
VideoContentType::UNSPECIFIED);
EXPECT_EQ(kInterframeDelayMs1,
- statistics_proxy_->GetStats().interframe_delay_sum_ms);
+ statistics_proxy_->GetStats().interframe_delay_max_ms);
fake_clock_.AdvanceTimeMilliseconds(kInterframeDelayMs2);
statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(127u),
VideoContentType::UNSPECIFIED);
- EXPECT_EQ(kInterframeDelayMs1 + kInterframeDelayMs2,
- statistics_proxy_->GetStats().interframe_delay_sum_ms);
+ EXPECT_EQ(kInterframeDelayMs2,
+ statistics_proxy_->GetStats().interframe_delay_max_ms);
+
+ fake_clock_.AdvanceTimeMilliseconds(kInterframeDelayMs3);
+ statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(127u),
+ VideoContentType::UNSPECIFIED);
+ // kInterframeDelayMs3 is smaller than kInterframeDelayMs2.
+ EXPECT_EQ(kInterframeDelayMs2,
+ statistics_proxy_->GetStats().interframe_delay_max_ms);
+}
+
+TEST_F(ReceiveStatisticsProxyTest, ReportInterframeDelayInWindow) {
+ const int64_t kInterframeDelayMs1 = 9000;
+ const int64_t kInterframeDelayMs2 = 7500;
+ const int64_t kInterframeDelayMs3 = 7000;
+ EXPECT_EQ(-1, statistics_proxy_->GetStats().interframe_delay_max_ms);
+ statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(3u),
+ VideoContentType::UNSPECIFIED);
+ EXPECT_EQ(-1, statistics_proxy_->GetStats().interframe_delay_max_ms);
+
+ fake_clock_.AdvanceTimeMilliseconds(kInterframeDelayMs1);
+ statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(127u),
+ VideoContentType::UNSPECIFIED);
+ EXPECT_EQ(kInterframeDelayMs1,
+ statistics_proxy_->GetStats().interframe_delay_max_ms);
+
+ fake_clock_.AdvanceTimeMilliseconds(kInterframeDelayMs2);
+ statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(127u),
+ VideoContentType::UNSPECIFIED);
+ // Still first delay is the maximum
+ EXPECT_EQ(kInterframeDelayMs1,
+ statistics_proxy_->GetStats().interframe_delay_max_ms);
+
+ fake_clock_.AdvanceTimeMilliseconds(kInterframeDelayMs3);
+ statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(127u),
+ VideoContentType::UNSPECIFIED);
+ // Now the first sample is out of the window, so the second is the maximum.
+ EXPECT_EQ(kInterframeDelayMs2,
+ statistics_proxy_->GetStats().interframe_delay_max_ms);
}
TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameWithoutQpQpSumWontExist) {
« no previous file with comments | « webrtc/video/receive_statistics_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698