| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_PACKET_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_PACKET_H_ |
| 12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_PACKET_H_ | 12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_PACKET_H_ |
| 13 | 13 |
| 14 #include <list> | 14 #include <list> |
| 15 #include <memory> |
| 15 | 16 |
| 16 #include "webrtc/base/constructormagic.h" | 17 #include "webrtc/base/constructormagic.h" |
| 17 #include "webrtc/base/scoped_ptr.h" | |
| 18 #include "webrtc/common_types.h" | 18 #include "webrtc/common_types.h" |
| 19 #include "webrtc/typedefs.h" | 19 #include "webrtc/typedefs.h" |
| 20 | 20 |
| 21 namespace webrtc { | 21 namespace webrtc { |
| 22 | 22 |
| 23 class RtpHeaderParser; | 23 class RtpHeaderParser; |
| 24 struct WebRtcRTPHeader; | 24 struct WebRtcRTPHeader; |
| 25 | 25 |
| 26 namespace test { | 26 namespace test { |
| 27 | 27 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 96 |
| 97 void set_time_ms(double time) { time_ms_ = time; } | 97 void set_time_ms(double time) { time_ms_ = time; } |
| 98 double time_ms() const { return time_ms_; } | 98 double time_ms() const { return time_ms_; } |
| 99 bool valid_header() const { return valid_header_; } | 99 bool valid_header() const { return valid_header_; } |
| 100 | 100 |
| 101 private: | 101 private: |
| 102 bool ParseHeader(const RtpHeaderParser& parser); | 102 bool ParseHeader(const RtpHeaderParser& parser); |
| 103 void CopyToHeader(RTPHeader* destination) const; | 103 void CopyToHeader(RTPHeader* destination) const; |
| 104 | 104 |
| 105 RTPHeader header_; | 105 RTPHeader header_; |
| 106 rtc::scoped_ptr<uint8_t[]> payload_memory_; | 106 std::unique_ptr<uint8_t[]> payload_memory_; |
| 107 const uint8_t* payload_; // First byte after header. | 107 const uint8_t* payload_; // First byte after header. |
| 108 const size_t packet_length_bytes_; // Total length of packet. | 108 const size_t packet_length_bytes_; // Total length of packet. |
| 109 size_t payload_length_bytes_; // Length of the payload, after RTP header. | 109 size_t payload_length_bytes_; // Length of the payload, after RTP header. |
| 110 // Zero for dummy RTP packets. | 110 // Zero for dummy RTP packets. |
| 111 // Virtual lengths are used when parsing RTP header files (dummy RTP files). | 111 // Virtual lengths are used when parsing RTP header files (dummy RTP files). |
| 112 const size_t virtual_packet_length_bytes_; | 112 const size_t virtual_packet_length_bytes_; |
| 113 size_t virtual_payload_length_bytes_; | 113 size_t virtual_payload_length_bytes_; |
| 114 double time_ms_; // Used to denote a packet's arrival time. | 114 double time_ms_; // Used to denote a packet's arrival time. |
| 115 bool valid_header_; // Set by the RtpHeaderParser. | 115 bool valid_header_; // Set by the RtpHeaderParser. |
| 116 | 116 |
| 117 RTC_DISALLOW_COPY_AND_ASSIGN(Packet); | 117 RTC_DISALLOW_COPY_AND_ASSIGN(Packet); |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 } // namespace test | 120 } // namespace test |
| 121 } // namespace webrtc | 121 } // namespace webrtc |
| 122 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_PACKET_H_ | 122 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_PACKET_H_ |
| OLD | NEW |