| 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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 } | 519 } |
| 520 | 520 |
| 521 size_t TransportFeedback::BlockLength() const { | 521 size_t TransportFeedback::BlockLength() const { |
| 522 return size_bytes_; | 522 return size_bytes_; |
| 523 } | 523 } |
| 524 | 524 |
| 525 uint16_t TransportFeedback::GetBaseSequence() const { | 525 uint16_t TransportFeedback::GetBaseSequence() const { |
| 526 return base_seq_; | 526 return base_seq_; |
| 527 } | 527 } |
| 528 | 528 |
| 529 int32_t TransportFeedback::GetBaseTime() const { | |
| 530 return static_cast<int32_t>(base_time_ & 0x00FFFFFF); | |
| 531 } | |
| 532 | |
| 533 int64_t TransportFeedback::GetBaseTimeUs() const { | 529 int64_t TransportFeedback::GetBaseTimeUs() const { |
| 534 return GetBaseTime() * kBaseScaleFactor; | 530 return base_time_ * kBaseScaleFactor; |
| 535 } | 531 } |
| 536 | 532 |
| 537 std::vector<TransportFeedback::StatusSymbol> | 533 std::vector<TransportFeedback::StatusSymbol> |
| 538 TransportFeedback::GetStatusVector() const { | 534 TransportFeedback::GetStatusVector() const { |
| 539 std::vector<TransportFeedback::StatusSymbol> symbols; | 535 std::vector<TransportFeedback::StatusSymbol> symbols; |
| 540 for (PacketStatusChunk* chunk : status_chunks_) | 536 for (PacketStatusChunk* chunk : status_chunks_) |
| 541 chunk->AppendSymbolsTo(&symbols); | 537 chunk->AppendSymbolsTo(&symbols); |
| 542 int64_t status_count = last_seq_ - base_seq_ + 1; | 538 int64_t status_count = last_seq_ - base_seq_ + 1; |
| 543 // If packet ends with a vector chunk, it may contain extraneous "packet not | 539 // If packet ends with a vector chunk, it may contain extraneous "packet not |
| 544 // received"-symbols at the end. Crop any such symbols. | 540 // received"-symbols at the end. Crop any such symbols. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 DCHECK_LE(base_seq_, 0xFFFF); | 580 DCHECK_LE(base_seq_, 0xFFFF); |
| 585 ByteWriter<uint16_t>::WriteBigEndian(&packet[*position], base_seq_); | 581 ByteWriter<uint16_t>::WriteBigEndian(&packet[*position], base_seq_); |
| 586 *position += 2; | 582 *position += 2; |
| 587 | 583 |
| 588 int64_t status_count = last_seq_ - base_seq_ + 1; | 584 int64_t status_count = last_seq_ - base_seq_ + 1; |
| 589 DCHECK_LE(status_count, 0xFFFF); | 585 DCHECK_LE(status_count, 0xFFFF); |
| 590 ByteWriter<uint16_t>::WriteBigEndian(&packet[*position], status_count); | 586 ByteWriter<uint16_t>::WriteBigEndian(&packet[*position], status_count); |
| 591 *position += 2; | 587 *position += 2; |
| 592 | 588 |
| 593 ByteWriter<int32_t, 3>::WriteBigEndian(&packet[*position], | 589 ByteWriter<int32_t, 3>::WriteBigEndian(&packet[*position], |
| 594 static_cast<int16_t>(base_time_)); | 590 static_cast<int32_t>(base_time_)); |
| 595 *position += 3; | 591 *position += 3; |
| 596 | 592 |
| 597 packet[(*position)++] = feedback_seq_; | 593 packet[(*position)++] = feedback_seq_; |
| 598 | 594 |
| 599 // TODO(sprang): Get rid of this cast. | 595 // TODO(sprang): Get rid of this cast. |
| 600 const_cast<TransportFeedback*>(this)->EmitRemaining(); | 596 const_cast<TransportFeedback*>(this)->EmitRemaining(); |
| 601 for (PacketStatusChunk* chunk : status_chunks_) { | 597 for (PacketStatusChunk* chunk : status_chunks_) { |
| 602 chunk->WriteTo(&packet[*position]); | 598 chunk->WriteTo(&packet[*position]); |
| 603 *position += 2; | 599 *position += 2; |
| 604 } | 600 } |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 "RLE block of size " << rle_chunk->NumSymbols() | 789 "RLE block of size " << rle_chunk->NumSymbols() |
| 794 << " but only " << max_size << " left to read."; | 790 << " but only " << max_size << " left to read."; |
| 795 delete rle_chunk; | 791 delete rle_chunk; |
| 796 return nullptr; | 792 return nullptr; |
| 797 } | 793 } |
| 798 return rle_chunk; | 794 return rle_chunk; |
| 799 } | 795 } |
| 800 | 796 |
| 801 } // namespace rtcp | 797 } // namespace rtcp |
| 802 } // namespace webrtc | 798 } // namespace webrtc |
| OLD | NEW |