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

Unified Diff: webrtc/modules/video_coding/video_sender_unittest.cc

Issue 2616393003: Periodically update channel parameters and send TargetBitrate message. (Closed)
Patch Set: Rebase Created 3 years, 11 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 | « webrtc/modules/video_coding/video_sender.cc ('k') | webrtc/video/vie_encoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/video_sender_unittest.cc
diff --git a/webrtc/modules/video_coding/video_sender_unittest.cc b/webrtc/modules/video_coding/video_sender_unittest.cc
index f0246ca67306f8fb379eaaad95363f72f8806c1f..50e17bfe70c18452c12f9e9a56383873ac5d87ff 100644
--- a/webrtc/modules/video_coding/video_sender_unittest.cc
+++ b/webrtc/modules/video_coding/video_sender_unittest.cc
@@ -317,22 +317,6 @@ TEST_F(TestVideoSenderWithMockEncoder, TestSetRate) {
AddFrame();
clock_.AdvanceTimeMilliseconds(kFrameIntervalMs);
- // Add enough frames so that input frame rate will be updated.
- const int kFramesToSend =
- (VCMProcessTimer::kDefaultProcessIntervalMs / kFrameIntervalMs) + 1;
- for (int i = 0; i < kFramesToSend; ++i) {
- AddFrame();
- clock_.AdvanceTimeMilliseconds(kFrameIntervalMs);
- }
-
- EXPECT_CALL(encoder_,
- SetRateAllocation(new_rate_allocation, kActualFrameRate))
- .Times(1)
- .WillOnce(Return(0));
-
- sender_->Process();
- AddFrame();
-
// Expect no call to encoder_.SetRates if the new bitrate is zero.
EXPECT_CALL(encoder_, SetRateAllocation(_, _)).Times(0);
sender_->SetChannelParameters(0, 0, 200, rate_allocator_.get(), nullptr);
@@ -376,23 +360,6 @@ TEST_F(TestVideoSenderWithMockEncoder, TestEncoderParametersForInternalSource) {
rate_allocator_.get(), nullptr);
}
-TEST_F(TestVideoSenderWithMockEncoder, EncoderFramerateUpdatedViaProcess) {
- sender_->SetChannelParameters(settings_.startBitrate * 1000, 0, 200,
- rate_allocator_.get(), nullptr);
- const int64_t kRateStatsWindowMs = 2000;
- const uint32_t kInputFps = 20;
- int64_t start_time = clock_.TimeInMilliseconds();
- while (clock_.TimeInMilliseconds() < start_time + kRateStatsWindowMs) {
- AddFrame();
- clock_.AdvanceTimeMilliseconds(1000 / kInputFps);
- }
- EXPECT_CALL(encoder_, SetRateAllocation(_, kInputFps))
- .Times(1)
- .WillOnce(Return(0));
- sender_->Process();
- AddFrame();
-}
-
TEST_F(TestVideoSenderWithMockEncoder,
NoRedundantSetChannelParameterOrSetRatesCalls) {
const uint8_t kLossRate = 4;
@@ -412,13 +379,7 @@ TEST_F(TestVideoSenderWithMockEncoder,
AddFrame();
clock_.AdvanceTimeMilliseconds(1000 / kInputFps);
}
- // After process, input framerate should be updated but not ChannelParameters
- // as they are the same as before.
- EXPECT_CALL(encoder_, SetRateAllocation(_, kInputFps))
- .Times(1)
- .WillOnce(Return(0));
- sender_->Process();
- AddFrame();
+
// Call to SetChannelParameters with changed bitrate should call encoder
// SetRates but not encoder SetChannelParameters (that are unchanged).
uint32_t new_bitrate_bps = 2 * settings_.startBitrate * 1000;
« no previous file with comments | « webrtc/modules/video_coding/video_sender.cc ('k') | webrtc/video/vie_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698