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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 size_t max_length, | 77 size_t max_length, |
78 RtcpPacket::PacketReadyCallback* callback) const { | 78 RtcpPacket::PacketReadyCallback* callback) const { |
79 RTC_DCHECK(!items_.empty()); | 79 RTC_DCHECK(!items_.empty()); |
80 while (*index + BlockLength() > max_length) { | 80 while (*index + BlockLength() > max_length) { |
81 if (!OnBufferFull(packet, index, callback)) | 81 if (!OnBufferFull(packet, index, callback)) |
82 return false; | 82 return false; |
83 } | 83 } |
84 size_t index_end = *index + BlockLength(); | 84 size_t index_end = *index + BlockLength(); |
85 CreateHeader(kFeedbackMessageType, kPacketType, HeaderLength(), packet, | 85 CreateHeader(kFeedbackMessageType, kPacketType, HeaderLength(), packet, |
86 index); | 86 index); |
87 RTC_DCHECK_EQ(Psfb::media_ssrc(), 0u); | 87 RTC_DCHECK_EQ(Psfb::media_ssrc(), 0); |
88 CreateCommonFeedback(packet + *index); | 88 CreateCommonFeedback(packet + *index); |
89 *index += kCommonFeedbackLength; | 89 *index += kCommonFeedbackLength; |
90 | 90 |
91 constexpr uint32_t kReserved = 0; | 91 constexpr uint32_t kReserved = 0; |
92 for (const Request& request : items_) { | 92 for (const Request& request : items_) { |
93 ByteWriter<uint32_t>::WriteBigEndian(packet + *index, request.ssrc); | 93 ByteWriter<uint32_t>::WriteBigEndian(packet + *index, request.ssrc); |
94 ByteWriter<uint8_t>::WriteBigEndian(packet + *index + 4, request.seq_nr); | 94 ByteWriter<uint8_t>::WriteBigEndian(packet + *index + 4, request.seq_nr); |
95 ByteWriter<uint32_t, 3>::WriteBigEndian(packet + *index + 5, kReserved); | 95 ByteWriter<uint32_t, 3>::WriteBigEndian(packet + *index + 5, kReserved); |
96 *index += kFciLength; | 96 *index += kFciLength; |
97 } | 97 } |
98 RTC_CHECK_EQ(*index, index_end); | 98 RTC_CHECK_EQ(*index, index_end); |
99 return true; | 99 return true; |
100 } | 100 } |
101 } // namespace rtcp | 101 } // namespace rtcp |
102 } // namespace webrtc | 102 } // namespace webrtc |
OLD | NEW |