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

Side by Side Diff: webrtc/modules/pacing/paced_sender_unittest.cc

Issue 1412293003: Allow pacer to boost bitrate in order to meet time constraints. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 if (time_until_process <= 0) { 657 if (time_until_process <= 0) {
658 send_bucket_->Process(); 658 send_bucket_->Process();
659 } else { 659 } else {
660 clock_.AdvanceTimeMilliseconds(time_until_process); 660 clock_.AdvanceTimeMilliseconds(time_until_process);
661 } 661 }
662 } 662 }
663 int64_t duration = clock_.TimeInMilliseconds() - time_start; 663 int64_t duration = clock_.TimeInMilliseconds() - time_start;
664 664
665 EXPECT_EQ(0, send_bucket_->ExpectedQueueTimeMs()); 665 EXPECT_EQ(0, send_bucket_->ExpectedQueueTimeMs());
666 666
667 // Allow for aliasing, duration should be in [expected(n - 1), expected(n)]. 667 // Allow for aliasing, duration should be within one pack of max time limit.
668 EXPECT_LE(duration, queue_in_ms); 668 EXPECT_LE(duration, PacedSender::kMaxQueueLengthMs);
669 EXPECT_GE(duration, 669 EXPECT_GE(duration, PacedSender::kMaxQueueLengthMs -
670 queue_in_ms - static_cast<int64_t>(kPacketSize * 8 / kMaxBitrate)); 670 static_cast<int64_t>(kPacketSize * 8 / kMaxBitrate));
stefan-webrtc 2015/10/28 15:45:23 EXPECT_NEAR(duration, PacedSender::.., kPacketSize
sprang_webrtc 2015/11/02 12:17:56 Done.
671 } 671 }
672 672
673 TEST_F(PacedSenderTest, QueueTimeGrowsOverTime) { 673 TEST_F(PacedSenderTest, QueueTimeGrowsOverTime) {
674 uint32_t ssrc = 12346; 674 uint32_t ssrc = 12346;
675 uint16_t sequence_number = 1234; 675 uint16_t sequence_number = 1234;
676 EXPECT_EQ(0, send_bucket_->QueueInMs()); 676 EXPECT_EQ(0, send_bucket_->QueueInMs());
677 677
678 send_bucket_->UpdateBitrate(30, kPaceMultiplier * 30, 0); 678 send_bucket_->UpdateBitrate(30, kPaceMultiplier * 30, 0);
679 SendAndExpectPacket(PacedSender::kNormalPriority, 679 SendAndExpectPacket(PacedSender::kNormalPriority,
680 ssrc, 680 ssrc,
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 sequence_number++, clock_.TimeInMilliseconds(), 825 sequence_number++, clock_.TimeInMilliseconds(),
826 kPacketSize, false); 826 kPacketSize, false);
827 827
828 // Don't send padding if queue is non-empty, even if padding budget > 0. 828 // Don't send padding if queue is non-empty, even if padding budget > 0.
829 EXPECT_CALL(callback_, TimeToSendPadding(_)).Times(0); 829 EXPECT_CALL(callback_, TimeToSendPadding(_)).Times(0);
830 send_bucket_->Process(); 830 send_bucket_->Process();
831 } 831 }
832 832
833 } // namespace test 833 } // namespace test
834 } // namespace webrtc 834 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698