Revert of Fix simulator issue where chokes didn't apply to non-congested packets. (patchset #2 id:20001 of https://codereview.webrtc.org/1233853002/)
Reason for revert:
Breaks bots.
Original issue's description:
> Fix simulator issue where chokes didn't apply to non-congested packets.
>
> R=magalhaesc@google.com
>
> Committed: 662ae00efa
TBR=magalhaesc@webrtc.org,magalhaesc@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.webrtc.org/1230383003
Cr-Commit-Position: refs/heads/master@{#9571}
This commit is contained in:
@ -223,8 +223,6 @@
|
|||||||
'remote_bitrate_estimator/remote_bitrate_estimator_single_stream_unittest.cc',
|
'remote_bitrate_estimator/remote_bitrate_estimator_single_stream_unittest.cc',
|
||||||
'remote_bitrate_estimator/remote_bitrate_estimator_unittest_helper.cc',
|
'remote_bitrate_estimator/remote_bitrate_estimator_unittest_helper.cc',
|
||||||
'remote_bitrate_estimator/remote_bitrate_estimator_unittest_helper.h',
|
'remote_bitrate_estimator/remote_bitrate_estimator_unittest_helper.h',
|
||||||
'remote_bitrate_estimator/test/bwe_test_framework_unittest.cc',
|
|
||||||
'remote_bitrate_estimator/test/estimators/nada_unittest.cc',
|
|
||||||
'rtp_rtcp/source/mock/mock_rtp_payload_strategy.h',
|
'rtp_rtcp/source/mock/mock_rtp_payload_strategy.h',
|
||||||
'rtp_rtcp/source/byte_io_unittest.cc',
|
'rtp_rtcp/source/byte_io_unittest.cc',
|
||||||
'rtp_rtcp/source/fec_receiver_unittest.cc',
|
'rtp_rtcp/source/fec_receiver_unittest.cc',
|
||||||
|
@ -70,6 +70,7 @@
|
|||||||
'test/bwe_test_fileutils.h',
|
'test/bwe_test_fileutils.h',
|
||||||
'test/bwe_test_framework.cc',
|
'test/bwe_test_framework.cc',
|
||||||
'test/bwe_test_framework.h',
|
'test/bwe_test_framework.h',
|
||||||
|
'test/bwe_test_framework_unittest.cc',
|
||||||
'test/bwe_test_logging.cc',
|
'test/bwe_test_logging.cc',
|
||||||
'test/bwe_test_logging.h',
|
'test/bwe_test_logging.h',
|
||||||
'test/packet_receiver.cc',
|
'test/packet_receiver.cc',
|
||||||
@ -81,6 +82,7 @@
|
|||||||
'test/random.h',
|
'test/random.h',
|
||||||
'test/estimators/nada.cc',
|
'test/estimators/nada.cc',
|
||||||
'test/estimators/nada.h',
|
'test/estimators/nada.h',
|
||||||
|
'test/estimators/nada_unittest.cc',
|
||||||
'test/estimators/remb.cc',
|
'test/estimators/remb.cc',
|
||||||
'test/estimators/remb.h',
|
'test/estimators/remb.h',
|
||||||
'test/estimators/send_side.cc',
|
'test/estimators/send_side.cc',
|
||||||
|
@ -431,9 +431,10 @@ void ChokeFilter::RunFor(int64_t /*time_ms*/, Packets* in_out) {
|
|||||||
assert(in_out);
|
assert(in_out);
|
||||||
for (PacketsIt it = in_out->begin(); it != in_out->end(); ) {
|
for (PacketsIt it = in_out->begin(); it != in_out->end(); ) {
|
||||||
int64_t earliest_send_time_us =
|
int64_t earliest_send_time_us =
|
||||||
std::max(last_send_time_us_, (*it)->send_time_us());
|
last_send_time_us_ +
|
||||||
int64_t new_send_time_us = earliest_send_time_us +
|
|
||||||
((*it)->payload_size() * 8 * 1000 + kbps_ / 2) / kbps_;
|
((*it)->payload_size() * 8 * 1000 + kbps_ / 2) / kbps_;
|
||||||
|
int64_t new_send_time_us =
|
||||||
|
std::max((*it)->send_time_us(), earliest_send_time_us);
|
||||||
if (delay_cap_helper_->ShouldSendPacket(new_send_time_us,
|
if (delay_cap_helper_->ShouldSendPacket(new_send_time_us,
|
||||||
(*it)->send_time_us())) {
|
(*it)->send_time_us())) {
|
||||||
(*it)->set_send_time_us(new_send_time_us);
|
(*it)->set_send_time_us(new_send_time_us);
|
||||||
|
@ -657,39 +657,13 @@ class BweTestFramework_ChokeFilterTest : public ::testing::Test {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
int64_t now_ms_;
|
int64_t now_ms_;
|
||||||
uint16_t sequence_number_;
|
uint32_t sequence_number_;
|
||||||
Packets output_packets_;
|
Packets output_packets_;
|
||||||
std::vector<int64_t> send_times_us_;
|
std::vector<int64_t> send_times_us_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(BweTestFramework_ChokeFilterTest);
|
DISALLOW_COPY_AND_ASSIGN(BweTestFramework_ChokeFilterTest);
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_F(BweTestFramework_ChokeFilterTest, NoQueue) {
|
|
||||||
const int kCapacityKbps = 10;
|
|
||||||
const size_t kPacketSize = 125;
|
|
||||||
const int64_t kExpectedSendTimeUs = kPacketSize * 8 * 1000 / kCapacityKbps;
|
|
||||||
uint16_t sequence_number = 0;
|
|
||||||
int64_t send_time_us = 0;
|
|
||||||
ChokeFilter filter(NULL, 0);
|
|
||||||
filter.SetCapacity(10);
|
|
||||||
Packets packets;
|
|
||||||
RTPHeader header;
|
|
||||||
for (uint32_t i = 0; i < 2; ++i) {
|
|
||||||
header.sequenceNumber = sequence_number++;
|
|
||||||
// Payload is 1000 bits.
|
|
||||||
packets.push_back(new MediaPacket(0, send_time_us, 125, header));
|
|
||||||
send_time_us += kExpectedSendTimeUs + 1000;
|
|
||||||
}
|
|
||||||
ASSERT_TRUE(IsTimeSorted(packets));
|
|
||||||
filter.RunFor(2 * kExpectedSendTimeUs + 1000, &packets);
|
|
||||||
EXPECT_EQ(kExpectedSendTimeUs, packets.front()->send_time_us());
|
|
||||||
delete packets.front();
|
|
||||||
packets.pop_front();
|
|
||||||
EXPECT_EQ(2 * kExpectedSendTimeUs + 1000, packets.front()->send_time_us());
|
|
||||||
delete packets.front();
|
|
||||||
packets.pop_front();
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(BweTestFramework_ChokeFilterTest, Short) {
|
TEST_F(BweTestFramework_ChokeFilterTest, Short) {
|
||||||
// 100ms, 100 packets, 10 kbps choke -> 1 kbit of data should have propagated.
|
// 100ms, 100 packets, 10 kbps choke -> 1 kbit of data should have propagated.
|
||||||
// That is actually just a single packet, since each packet has 1000 bits of
|
// That is actually just a single packet, since each packet has 1000 bits of
|
||||||
@ -749,8 +723,8 @@ TEST_F(BweTestFramework_ChokeFilterTest, MaxDelay) {
|
|||||||
|
|
||||||
// 100 ms delay cap
|
// 100 ms delay cap
|
||||||
filter.SetMaxDelay(100);
|
filter.SetMaxDelay(100);
|
||||||
// 10100ms, 50 more packets -> 1 packets or 1 kbit through.
|
// 10100ms, 50 more packets -> 2 packets or 2 kbit through.
|
||||||
TestChoke(&filter, 100, 50, 1);
|
TestChoke(&filter, 100, 50, 2);
|
||||||
CheckMaxDelay(100);
|
CheckMaxDelay(100);
|
||||||
// 20000ms, no input, remaining packets in queue should have been dropped.
|
// 20000ms, no input, remaining packets in queue should have been dropped.
|
||||||
TestChoke(&filter, 9900, 0, 0);
|
TestChoke(&filter, 9900, 0, 0);
|
||||||
@ -758,8 +732,8 @@ TEST_F(BweTestFramework_ChokeFilterTest, MaxDelay) {
|
|||||||
// Reset delay cap (0 is no cap) and verify no packets are dropped.
|
// Reset delay cap (0 is no cap) and verify no packets are dropped.
|
||||||
filter.SetCapacity(10);
|
filter.SetCapacity(10);
|
||||||
filter.SetMaxDelay(0);
|
filter.SetMaxDelay(0);
|
||||||
TestChoke(&filter, 100, 100, 1);
|
TestChoke(&filter, 100, 100, 2);
|
||||||
TestChoke(&filter, 9900, 0, 99);
|
TestChoke(&filter, 9900, 0, 98);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(BweTestFramework_ChokeFilterTest, ShortTrace) {
|
TEST_F(BweTestFramework_ChokeFilterTest, ShortTrace) {
|
||||||
|
Reference in New Issue
Block a user