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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 for (const ReceiveTimeInfo& sub_block : sub_blocks_) { | 74 for (const ReceiveTimeInfo& sub_block : sub_blocks_) { |
75 ByteWriter<uint32_t>::WriteBigEndian(&write_at[0], sub_block.ssrc); | 75 ByteWriter<uint32_t>::WriteBigEndian(&write_at[0], sub_block.ssrc); |
76 ByteWriter<uint32_t>::WriteBigEndian(&write_at[4], sub_block.last_rr); | 76 ByteWriter<uint32_t>::WriteBigEndian(&write_at[4], sub_block.last_rr); |
77 ByteWriter<uint32_t>::WriteBigEndian(&write_at[8], | 77 ByteWriter<uint32_t>::WriteBigEndian(&write_at[8], |
78 sub_block.delay_since_last_rr); | 78 sub_block.delay_since_last_rr); |
79 write_at += kSubBlockLength; | 79 write_at += kSubBlockLength; |
80 } | 80 } |
81 RTC_DCHECK_EQ(buffer + BlockLength(), write_at); | 81 RTC_DCHECK_EQ(buffer + BlockLength(), write_at); |
82 } | 82 } |
83 | 83 |
84 bool Dlrr::AddDlrrItem(const ReceiveTimeInfo& block) { | |
85 if (sub_blocks_.size() >= kMaxNumberOfDlrrItems) { | |
86 LOG(LS_WARNING) << "Max DLRR items reached."; | |
87 return false; | |
88 } | |
89 sub_blocks_.push_back(block); | |
90 return true; | |
91 } | |
92 | |
93 bool Dlrr::AddDlrrItem(uint32_t ssrc, | |
94 uint32_t last_rr, | |
95 uint32_t delay_last_rr) { | |
96 ReceiveTimeInfo block; | |
97 block.ssrc = ssrc; | |
98 block.last_rr = last_rr; | |
99 block.delay_since_last_rr = delay_last_rr; | |
100 return AddDlrrItem(block); | |
101 } | |
102 } // namespace rtcp | 84 } // namespace rtcp |
103 } // namespace webrtc | 85 } // namespace webrtc |
OLD | NEW |