| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 0x80 | static_cast<uint8_t>(picture_id_ >> (i * kPidBits)); | 123 0x80 | static_cast<uint8_t>(picture_id_ >> (i * kPidBits)); |
| 124 } | 124 } |
| 125 packet[(*index)++] = static_cast<uint8_t>(picture_id_ & 0x7f); | 125 packet[(*index)++] = static_cast<uint8_t>(picture_id_ & 0x7f); |
| 126 constexpr uint8_t kPadding = 0; | 126 constexpr uint8_t kPadding = 0; |
| 127 for (size_t i = 0; i < padding_bytes; ++i) | 127 for (size_t i = 0; i < padding_bytes; ++i) |
| 128 packet[(*index)++] = kPadding; | 128 packet[(*index)++] = kPadding; |
| 129 RTC_CHECK_EQ(*index, index_end); | 129 RTC_CHECK_EQ(*index, index_end); |
| 130 return true; | 130 return true; |
| 131 } | 131 } |
| 132 | 132 |
| 133 void Rpsi::SetPayloadType(uint8_t payload) { | 133 void Rpsi::WithPayloadType(uint8_t payload) { |
| 134 RTC_DCHECK_LE(payload, 0x7f); | 134 RTC_DCHECK_LE(payload, 0x7f); |
| 135 payload_type_ = payload; | 135 payload_type_ = payload; |
| 136 } | 136 } |
| 137 | 137 |
| 138 void Rpsi::SetPictureId(uint64_t picture_id) { | 138 void Rpsi::WithPictureId(uint64_t picture_id) { |
| 139 picture_id_ = picture_id; | 139 picture_id_ = picture_id; |
| 140 block_length_ = CalculateBlockLength(RequiredBytes(picture_id_)); | 140 block_length_ = CalculateBlockLength(RequiredBytes(picture_id_)); |
| 141 } | 141 } |
| 142 | 142 |
| 143 size_t Rpsi::CalculateBlockLength(uint8_t bitstring_size_bytes) { | 143 size_t Rpsi::CalculateBlockLength(uint8_t bitstring_size_bytes) { |
| 144 return RtcpPacket::kHeaderLength + Psfb::kCommonFeedbackLength + | 144 return RtcpPacket::kHeaderLength + Psfb::kCommonFeedbackLength + |
| 145 Word32Align(2 + bitstring_size_bytes); | 145 Word32Align(2 + bitstring_size_bytes); |
| 146 } | 146 } |
| 147 } // namespace rtcp | 147 } // namespace rtcp |
| 148 } // namespace webrtc | 148 } // namespace webrtc |
| OLD | NEW |