Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(662)

Unified Diff: webrtc/modules/audio_coding/neteq/packet.h

Issue 2425223002: NetEq now works with packets as values, rather than pointers. (Closed)
Patch Set: Compare packets better in test. One more const. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/neteq/packet.h
diff --git a/webrtc/modules/audio_coding/neteq/packet.h b/webrtc/modules/audio_coding/neteq/packet.h
index dc90495da882db16452d7c9797d3f5746f796bb6..74da83f4353b74748656e19d665a3a0da99294ba 100644
--- a/webrtc/modules/audio_coding/neteq/packet.h
+++ b/webrtc/modules/audio_coding/neteq/packet.h
@@ -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_
« no previous file with comments | « webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc ('k') | webrtc/modules/audio_coding/neteq/packet.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698