Chromium Code Reviews| 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 |
| 11 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sender_report.h" | 11 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sender_report.h" |
| 12 | 12 |
| 13 #include <utility> | |
| 14 | |
| 13 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" | 15 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" |
| 14 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/common_header.h" | 16 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/common_header.h" |
| 15 #include "webrtc/rtc_base/checks.h" | 17 #include "webrtc/rtc_base/checks.h" |
| 16 #include "webrtc/rtc_base/logging.h" | 18 #include "webrtc/rtc_base/logging.h" |
| 17 | 19 |
| 18 namespace webrtc { | 20 namespace webrtc { |
| 19 namespace rtcp { | 21 namespace rtcp { |
| 20 constexpr uint8_t SenderReport::kPacketType; | 22 constexpr uint8_t SenderReport::kPacketType; |
| 21 // Sender report (SR) (RFC 3550). | 23 // Sender report (SR) (RFC 3550). |
| 22 // 0 1 2 3 | 24 // 0 1 2 3 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 115 | 117 |
| 116 bool SenderReport::AddReportBlock(const ReportBlock& block) { | 118 bool SenderReport::AddReportBlock(const ReportBlock& block) { |
| 117 if (report_blocks_.size() >= kMaxNumberOfReportBlocks) { | 119 if (report_blocks_.size() >= kMaxNumberOfReportBlocks) { |
| 118 LOG(LS_WARNING) << "Max report blocks reached."; | 120 LOG(LS_WARNING) << "Max report blocks reached."; |
| 119 return false; | 121 return false; |
| 120 } | 122 } |
| 121 report_blocks_.push_back(block); | 123 report_blocks_.push_back(block); |
| 122 return true; | 124 return true; |
| 123 } | 125 } |
| 124 | 126 |
| 127 bool SenderReport::SetReportBlocks(std::vector<ReportBlock> blocks) { | |
|
eladalon
2017/07/21 12:53:19
Similar comments for this file and the next one as
danilchap
2017/07/21 17:11:14
Done.
| |
| 128 if (blocks.size() > kMaxNumberOfReportBlocks) { | |
| 129 LOG(LS_WARNING) << "Max report blocks reached."; | |
| 130 return false; | |
| 131 } | |
| 132 report_blocks_ = std::move(blocks); | |
| 133 return true; | |
| 134 } | |
| 135 | |
| 125 } // namespace rtcp | 136 } // namespace rtcp |
| 126 } // namespace webrtc | 137 } // namespace webrtc |
| OLD | NEW |