Index: webrtc/call/call_perf_tests.cc |
diff --git a/webrtc/call/call_perf_tests.cc b/webrtc/call/call_perf_tests.cc |
index 13cec9c6e8cf3855d124e15d014d11955f70f876..5a60acee5eedcab5191a426337bbc6036878e432 100644 |
--- a/webrtc/call/call_perf_tests.cc |
+++ b/webrtc/call/call_perf_tests.cc |
@@ -648,16 +648,14 @@ |
size_t max_payload_size) override { |
++encoder_inits_; |
if (encoder_inits_ == 1) { |
+ // First time initialization. Frame size is not known. |
+ EXPECT_EQ(kInitialBitrateKbps, config->startBitrate) |
+ << "Encoder not initialized at expected bitrate."; |
+ } else if (encoder_inits_ == 2) { |
// First time initialization. Frame size is known. |
- // |expected_bitrate| is affected by bandwidth estimation before the |
- // first frame arrives to the encoder. |
- uint32_t expected_bitrate = |
- last_set_bitrate_ > 0 ? last_set_bitrate_ : kInitialBitrateKbps; |
- EXPECT_EQ(expected_bitrate, config->startBitrate) |
- << "Encoder not initialized at expected bitrate."; |
EXPECT_EQ(kDefaultWidth, config->width); |
EXPECT_EQ(kDefaultHeight, config->height); |
- } else if (encoder_inits_ == 2) { |
+ } else if (encoder_inits_ == 3) { |
EXPECT_EQ(2 * kDefaultWidth, config->width); |
EXPECT_EQ(2 * kDefaultHeight, config->height); |
EXPECT_GE(last_set_bitrate_, kReconfigureThresholdKbps); |
@@ -673,7 +671,7 @@ |
int32_t SetRates(uint32_t new_target_bitrate_kbps, |
uint32_t framerate) override { |
last_set_bitrate_ = new_target_bitrate_kbps; |
- if (encoder_inits_ == 1 && |
+ if (encoder_inits_ == 2 && |
new_target_bitrate_kbps > kReconfigureThresholdKbps) { |
time_to_reconfigure_.Set(); |
} |
@@ -692,7 +690,6 @@ |
std::vector<VideoReceiveStream::Config>* receive_configs, |
VideoEncoderConfig* encoder_config) override { |
send_config->encoder_settings.encoder = this; |
- encoder_config->max_bitrate_bps = 2 * kReconfigureThresholdKbps * 1000; |
encoder_config->video_stream_factory = |
new rtc::RefCountedObject<VideoStreamFactory>(); |