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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 } | 310 } |
311 | 311 |
312 uint32_t TransportFeedback::GetMediaSourceSsrc() const { | 312 uint32_t TransportFeedback::GetMediaSourceSsrc() const { |
313 return media_source_ssrc_; | 313 return media_source_ssrc_; |
314 } | 314 } |
315 void TransportFeedback::WithBase(uint16_t base_sequence, | 315 void TransportFeedback::WithBase(uint16_t base_sequence, |
316 int64_t ref_timestamp_us) { | 316 int64_t ref_timestamp_us) { |
317 RTC_DCHECK_EQ(-1, base_seq_); | 317 RTC_DCHECK_EQ(-1, base_seq_); |
318 RTC_DCHECK_NE(-1, ref_timestamp_us); | 318 RTC_DCHECK_NE(-1, ref_timestamp_us); |
319 base_seq_ = base_sequence; | 319 base_seq_ = base_sequence; |
320 last_seq_ = base_sequence; | 320 // last_seq_ is the sequence number of the last packed added _before_ a call |
| 321 // to WithReceivedPacket(). Since the first sequence to be added is |
| 322 // base_sequence, we need this to be one lower in order for potential missing |
| 323 // packets to be populated properly. |
| 324 last_seq_ = base_sequence - 1; |
321 base_time_ = ref_timestamp_us / kBaseScaleFactor; | 325 base_time_ = ref_timestamp_us / kBaseScaleFactor; |
322 last_timestamp_ = base_time_ * kBaseScaleFactor; | 326 last_timestamp_ = base_time_ * kBaseScaleFactor; |
323 } | 327 } |
324 | 328 |
325 void TransportFeedback::WithFeedbackSequenceNumber(uint8_t feedback_sequence) { | 329 void TransportFeedback::WithFeedbackSequenceNumber(uint8_t feedback_sequence) { |
326 feedback_seq_ = feedback_sequence; | 330 feedback_seq_ = feedback_sequence; |
327 } | 331 } |
328 | 332 |
329 bool TransportFeedback::WithReceivedPacket(uint16_t sequence_number, | 333 bool TransportFeedback::WithReceivedPacket(uint16_t sequence_number, |
330 int64_t timestamp) { | 334 int64_t timestamp) { |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 "RLE block of size " << rle_chunk->NumSymbols() | 771 "RLE block of size " << rle_chunk->NumSymbols() |
768 << " but only " << max_size << " left to read."; | 772 << " but only " << max_size << " left to read."; |
769 delete rle_chunk; | 773 delete rle_chunk; |
770 return nullptr; | 774 return nullptr; |
771 } | 775 } |
772 return rle_chunk; | 776 return rle_chunk; |
773 } | 777 } |
774 | 778 |
775 } // namespace rtcp | 779 } // namespace rtcp |
776 } // namespace webrtc | 780 } // namespace webrtc |
OLD | NEW |