Add a "Smart flushing" feature to NetEq.

Instead of flushing all packets, it makes sense to flush down to the target level instead. This CL also initiates a flush when the packet buffer is a multiple of the target level, instead of waiting until it is completely full.

Bug: webrtc:12201
Change-Id: I8775147624536824eb88752f6e8ffe57ec6199cb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/193941
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32701}
This commit is contained in:
Ivo Creusen
2020-11-25 11:32:40 +01:00
committed by Commit Bot
parent 54b91412de
commit 7b463c5f67
12 changed files with 403 additions and 70 deletions

View File

@ -328,8 +328,8 @@ TEST_F(NetEqImplTest, InsertPacket) {
// Expectations for packet buffer.
EXPECT_CALL(*mock_packet_buffer_, Empty())
.WillOnce(Return(false)); // Called once after first packet is inserted.
EXPECT_CALL(*mock_packet_buffer_, Flush()).Times(1);
EXPECT_CALL(*mock_packet_buffer_, InsertPacketList(_, _, _, _, _))
EXPECT_CALL(*mock_packet_buffer_, Flush(_)).Times(1);
EXPECT_CALL(*mock_packet_buffer_, InsertPacketList(_, _, _, _, _, _, _, _))
.Times(2)
.WillRepeatedly(DoAll(SetArgPointee<2>(kPayloadType),
WithArg<0>(Invoke(DeletePacketsAndReturnOk))));