Chromium Code Reviews| 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); } |