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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 case 1: | 65 case 1: |
66 return TransportFeedback::StatusSymbol::kReceivedSmallDelta; | 66 return TransportFeedback::StatusSymbol::kReceivedSmallDelta; |
67 case 2: | 67 case 2: |
68 return TransportFeedback::StatusSymbol::kReceivedLargeDelta; | 68 return TransportFeedback::StatusSymbol::kReceivedLargeDelta; |
69 default: | 69 default: |
70 RTC_NOTREACHED(); | 70 RTC_NOTREACHED(); |
71 return TransportFeedback::StatusSymbol::kNotReceived; | 71 return TransportFeedback::StatusSymbol::kNotReceived; |
72 } | 72 } |
73 } | 73 } |
74 | 74 |
75 | |
stefan-webrtc
2016/07/05 09:20:23
Remove this empty line
sprang_webrtc
2016/07/05 09:45:07
Done.
| |
75 TransportFeedback::TransportFeedback() | 76 TransportFeedback::TransportFeedback() |
76 : packet_sender_ssrc_(0), | 77 : packet_sender_ssrc_(0), |
77 media_source_ssrc_(0), | 78 media_source_ssrc_(0), |
78 base_seq_(-1), | 79 base_seq_(-1), |
79 base_time_(-1), | 80 base_time_(-1), |
80 feedback_seq_(0), | 81 feedback_seq_(0), |
81 last_seq_(-1), | 82 last_seq_(-1), |
82 last_timestamp_(-1), | 83 last_timestamp_(-1), |
83 first_symbol_cardinality_(0), | 84 first_symbol_cardinality_(0), |
84 vec_needs_two_bit_symbols_(false), | 85 vec_needs_two_bit_symbols_(false), |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
310 } | 311 } |
311 | 312 |
312 uint32_t TransportFeedback::GetMediaSourceSsrc() const { | 313 uint32_t TransportFeedback::GetMediaSourceSsrc() const { |
313 return media_source_ssrc_; | 314 return media_source_ssrc_; |
314 } | 315 } |
315 void TransportFeedback::WithBase(uint16_t base_sequence, | 316 void TransportFeedback::WithBase(uint16_t base_sequence, |
316 int64_t ref_timestamp_us) { | 317 int64_t ref_timestamp_us) { |
317 RTC_DCHECK_EQ(-1, base_seq_); | 318 RTC_DCHECK_EQ(-1, base_seq_); |
318 RTC_DCHECK_NE(-1, ref_timestamp_us); | 319 RTC_DCHECK_NE(-1, ref_timestamp_us); |
319 base_seq_ = base_sequence; | 320 base_seq_ = base_sequence; |
320 last_seq_ = base_sequence; | 321 // last_seq_ is the sequence number of the last packed added _before_ a call |
322 // to WithReceivedPacket(). Since the first sequence to be added is | |
323 // base_sequence, we need this to be one lower in order for potential missing | |
324 // packets to be populated properly. | |
325 last_seq_ = base_sequence - 1; | |
321 base_time_ = ref_timestamp_us / kBaseScaleFactor; | 326 base_time_ = ref_timestamp_us / kBaseScaleFactor; |
322 last_timestamp_ = base_time_ * kBaseScaleFactor; | 327 last_timestamp_ = base_time_ * kBaseScaleFactor; |
323 } | 328 } |
324 | 329 |
325 void TransportFeedback::WithFeedbackSequenceNumber(uint8_t feedback_sequence) { | 330 void TransportFeedback::WithFeedbackSequenceNumber(uint8_t feedback_sequence) { |
326 feedback_seq_ = feedback_sequence; | 331 feedback_seq_ = feedback_sequence; |
327 } | 332 } |
328 | 333 |
329 bool TransportFeedback::WithReceivedPacket(uint16_t sequence_number, | 334 bool TransportFeedback::WithReceivedPacket(uint16_t sequence_number, |
330 int64_t timestamp) { | 335 int64_t timestamp) { |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
767 "RLE block of size " << rle_chunk->NumSymbols() | 772 "RLE block of size " << rle_chunk->NumSymbols() |
768 << " but only " << max_size << " left to read."; | 773 << " but only " << max_size << " left to read."; |
769 delete rle_chunk; | 774 delete rle_chunk; |
770 return nullptr; | 775 return nullptr; |
771 } | 776 } |
772 return rle_chunk; | 777 return rle_chunk; |
773 } | 778 } |
774 | 779 |
775 } // namespace rtcp | 780 } // namespace rtcp |
776 } // namespace webrtc | 781 } // namespace webrtc |
OLD | NEW |