New pacer: keepalive fix, unittests coverage
This CL fixes a bug affecting the new PacedSender code path (not yet active): keepalive packets will always be sent, even if sending is paused or network is congested. Mainly though, it refactors all the PacedSender unittests and makes sure all of them (as applicable) are run using both the old and the new code paths. Bug: webrtc:10633 Change-Id: I531939b719a11147a2a7dbab77dfcccaf7a42d83 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145721 Reviewed-by: Sebastian Jansson <srte@webrtc.org> Commit-Queue: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28578}
This commit is contained in:
parent
bb80c1347c
commit
b88fd31384
@ -338,13 +338,16 @@ void PacedSender::Process() {
|
||||
critsect_.Enter();
|
||||
OnPaddingSent(bytes_sent);
|
||||
} else {
|
||||
size_t keepalive_bytes_sent = 0;
|
||||
critsect_.Leave();
|
||||
std::vector<std::unique_ptr<RtpPacketToSend>> keepalive_packets =
|
||||
packet_router_->GeneratePadding(1);
|
||||
critsect_.Enter();
|
||||
for (auto& packet : keepalive_packets) {
|
||||
EnqueuePacket(std::move(packet));
|
||||
keepalive_bytes_sent += packet->payload_size() + packet->padding_size();
|
||||
packet_router_->SendPacket(std::move(packet), PacedPacketInfo());
|
||||
}
|
||||
critsect_.Enter();
|
||||
OnPaddingSent(keepalive_bytes_sent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user