Index: webrtc/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc |
diff --git a/webrtc/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc b/webrtc/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc |
index 469cc1524c97ab8cb6fba6a123dcbb7088bee96d..e6316d6af91084f9cf92fb26dde7289fd37e1eb5 100644 |
--- a/webrtc/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc |
+++ b/webrtc/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc |
@@ -22,7 +22,6 @@ |
#include "webrtc/test/gtest.h" |
using ::testing::_; |
-using ::testing::ElementsAre; |
using ::testing::NiceMock; |
using ::testing::Return; |
@@ -62,11 +61,8 @@ |
memset(&vpx_cfg, 0, sizeof(vpx_codec_enc_cfg_t)); |
vpx_cfg.rc_min_quantizer = min_qp_; |
vpx_cfg.rc_max_quantizer = max_qp_; |
- EXPECT_THAT(layers_->OnRatesUpdated(kDefaultTl0BitrateKbps, |
- kDefaultTl1BitrateKbps, kFrameRate), |
- ElementsAre(kDefaultTl0BitrateKbps, |
- kDefaultTl1BitrateKbps - kDefaultTl0BitrateKbps)); |
- EXPECT_TRUE(layers_->UpdateConfiguration(&vpx_cfg)); |
+ EXPECT_TRUE(layers_->ConfigureBitrates( |
+ kDefaultTl0BitrateKbps, kDefaultTl1BitrateKbps, kFrameRate, &vpx_cfg)); |
frame_size_ = ((vpx_cfg.rc_target_bitrate * 1000) / 8) / kFrameRate; |
} |
@@ -377,41 +373,27 @@ |
TEST_F(ScreenshareLayerTest, TargetBitrateCappedByTL0) { |
vpx_codec_enc_cfg_t cfg = GetConfig(); |
- const int kTl0_kbps = 100; |
- const int kTl1_kbps = 1000; |
- layers_->OnRatesUpdated(kTl0_kbps, kTl1_kbps, 5); |
- |
- EXPECT_THAT(layers_->OnRatesUpdated(kTl0_kbps, kTl1_kbps, 5), |
- ElementsAre(kTl0_kbps, kTl1_kbps - kTl0_kbps)); |
- EXPECT_TRUE(layers_->UpdateConfiguration(&cfg)); |
+ layers_->ConfigureBitrates(100, 1000, 5, &cfg); |
EXPECT_EQ(static_cast<unsigned int>( |
- ScreenshareLayers::kMaxTL0FpsReduction * kTl0_kbps + 0.5), |
+ ScreenshareLayers::kMaxTL0FpsReduction * 100 + 0.5), |
cfg.rc_target_bitrate); |
} |
TEST_F(ScreenshareLayerTest, TargetBitrateCappedByTL1) { |
vpx_codec_enc_cfg_t cfg = GetConfig(); |
- const int kTl0_kbps = 100; |
- const int kTl1_kbps = 450; |
- EXPECT_THAT(layers_->OnRatesUpdated(kTl0_kbps, kTl1_kbps, 5), |
- ElementsAre(kTl0_kbps, kTl1_kbps - kTl0_kbps)); |
- EXPECT_TRUE(layers_->UpdateConfiguration(&cfg)); |
+ layers_->ConfigureBitrates(100, 450, 5, &cfg); |
EXPECT_EQ(static_cast<unsigned int>( |
- kTl1_kbps / ScreenshareLayers::kAcceptableTargetOvershoot), |
+ 450 / ScreenshareLayers::kAcceptableTargetOvershoot), |
cfg.rc_target_bitrate); |
} |
TEST_F(ScreenshareLayerTest, TargetBitrateBelowTL0) { |
vpx_codec_enc_cfg_t cfg = GetConfig(); |
- const int kTl0_kbps = 100; |
- const int kTl1_kbps = 100; |
- EXPECT_THAT(layers_->OnRatesUpdated(kTl0_kbps, kTl1_kbps, 5), |
- ElementsAre(kTl0_kbps)); |
- EXPECT_TRUE(layers_->UpdateConfiguration(&cfg)); |
- |
- EXPECT_EQ(static_cast<uint32_t>(kTl1_kbps), cfg.rc_target_bitrate); |
+ layers_->ConfigureBitrates(100, 100, 5, &cfg); |
+ |
+ EXPECT_EQ(100U, cfg.rc_target_bitrate); |
} |
TEST_F(ScreenshareLayerTest, EncoderDrop) { |
@@ -471,8 +453,7 @@ |
const uint32_t kStartTimestamp = 1234; |
vpx_codec_enc_cfg_t cfg = GetConfig(); |
- layers_->OnRatesUpdated(kLowBitrateKbps, kLowBitrateKbps, 5); |
- layers_->UpdateConfiguration(&cfg); |
+ layers_->ConfigureBitrates(kLowBitrateKbps, kLowBitrateKbps, 5, &cfg); |
EXPECT_EQ(ScreenshareLayers::kTl0Flags, |
layers_->EncodeFlags(kStartTimestamp)); |