| Index: webrtc/video/send_statistics_proxy_unittest.cc
|
| diff --git a/webrtc/video/send_statistics_proxy_unittest.cc b/webrtc/video/send_statistics_proxy_unittest.cc
|
| index acb8a306cae1e83f16e51e6c60ea0c8e583b45ef..4cee1046ddb0509980a9e6a46673adeb19c30057 100644
|
| --- a/webrtc/video/send_statistics_proxy_unittest.cc
|
| +++ b/webrtc/video/send_statistics_proxy_unittest.cc
|
| @@ -31,12 +31,6 @@
|
| const int kHeight = 480;
|
| const int kQpIdx0 = 21;
|
| const int kQpIdx1 = 39;
|
| -const CodecSpecificInfo kDefaultCodecInfo = []() {
|
| - CodecSpecificInfo codec_info;
|
| - codec_info.codecType = kVideoCodecVP8;
|
| - codec_info.codecSpecific.VP8.simulcastIdx = 0;
|
| - return codec_info;
|
| -}();
|
| } // namespace
|
|
|
| class SendStatisticsProxyTest : public ::testing::Test {
|
| @@ -665,10 +659,10 @@
|
| TEST_F(SendStatisticsProxyTest,
|
| QualityLimitedHistogramsNotUpdatedWhenDisabled) {
|
| EncodedImage encoded_image;
|
| - statistics_proxy_->SetResolutionRestrictionStats(false /* scaling_enabled */,
|
| - 0, 0);
|
| + // encoded_image.adapt_reason_.quality_resolution_downscales disabled by
|
| + // default: -1
|
| for (int i = 0; i < SendStatisticsProxy::kMinRequiredMetricsSamples; ++i)
|
| - statistics_proxy_->OnSendEncodedImage(encoded_image, &kDefaultCodecInfo);
|
| + statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr);
|
|
|
| // Histograms are updated when the statistics_proxy_ is deleted.
|
| statistics_proxy_.reset();
|
| @@ -680,9 +674,11 @@
|
|
|
| TEST_F(SendStatisticsProxyTest,
|
| QualityLimitedHistogramsUpdatedWhenEnabled_NoResolutionDownscale) {
|
| - EncodedImage encoded_image;
|
| + const int kDownscales = 0;
|
| + EncodedImage encoded_image;
|
| + encoded_image.adapt_reason_.quality_resolution_downscales = kDownscales;
|
| for (int i = 0; i < SendStatisticsProxy::kMinRequiredMetricsSamples; ++i)
|
| - statistics_proxy_->OnSendEncodedImage(encoded_image, &kDefaultCodecInfo);
|
| + statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr);
|
|
|
| // Histograms are updated when the statistics_proxy_ is deleted.
|
| statistics_proxy_.reset();
|
| @@ -699,9 +695,10 @@
|
| QualityLimitedHistogramsUpdatedWhenEnabled_TwoResolutionDownscales) {
|
| const int kDownscales = 2;
|
| EncodedImage encoded_image;
|
| - statistics_proxy_->OnQualityRestrictedResolutionChanged(kDownscales);
|
| + encoded_image.adapt_reason_.quality_resolution_downscales = kDownscales;
|
| for (int i = 0; i < SendStatisticsProxy::kMinRequiredMetricsSamples; ++i)
|
| - statistics_proxy_->OnSendEncodedImage(encoded_image, &kDefaultCodecInfo);
|
| + statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr);
|
| +
|
| // Histograms are updated when the statistics_proxy_ is deleted.
|
| statistics_proxy_.reset();
|
| EXPECT_EQ(
|
| @@ -723,18 +720,12 @@
|
| EncodedImage encoded_image;
|
| statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr);
|
| EXPECT_FALSE(statistics_proxy_->GetStats().bw_limited_resolution);
|
| -
|
| - // Simulcast disabled resolutions
|
| - encoded_image.adapt_reason_.bw_resolutions_disabled = 1;
|
| - statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr);
|
| - EXPECT_TRUE(statistics_proxy_->GetStats().bw_limited_resolution);
|
| -
|
| + // Resolution not scaled.
|
| encoded_image.adapt_reason_.bw_resolutions_disabled = 0;
|
| statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr);
|
| EXPECT_FALSE(statistics_proxy_->GetStats().bw_limited_resolution);
|
| -
|
| - // Resolution scaled due to quality.
|
| - statistics_proxy_->OnQualityRestrictedResolutionChanged(1);
|
| + // Resolution scaled due to bandwidth.
|
| + encoded_image.adapt_reason_.bw_resolutions_disabled = 1;
|
| statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr);
|
| EXPECT_TRUE(statistics_proxy_->GetStats().bw_limited_resolution);
|
| }
|
|
|