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

Side by Side Diff: webrtc/video/receive_statistics_proxy.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/payload_router_unittest.cc ('k') | webrtc/video/replay.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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 } 265 }
266 266
267 void ReceiveStatisticsProxy::OnDiscardedPacketsUpdated(int discarded_packets) { 267 void ReceiveStatisticsProxy::OnDiscardedPacketsUpdated(int discarded_packets) {
268 rtc::CritScope lock(&crit_); 268 rtc::CritScope lock(&crit_);
269 stats_.discarded_packets = discarded_packets; 269 stats_.discarded_packets = discarded_packets;
270 } 270 }
271 271
272 void ReceiveStatisticsProxy::OnPreDecode( 272 void ReceiveStatisticsProxy::OnPreDecode(
273 const EncodedImage& encoded_image, 273 const EncodedImage& encoded_image,
274 const CodecSpecificInfo* codec_specific_info) { 274 const CodecSpecificInfo* codec_specific_info) {
275 if (codec_specific_info == nullptr || encoded_image.qp_ == -1) { 275 if (!codec_specific_info || encoded_image.qp_ == -1) {
276 return; 276 return;
277 } 277 }
278 if (codec_specific_info->codecType == kVideoCodecVP8) { 278 if (codec_specific_info->codecType == kVideoCodecVP8) {
279 qp_counters_.vp8.Add(encoded_image.qp_); 279 qp_counters_.vp8.Add(encoded_image.qp_);
280 } 280 }
281 } 281 }
282 282
283 void ReceiveStatisticsProxy::SampleCounter::Add(int sample) { 283 void ReceiveStatisticsProxy::SampleCounter::Add(int sample) {
284 sum += sample; 284 sum += sample;
285 ++num_samples; 285 ++num_samples;
286 } 286 }
287 287
288 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { 288 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const {
289 if (num_samples < min_required_samples || num_samples == 0) 289 if (num_samples < min_required_samples || num_samples == 0)
290 return -1; 290 return -1;
291 return sum / num_samples; 291 return sum / num_samples;
292 } 292 }
293 293
294 } // namespace webrtc 294 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/payload_router_unittest.cc ('k') | webrtc/video/replay.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698