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

@ -75,8 +75,17 @@ struct Packet {
std::unique_ptr<AudioDecoder::EncodedAudioFrame> frame;
Packet();
Packet(Packet&& b);
~Packet();
// Packets should generally be moved around but sometimes it's useful to make
// a copy, for example for testing purposes. NOTE: Will only work for
// un-parsed packets, i.e. |frame| must be unset. The payload will, however,
// be copied. |waiting_time| will also not be copied.
Packet Clone() const;
Packet& operator=(Packet&& b);
// Comparison operators. Establish a packet ordering based on (1) timestamp,
// (2) sequence number and (3) redundancy.
// Timestamp and sequence numbers are compared taking wrap-around into
@ -109,7 +118,7 @@ struct Packet {
};
// A list of packets.
typedef std::list<Packet*> PacketList;
typedef std::list<Packet> PacketList;
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_PACKET_H_