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

Side by Side Diff: webrtc/video/vie_remb.cc

Issue 1855433002: Replace NULL with nullptr in webrtc/video. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: replace x == nullptr with !x Created 4 years, 8 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
« no previous file with comments | « webrtc/video/vie_receiver.cc ('k') | webrtc/video/vie_sync_module.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 } 85 }
86 } 86 }
87 87
88 bool VieRemb::InUse() const { 88 bool VieRemb::InUse() const {
89 rtc::CritScope lock(&list_crit_); 89 rtc::CritScope lock(&list_crit_);
90 return !receive_modules_.empty() || !rtcp_sender_.empty(); 90 return !receive_modules_.empty() || !rtcp_sender_.empty();
91 } 91 }
92 92
93 void VieRemb::OnReceiveBitrateChanged(const std::vector<uint32_t>& ssrcs, 93 void VieRemb::OnReceiveBitrateChanged(const std::vector<uint32_t>& ssrcs,
94 uint32_t bitrate) { 94 uint32_t bitrate) {
95 RtpRtcp* sender = NULL; 95 RtpRtcp* sender = nullptr;
96 { 96 {
97 rtc::CritScope lock(&list_crit_); 97 rtc::CritScope lock(&list_crit_);
98 // If we already have an estimate, check if the new total estimate is below 98 // If we already have an estimate, check if the new total estimate is below
99 // kSendThresholdPercent of the previous estimate. 99 // kSendThresholdPercent of the previous estimate.
100 if (last_send_bitrate_ > 0) { 100 if (last_send_bitrate_ > 0) {
101 uint32_t new_remb_bitrate = last_send_bitrate_ - bitrate_ + bitrate; 101 uint32_t new_remb_bitrate = last_send_bitrate_ - bitrate_ + bitrate;
102 102
103 if (new_remb_bitrate < kSendThresholdPercent * last_send_bitrate_ / 100) { 103 if (new_remb_bitrate < kSendThresholdPercent * last_send_bitrate_ / 100) {
104 // The new bitrate estimate is less than kSendThresholdPercent % of the 104 // The new bitrate estimate is less than kSendThresholdPercent % of the
105 // last report. Send a REMB asap. 105 // last report. Send a REMB asap.
(...skipping 22 matching lines...) Expand all
128 } 128 }
129 last_send_bitrate_ = bitrate_; 129 last_send_bitrate_ = bitrate_;
130 } 130 }
131 131
132 if (sender) { 132 if (sender) {
133 sender->SetREMBData(bitrate_, ssrcs); 133 sender->SetREMBData(bitrate_, ssrcs);
134 } 134 }
135 } 135 }
136 136
137 } // namespace webrtc 137 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/vie_receiver.cc ('k') | webrtc/video/vie_sync_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698