Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Unified Diff: webrtc/call/call_perf_tests.cc

Issue 2458363002: Reland Change ViEEncoder to not reconfigure the encoder until the video resolution is known. (Closed)
Patch Set: Revert to VideoFrameInfo(176, 144, kVideoRotation_0, false). Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/media/engine/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/call/call_perf_tests.cc
diff --git a/webrtc/call/call_perf_tests.cc b/webrtc/call/call_perf_tests.cc
index 5a60acee5eedcab5191a426337bbc6036878e432..13cec9c6e8cf3855d124e15d014d11955f70f876 100644
--- a/webrtc/call/call_perf_tests.cc
+++ b/webrtc/call/call_perf_tests.cc
@@ -648,14 +648,16 @@ TEST_F(CallPerfTest, KeepsHighBitrateWhenReconfiguringSender) {
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_ == 3) {
+ } else if (encoder_inits_ == 2) {
EXPECT_EQ(2 * kDefaultWidth, config->width);
EXPECT_EQ(2 * kDefaultHeight, config->height);
EXPECT_GE(last_set_bitrate_, kReconfigureThresholdKbps);
@@ -671,7 +673,7 @@ TEST_F(CallPerfTest, KeepsHighBitrateWhenReconfiguringSender) {
int32_t SetRates(uint32_t new_target_bitrate_kbps,
uint32_t framerate) override {
last_set_bitrate_ = new_target_bitrate_kbps;
- if (encoder_inits_ == 2 &&
+ if (encoder_inits_ == 1 &&
new_target_bitrate_kbps > kReconfigureThresholdKbps) {
time_to_reconfigure_.Set();
}
@@ -690,6 +692,7 @@ TEST_F(CallPerfTest, KeepsHighBitrateWhenReconfiguringSender) {
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>();
« no previous file with comments | « no previous file | webrtc/media/engine/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698