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:
@ -209,19 +209,22 @@ TEST(TimestampScaler, TestG722PacketList) {
|
||||
// Test both sides of the timestamp wrap-around.
|
||||
uint32_t external_timestamp = 0xFFFFFFFF - 5;
|
||||
uint32_t internal_timestamp = external_timestamp;
|
||||
Packet packet1;
|
||||
packet1.payload_type = kRtpPayloadType;
|
||||
packet1.timestamp = external_timestamp;
|
||||
Packet packet2;
|
||||
packet2.payload_type = kRtpPayloadType;
|
||||
packet2.timestamp = external_timestamp + 10;
|
||||
PacketList packet_list;
|
||||
packet_list.push_back(&packet1);
|
||||
packet_list.push_back(&packet2);
|
||||
{
|
||||
Packet packet1;
|
||||
packet1.payload_type = kRtpPayloadType;
|
||||
packet1.timestamp = external_timestamp;
|
||||
Packet packet2;
|
||||
packet2.payload_type = kRtpPayloadType;
|
||||
packet2.timestamp = external_timestamp + 10;
|
||||
packet_list.push_back(std::move(packet1));
|
||||
packet_list.push_back(std::move(packet2));
|
||||
}
|
||||
|
||||
scaler.ToInternal(&packet_list);
|
||||
EXPECT_EQ(internal_timestamp, packet1.timestamp);
|
||||
EXPECT_EQ(internal_timestamp + 20, packet2.timestamp);
|
||||
EXPECT_EQ(internal_timestamp, packet_list.front().timestamp);
|
||||
packet_list.pop_front();
|
||||
EXPECT_EQ(internal_timestamp + 20, packet_list.front().timestamp);
|
||||
|
||||
EXPECT_CALL(db, Die()); // Called when database object is deleted.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user