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

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

Issue 2425223002: NetEq now works with packets as values, rather than pointers. (Closed)
Patch Set: 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..8316a8fda35933925710bd518c460f264eaa086e 100644
--- a/webrtc/modules/audio_coding/neteq/packet.h
+++ b/webrtc/modules/audio_coding/neteq/packet.h
@@ -75,8 +75,18 @@ struct Packet {
std::unique_ptr<AudioDecoder::EncodedAudioFrame> frame;
Packet();
+
kwiberg-webrtc 2016/10/20 22:39:22 Why the extra blank line?
ossu 2016/10/21 12:54:41 To give the reader some time to breathe! (fixed)
+ 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 +119,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_

Powered by Google App Engine
This is Rietveld 408576698