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

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

Issue 2372713005: Revert of Unify rtcp packet setters (Closed)
Patch Set: Created 4 years, 2 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
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
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) { 84 bool Dlrr::WithDlrrItem(const ReceiveTimeInfo& block) {
85 if (sub_blocks_.size() >= kMaxNumberOfDlrrItems) { 85 if (sub_blocks_.size() >= kMaxNumberOfDlrrItems) {
86 LOG(LS_WARNING) << "Max DLRR items reached."; 86 LOG(LS_WARNING) << "Max DLRR items reached.";
87 return false; 87 return false;
88 } 88 }
89 sub_blocks_.push_back(block); 89 sub_blocks_.push_back(block);
90 return true; 90 return true;
91 } 91 }
92 92
93 bool Dlrr::AddDlrrItem(uint32_t ssrc, 93 bool Dlrr::WithDlrrItem(uint32_t ssrc,
94 uint32_t last_rr, 94 uint32_t last_rr,
95 uint32_t delay_last_rr) { 95 uint32_t delay_last_rr) {
96 ReceiveTimeInfo block; 96 ReceiveTimeInfo block;
97 block.ssrc = ssrc; 97 block.ssrc = ssrc;
98 block.last_rr = last_rr; 98 block.last_rr = last_rr;
99 block.delay_since_last_rr = delay_last_rr; 99 block.delay_since_last_rr = delay_last_rr;
100 return AddDlrrItem(block); 100 return WithDlrrItem(block);
101 } 101 }
102 } // namespace rtcp 102 } // namespace rtcp
103 } // namespace webrtc 103 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_packet/dlrr.h ('k') | webrtc/modules/rtp_rtcp/source/rtcp_packet/dlrr_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698