OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 TransportFeedback(); | 47 TransportFeedback(); |
48 ~TransportFeedback() override; | 48 ~TransportFeedback() override; |
49 | 49 |
50 void SetBase(uint16_t base_sequence, // Seq# of first packet in this msg. | 50 void SetBase(uint16_t base_sequence, // Seq# of first packet in this msg. |
51 int64_t ref_timestamp_us); // Reference timestamp for this msg. | 51 int64_t ref_timestamp_us); // Reference timestamp for this msg. |
52 void SetFeedbackSequenceNumber(uint8_t feedback_sequence); | 52 void SetFeedbackSequenceNumber(uint8_t feedback_sequence); |
53 // NOTE: This method requires increasing sequence numbers (excepting wraps). | 53 // NOTE: This method requires increasing sequence numbers (excepting wraps). |
54 bool AddReceivedPacket(uint16_t sequence_number, int64_t timestamp_us); | 54 bool AddReceivedPacket(uint16_t sequence_number, int64_t timestamp_us); |
55 const std::vector<ReceivedPacket>& GetReceivedPackets() const; | 55 const std::vector<ReceivedPacket>& GetReceivedPackets() const; |
56 | 56 |
57 enum class StatusSymbol { | 57 uint16_t GetBaseSequence() const; |
58 kNotReceived, | |
59 kReceivedSmallDelta, | |
60 kReceivedLargeDelta, | |
61 }; | |
62 | 58 |
63 uint16_t GetBaseSequence() const; | 59 // Returns number of packets (including missing) this feedback describes. |
64 std::vector<TransportFeedback::StatusSymbol> GetStatusVector() const; | 60 size_t GetPacketStatusCount() const { return num_seq_no_; } |
65 std::vector<int16_t> GetReceiveDeltas() const; | |
66 | 61 |
67 // Get the reference time in microseconds, including any precision loss. | 62 // Get the reference time in microseconds, including any precision loss. |
68 int64_t GetBaseTimeUs() const; | 63 int64_t GetBaseTimeUs() const; |
69 // Convenience method for getting all deltas as microseconds. The first delta | |
70 // is relative the base time. | |
71 std::vector<int64_t> GetReceiveDeltasUs() const; | |
72 | 64 |
73 bool Parse(const CommonHeader& packet); | 65 bool Parse(const CommonHeader& packet); |
74 static std::unique_ptr<TransportFeedback> ParseFrom(const uint8_t* buffer, | 66 static std::unique_ptr<TransportFeedback> ParseFrom(const uint8_t* buffer, |
75 size_t length); | 67 size_t length); |
76 // Pre and postcondition for all public methods. Should always return true. | 68 // Pre and postcondition for all public methods. Should always return true. |
77 // This function is for tests. | 69 // This function is for tests. |
78 bool IsConsistent() const; | 70 bool IsConsistent() const; |
79 | 71 |
80 protected: | 72 protected: |
81 bool Create(uint8_t* packet, | 73 bool Create(uint8_t* packet, |
(...skipping 24 matching lines...) Expand all Loading... |
106 std::vector<ReceivedPacket> packets_; | 98 std::vector<ReceivedPacket> packets_; |
107 // All but last encoded packet chunks. | 99 // All but last encoded packet chunks. |
108 std::vector<uint16_t> encoded_chunks_; | 100 std::vector<uint16_t> encoded_chunks_; |
109 const std::unique_ptr<LastChunk> last_chunk_; | 101 const std::unique_ptr<LastChunk> last_chunk_; |
110 size_t size_bytes_; | 102 size_t size_bytes_; |
111 }; | 103 }; |
112 | 104 |
113 } // namespace rtcp | 105 } // namespace rtcp |
114 } // namespace webrtc | 106 } // namespace webrtc |
115 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_TRANSPORT_FEEDBACK_H_ | 107 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_TRANSPORT_FEEDBACK_H_ |
OLD | NEW |