NetEq now works with packets as values, rather than pointers.

PacketList is now list<Packet> instead of list<Packet*>.
Splicing the lists in NetEqImpl::InsertPacketInternal instead of
moving packets. Avoid moving the packet when doing Rfc3389Cng.
Removed PacketBuffer::DeleteFirstPacket and DeleteAllPackets.

BUG=chromium:657300

Review-Url: https://codereview.webrtc.org/2425223002
Cr-Commit-Position: refs/heads/master@{#14747}
This commit is contained in:
ossu
2016-10-24 08:25:28 -07:00
committed by Commit bot
parent d312713e61
commit a73f6c9726
16 changed files with 429 additions and 505 deletions

View File

@ -175,16 +175,15 @@ TEST(DecoderDatabase, CheckPayloadTypes) {
for (int i = 0; i < kNumPayloads + 1; ++i) {
// Create packet with payload type |i|. The last packet will have a payload
// type that is not registered in the decoder database.
Packet* packet = new Packet;
packet->payload_type = i;
packet_list.push_back(packet);
Packet packet;
packet.payload_type = i;
packet_list.push_back(std::move(packet));
}
// Expect to return false, since the last packet is of an unknown type.
EXPECT_EQ(DecoderDatabase::kDecoderNotFound,
db.CheckPayloadTypes(packet_list));
delete packet_list.back();
packet_list.pop_back(); // Remove the unknown one.
EXPECT_EQ(DecoderDatabase::kOK, db.CheckPayloadTypes(packet_list));
@ -192,7 +191,6 @@ TEST(DecoderDatabase, CheckPayloadTypes) {
// Delete all packets.
PacketList::iterator it = packet_list.begin();
while (it != packet_list.end()) {
delete packet_list.front();
it = packet_list.erase(it);
}
}