OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 EXPECT_EQ(1, metrics::NumEvents("WebRTC.Video.JitterBufferDelayInMs", | 505 EXPECT_EQ(1, metrics::NumEvents("WebRTC.Video.JitterBufferDelayInMs", |
506 kJitterBufferMs)); | 506 kJitterBufferMs)); |
507 EXPECT_EQ(1, | 507 EXPECT_EQ(1, |
508 metrics::NumEvents("WebRTC.Video.TargetDelayInMs", kTargetDelayMs)); | 508 metrics::NumEvents("WebRTC.Video.TargetDelayInMs", kTargetDelayMs)); |
509 EXPECT_EQ( | 509 EXPECT_EQ( |
510 1, metrics::NumEvents("WebRTC.Video.CurrentDelayInMs", kCurrentDelayMs)); | 510 1, metrics::NumEvents("WebRTC.Video.CurrentDelayInMs", kCurrentDelayMs)); |
511 EXPECT_EQ(1, | 511 EXPECT_EQ(1, |
512 metrics::NumEvents("WebRTC.Video.OnewayDelayInMs", kTargetDelayMs)); | 512 metrics::NumEvents("WebRTC.Video.OnewayDelayInMs", kTargetDelayMs)); |
513 } | 513 } |
514 | 514 |
| 515 TEST_F(ReceiveStatisticsProxyTest, DoesNotReportStaleFramerates) { |
| 516 const int kDefaultFps = 30; |
| 517 const int kWidth = 320; |
| 518 const int kHeight = 240; |
| 519 |
| 520 rtc::scoped_refptr<VideoFrameBuffer> video_frame_buffer( |
| 521 I420Buffer::Create(kWidth, kHeight)); |
| 522 VideoFrame frame(video_frame_buffer, kVideoRotation_0, 0); |
| 523 |
| 524 for (int i = 0; i < kDefaultFps; ++i) { |
| 525 // Since OnRenderedFrame is never called the fps in each sample will be 0, |
| 526 // i.e. bad |
| 527 frame.set_ntp_time_ms(fake_clock_.CurrentNtpInMilliseconds()); |
| 528 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(), |
| 529 VideoContentType::UNSPECIFIED); |
| 530 statistics_proxy_->OnRenderedFrame(frame); |
| 531 fake_clock_.AdvanceTimeMilliseconds(1000 / kDefaultFps); |
| 532 } |
| 533 |
| 534 EXPECT_EQ(kDefaultFps, statistics_proxy_->GetStats().decode_frame_rate); |
| 535 EXPECT_EQ(kDefaultFps, statistics_proxy_->GetStats().render_frame_rate); |
| 536 |
| 537 // FPS trackers in stats proxy have a 1000ms sliding window. |
| 538 fake_clock_.AdvanceTimeMilliseconds(1000); |
| 539 EXPECT_EQ(0, statistics_proxy_->GetStats().decode_frame_rate); |
| 540 EXPECT_EQ(0, statistics_proxy_->GetStats().render_frame_rate); |
| 541 } |
| 542 |
515 } // namespace webrtc | 543 } // namespace webrtc |
OLD | NEW |