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

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

Issue 2411183003: Removed RTPHeader from NetEq's Packet struct. (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 cf590caf4b4b4ad5e8a82346dfaeba2ad77e0efd..6c067704f69064d3129610cc3d3ef1cf02c0a423 100644
--- a/webrtc/modules/audio_coding/neteq/packet.h
+++ b/webrtc/modules/audio_coding/neteq/packet.h
@@ -66,7 +66,9 @@ struct Packet {
}
};
- RTPHeader header;
+ uint32_t timestamp;
+ uint16_t sequenceNumber;
hlundin-webrtc 2016/10/12 20:39:58 Please, make the member names follow the style gui
ossu 2016/10/12 21:46:02 Payload types are uint8_t in so many other places,
hlundin-webrtc 2016/10/13 07:54:18 Acknowledged.
+ uint8_t payloadType;
// Datagram excluding RTP header and header extension.
rtc::Buffer payload;
Priority priority;
@@ -82,23 +84,23 @@ struct Packet {
// account. For two packets with the same sequence number and timestamp a
// primary payload is considered "smaller" than a secondary.
bool operator==(const Packet& rhs) const {
- return (this->header.timestamp == rhs.header.timestamp &&
- this->header.sequenceNumber == rhs.header.sequenceNumber &&
+ return (this->timestamp == rhs.timestamp &&
+ this->sequenceNumber == rhs.sequenceNumber &&
this->priority == rhs.priority);
}
bool operator!=(const Packet& rhs) const { return !operator==(rhs); }
bool operator<(const Packet& rhs) const {
- if (this->header.timestamp == rhs.header.timestamp) {
- if (this->header.sequenceNumber == rhs.header.sequenceNumber) {
+ if (this->timestamp == rhs.timestamp) {
+ if (this->sequenceNumber == rhs.sequenceNumber) {
// Timestamp and sequence numbers are identical - deem the left hand
// side to be "smaller" (i.e., "earlier") if it has higher priority.
return this->priority < rhs.priority;
}
- return (static_cast<uint16_t>(rhs.header.sequenceNumber
- - this->header.sequenceNumber) < 0xFFFF / 2);
+ return (static_cast<uint16_t>(rhs.sequenceNumber - this->sequenceNumber) <
+ 0xFFFF / 2);
}
- return (static_cast<uint32_t>(rhs.header.timestamp
- - this->header.timestamp) < 0xFFFFFFFF / 2);
+ return (static_cast<uint32_t>(rhs.timestamp - this->timestamp) <
+ 0xFFFFFFFF / 2);
}
bool operator>(const Packet& rhs) const { return rhs.operator<(*this); }
bool operator<=(const Packet& rhs) const { return !operator>(rhs); }

Powered by Google App Engine
This is Rietveld 408576698