Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_packet/receiver_report.cc

Issue 2979413002: Refactor composing report blocks for rtcp Sender/Receiver reports (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
11 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/receiver_report.h" 11 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/receiver_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 ReceiverReport::kPacketType; 22 constexpr uint8_t ReceiverReport::kPacketType;
21 // RTCP receiver report (RFC 3550). 23 // RTCP receiver report (RFC 3550).
22 // 24 //
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 88
87 bool ReceiverReport::AddReportBlock(const ReportBlock& block) { 89 bool ReceiverReport::AddReportBlock(const ReportBlock& block) {
88 if (report_blocks_.size() >= kMaxNumberOfReportBlocks) { 90 if (report_blocks_.size() >= kMaxNumberOfReportBlocks) {
89 LOG(LS_WARNING) << "Max report blocks reached."; 91 LOG(LS_WARNING) << "Max report blocks reached.";
90 return false; 92 return false;
91 } 93 }
92 report_blocks_.push_back(block); 94 report_blocks_.push_back(block);
93 return true; 95 return true;
94 } 96 }
95 97
98 bool ReceiverReport::SetReportBlocks(std::vector<ReportBlock> blocks) {
eladalon 2017/07/21 12:53:19 Not sure about this - what do you think of accepti
danilchap 2017/07/21 17:11:13 that is banned by style guide. https://google.gith
99 if (blocks.size() > kMaxNumberOfReportBlocks) {
100 LOG(LS_WARNING) << "Max report blocks reached.";
eladalon 2017/07/21 12:53:19 Maybe log blocks.size()
danilchap 2017/07/21 17:11:13 Done.
101 return false;
102 }
103 report_blocks_ = std::move(blocks);
104 return true;
105 }
106
96 } // namespace rtcp 107 } // namespace rtcp
97 } // namespace webrtc 108 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698