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 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
596 | 596 |
597 TEST_F(SendStatisticsProxyTest, GetStatsReportsBandwidthLimitedResolution) { | 597 TEST_F(SendStatisticsProxyTest, GetStatsReportsBandwidthLimitedResolution) { |
598 // Initially false. | 598 // Initially false. |
599 EXPECT_FALSE(statistics_proxy_->GetStats().bw_limited_resolution); | 599 EXPECT_FALSE(statistics_proxy_->GetStats().bw_limited_resolution); |
600 // No resolution scale by default. | 600 // No resolution scale by default. |
601 EncodedImage encoded_image; | 601 EncodedImage encoded_image; |
602 statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr); | 602 statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr); |
603 EXPECT_FALSE(statistics_proxy_->GetStats().bw_limited_resolution); | 603 EXPECT_FALSE(statistics_proxy_->GetStats().bw_limited_resolution); |
604 // Resolution not scaled. | 604 // Resolution not scaled. |
605 encoded_image.adapt_reason_.bw_resolutions_disabled = 0; | 605 encoded_image.adapt_reason_.bw_resolutions_disabled = 0; |
606 encoded_image.adapt_reason_.quality_resolution_downscales = 0; | |
607 statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr); | 606 statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr); |
608 EXPECT_FALSE(statistics_proxy_->GetStats().bw_limited_resolution); | 607 EXPECT_FALSE(statistics_proxy_->GetStats().bw_limited_resolution); |
609 // Resolution scaled due to bandwidth. | 608 // Resolution scaled due to bandwidth. |
610 encoded_image.adapt_reason_.bw_resolutions_disabled = 1; | 609 encoded_image.adapt_reason_.bw_resolutions_disabled = 1; |
611 encoded_image.adapt_reason_.quality_resolution_downscales = 0; | |
612 statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr); | |
613 EXPECT_TRUE(statistics_proxy_->GetStats().bw_limited_resolution); | |
614 // Resolution not scaled. | |
615 encoded_image.adapt_reason_.bw_resolutions_disabled = 0; | |
616 encoded_image.adapt_reason_.quality_resolution_downscales = 0; | |
617 statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr); | |
618 EXPECT_FALSE(statistics_proxy_->GetStats().bw_limited_resolution); | |
619 // Resolution scaled due to quality. | |
620 encoded_image.adapt_reason_.bw_resolutions_disabled = 0; | |
621 encoded_image.adapt_reason_.quality_resolution_downscales = 1; | |
perkj_webrtc
2016/11/14 07:21:16
So GetStats previously reported bw_limited_resolut
sprang_webrtc
2016/11/14 10:25:39
+1, so you don't get this reverted because of a pe
kthelgason
2016/11/14 14:36:44
This behaviour has not changed, only how it's repo
| |
622 statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr); | 610 statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr); |
623 EXPECT_TRUE(statistics_proxy_->GetStats().bw_limited_resolution); | 611 EXPECT_TRUE(statistics_proxy_->GetStats().bw_limited_resolution); |
624 } | 612 } |
625 | 613 |
626 TEST_F(SendStatisticsProxyTest, NoSubstreams) { | 614 TEST_F(SendStatisticsProxyTest, NoSubstreams) { |
627 uint32_t excluded_ssrc = | 615 uint32_t excluded_ssrc = |
628 std::max( | 616 std::max( |
629 *std::max_element(config_.rtp.ssrcs.begin(), config_.rtp.ssrcs.end()), | 617 *std::max_element(config_.rtp.ssrcs.begin(), config_.rtp.ssrcs.end()), |
630 *std::max_element(config_.rtp.rtx.ssrcs.begin(), | 618 *std::max_element(config_.rtp.rtx.ssrcs.begin(), |
631 config_.rtp.rtx.ssrcs.end())) + | 619 config_.rtp.rtx.ssrcs.end())) + |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
963 | 951 |
964 EXPECT_EQ( | 952 EXPECT_EQ( |
965 1, metrics::NumSamples("WebRTC.Video.Screenshare.FecBitrateSentInKbps")); | 953 1, metrics::NumSamples("WebRTC.Video.Screenshare.FecBitrateSentInKbps")); |
966 EXPECT_EQ(1, metrics::NumEvents( | 954 EXPECT_EQ(1, metrics::NumEvents( |
967 "WebRTC.Video.Screenshare.FecBitrateSentInKbps", | 955 "WebRTC.Video.Screenshare.FecBitrateSentInKbps", |
968 static_cast<int>((rtx_counters.fec.TotalBytes() * 2 * 8) / | 956 static_cast<int>((rtx_counters.fec.TotalBytes() * 2 * 8) / |
969 metrics::kMinRunTimeInSeconds / 1000))); | 957 metrics::kMinRunTimeInSeconds / 1000))); |
970 } | 958 } |
971 | 959 |
972 } // namespace webrtc | 960 } // namespace webrtc |
OLD | NEW |