| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 * Class for storing RTP packets. | 10 * Class for storing RTP packets. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 // Stores RTP packet. | 39 // Stores RTP packet. |
| 40 int32_t PutRTPPacket(const uint8_t* packet, | 40 int32_t PutRTPPacket(const uint8_t* packet, |
| 41 size_t packet_length, | 41 size_t packet_length, |
| 42 int64_t capture_time_ms, | 42 int64_t capture_time_ms, |
| 43 StorageType type); | 43 StorageType type); |
| 44 | 44 |
| 45 // Gets stored RTP packet corresponding to the input sequence number. | 45 // Gets stored RTP packet corresponding to the input sequence number. |
| 46 // The packet is copied to the buffer pointed to by ptr_rtp_packet. | 46 // The packet is copied to the buffer pointed to by ptr_rtp_packet. |
| 47 // The rtp_packet_length should show the available buffer size. | 47 // The rtp_packet_length should show the available buffer size. |
| 48 // Returns true if packet is found. | 48 // Returns true if packet is found. |
| 49 // rtp_packet_length: returns the copied packet length on success. | 49 // packet_length: returns the copied packet length on success. |
| 50 // min_elapsed_time_ms: the minimum time that must have elapsed since the last | 50 // min_elapsed_time_ms: the minimum time that must have elapsed since the last |
| 51 // time the packet was resent (parameter is ignored if set to zero). | 51 // time the packet was resent (parameter is ignored if set to zero). |
| 52 // If the packet is found but the minimum time has not elaped, no bytes are | 52 // If the packet is found but the minimum time has not elapsed, no bytes are |
| 53 // copied. | 53 // copied. |
| 54 // stored_time_ms: returns the time when the packet was stored. | 54 // stored_time_ms: returns the time when the packet was stored. |
| 55 // type: returns the storage type set in PutRTPPacket. | |
| 56 bool GetPacketAndSetSendTime(uint16_t sequence_number, | 55 bool GetPacketAndSetSendTime(uint16_t sequence_number, |
| 57 int64_t min_elapsed_time_ms, | 56 int64_t min_elapsed_time_ms, |
| 58 bool retransmit, | 57 bool retransmit, |
| 59 uint8_t* packet, | 58 uint8_t* packet, |
| 60 size_t* packet_length, | 59 size_t* packet_length, |
| 61 int64_t* stored_time_ms); | 60 int64_t* stored_time_ms); |
| 62 | 61 |
| 63 bool GetBestFittingPacket(uint8_t* packet, size_t* packet_length, | 62 bool GetBestFittingPacket(uint8_t* packet, size_t* packet_length, |
| 64 int64_t* stored_time_ms); | 63 int64_t* stored_time_ms); |
| 65 | 64 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 87 rtc::scoped_ptr<CriticalSectionWrapper> critsect_; | 86 rtc::scoped_ptr<CriticalSectionWrapper> critsect_; |
| 88 bool store_ GUARDED_BY(critsect_); | 87 bool store_ GUARDED_BY(critsect_); |
| 89 uint32_t prev_index_ GUARDED_BY(critsect_); | 88 uint32_t prev_index_ GUARDED_BY(critsect_); |
| 90 | 89 |
| 91 struct StoredPacket { | 90 struct StoredPacket { |
| 92 StoredPacket(); | 91 StoredPacket(); |
| 93 uint16_t sequence_number = 0; | 92 uint16_t sequence_number = 0; |
| 94 int64_t time_ms = 0; | 93 int64_t time_ms = 0; |
| 95 int64_t send_time = 0; | 94 int64_t send_time = 0; |
| 96 StorageType storage_type = kDontRetransmit; | 95 StorageType storage_type = kDontRetransmit; |
| 96 bool has_been_retransmitted = false; |
| 97 | 97 |
| 98 uint8_t data[IP_PACKET_SIZE]; | 98 uint8_t data[IP_PACKET_SIZE]; |
| 99 size_t length = 0; | 99 size_t length = 0; |
| 100 }; | 100 }; |
| 101 std::vector<StoredPacket> stored_packets_ GUARDED_BY(critsect_); | 101 std::vector<StoredPacket> stored_packets_ GUARDED_BY(critsect_); |
| 102 }; | 102 }; |
| 103 } // namespace webrtc | 103 } // namespace webrtc |
| 104 #endif // WEBRTC_MODULES_RTP_RTCP_RTP_PACKET_HISTORY_H_ | 104 #endif // WEBRTC_MODULES_RTP_RTCP_RTP_PACKET_HISTORY_H_ |
| OLD | NEW |