OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 | 616 |
617 TEST_F(SendStatisticsProxyTest, GetStatsReportsBandwidthLimitedResolution) { | 617 TEST_F(SendStatisticsProxyTest, GetStatsReportsBandwidthLimitedResolution) { |
618 // Initially false. | 618 // Initially false. |
619 EXPECT_FALSE(statistics_proxy_->GetStats().bw_limited_resolution); | 619 EXPECT_FALSE(statistics_proxy_->GetStats().bw_limited_resolution); |
620 // No resolution scale by default. | 620 // No resolution scale by default. |
621 EncodedImage encoded_image; | 621 EncodedImage encoded_image; |
622 statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr); | 622 statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr); |
623 EXPECT_FALSE(statistics_proxy_->GetStats().bw_limited_resolution); | 623 EXPECT_FALSE(statistics_proxy_->GetStats().bw_limited_resolution); |
624 // Resolution not scaled. | 624 // Resolution not scaled. |
625 encoded_image.adapt_reason_.bw_resolutions_disabled = 0; | 625 encoded_image.adapt_reason_.bw_resolutions_disabled = 0; |
626 encoded_image.adapt_reason_.quality_resolution_downscales = 0; | |
627 statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr); | 626 statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr); |
628 EXPECT_FALSE(statistics_proxy_->GetStats().bw_limited_resolution); | 627 EXPECT_FALSE(statistics_proxy_->GetStats().bw_limited_resolution); |
629 // Resolution scaled due to bandwidth. | 628 // Resolution scaled due to bandwidth. |
630 encoded_image.adapt_reason_.bw_resolutions_disabled = 1; | 629 encoded_image.adapt_reason_.bw_resolutions_disabled = 1; |
631 encoded_image.adapt_reason_.quality_resolution_downscales = 0; | |
632 statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr); | |
633 EXPECT_TRUE(statistics_proxy_->GetStats().bw_limited_resolution); | |
634 // Resolution not scaled. | |
635 encoded_image.adapt_reason_.bw_resolutions_disabled = 0; | |
636 encoded_image.adapt_reason_.quality_resolution_downscales = 0; | |
637 statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr); | |
638 EXPECT_FALSE(statistics_proxy_->GetStats().bw_limited_resolution); | |
639 // Resolution scaled due to quality. | |
640 encoded_image.adapt_reason_.bw_resolutions_disabled = 0; | |
641 encoded_image.adapt_reason_.quality_resolution_downscales = 1; | |
642 statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr); | 630 statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr); |
643 EXPECT_TRUE(statistics_proxy_->GetStats().bw_limited_resolution); | 631 EXPECT_TRUE(statistics_proxy_->GetStats().bw_limited_resolution); |
644 } | 632 } |
645 | 633 |
646 TEST_F(SendStatisticsProxyTest, NoSubstreams) { | 634 TEST_F(SendStatisticsProxyTest, NoSubstreams) { |
647 uint32_t excluded_ssrc = | 635 uint32_t excluded_ssrc = |
648 std::max( | 636 std::max( |
649 *std::max_element(config_.rtp.ssrcs.begin(), config_.rtp.ssrcs.end()), | 637 *std::max_element(config_.rtp.ssrcs.begin(), config_.rtp.ssrcs.end()), |
650 *std::max_element(config_.rtp.rtx.ssrcs.begin(), | 638 *std::max_element(config_.rtp.rtx.ssrcs.begin(), |
651 config_.rtp.rtx.ssrcs.end())) + | 639 config_.rtp.rtx.ssrcs.end())) + |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1076 | 1064 |
1077 EXPECT_EQ( | 1065 EXPECT_EQ( |
1078 1, metrics::NumSamples("WebRTC.Video.Screenshare.FecBitrateSentInKbps")); | 1066 1, metrics::NumSamples("WebRTC.Video.Screenshare.FecBitrateSentInKbps")); |
1079 EXPECT_EQ(1, metrics::NumEvents( | 1067 EXPECT_EQ(1, metrics::NumEvents( |
1080 "WebRTC.Video.Screenshare.FecBitrateSentInKbps", | 1068 "WebRTC.Video.Screenshare.FecBitrateSentInKbps", |
1081 static_cast<int>((counters.fec.TotalBytes() * 2 * 8) / | 1069 static_cast<int>((counters.fec.TotalBytes() * 2 * 8) / |
1082 metrics::kMinRunTimeInSeconds / 1000))); | 1070 metrics::kMinRunTimeInSeconds / 1000))); |
1083 } | 1071 } |
1084 | 1072 |
1085 } // namespace webrtc | 1073 } // namespace webrtc |
OLD | NEW |