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

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

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
« no previous file with comments | « webrtc/modules/audio_coding/neteq/packet.h ('k') | webrtc/modules/audio_coding/neteq/packet_buffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/neteq/packet.cc
diff --git a/webrtc/modules/audio_coding/neteq/packet.cc b/webrtc/modules/audio_coding/neteq/packet.cc
index 8a19fe4d5923d5e22a5b485600c6da0c5f3856ba..f25f81a241bc8a7b669fd77868ccc27fa017a00f 100644
--- a/webrtc/modules/audio_coding/neteq/packet.cc
+++ b/webrtc/modules/audio_coding/neteq/packet.cc
@@ -13,7 +13,23 @@
namespace webrtc {
Packet::Packet() = default;
+Packet::Packet(Packet&& b) = default;
Packet::~Packet() = default;
+Packet& Packet::operator=(Packet&& b) = default;
+
+Packet Packet::Clone() const {
+ RTC_CHECK(!frame);
+
+ Packet clone;
+ clone.timestamp = timestamp;
+ clone.sequence_number = sequence_number;
+ clone.payload_type = payload_type;
+ clone.payload.SetData(payload.data(), payload.size());
+ clone.priority = priority;
+
+ return clone;
+}
+
} // namespace webrtc
« no previous file with comments | « webrtc/modules/audio_coding/neteq/packet.h ('k') | webrtc/modules/audio_coding/neteq/packet_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698