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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/receive_statistics_impl.cc

Issue 1538833002: [rtp_rtcp] cleanup in RTCPSender class internals. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years 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 | « no previous file | webrtc/modules/rtp_rtcp/source/rtcp_sender.h » ('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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 } 260 }
261 uint8_t local_fraction_lost = 0; 261 uint8_t local_fraction_lost = 0;
262 if (exp_since_last) { 262 if (exp_since_last) {
263 // Scale 0 to 255, where 255 is 100% loss. 263 // Scale 0 to 255, where 255 is 100% loss.
264 local_fraction_lost = 264 local_fraction_lost =
265 static_cast<uint8_t>(255 * missing / exp_since_last); 265 static_cast<uint8_t>(255 * missing / exp_since_last);
266 } 266 }
267 stats.fraction_lost = local_fraction_lost; 267 stats.fraction_lost = local_fraction_lost;
268 268
269 // We need a counter for cumulative loss too. 269 // We need a counter for cumulative loss too.
270 // TODO(danilchap): Ensure cumulative loss is below maximum value of 2^24.
270 cumulative_loss_ += missing; 271 cumulative_loss_ += missing;
271 stats.cumulative_lost = cumulative_loss_; 272 stats.cumulative_lost = cumulative_loss_;
272 stats.extended_max_sequence_number = 273 stats.extended_max_sequence_number =
273 (received_seq_wraps_ << 16) + received_seq_max_; 274 (received_seq_wraps_ << 16) + received_seq_max_;
274 // Note: internal jitter value is in Q4 and needs to be scaled by 1/16. 275 // Note: internal jitter value is in Q4 and needs to be scaled by 1/16.
275 stats.jitter = jitter_q4_ >> 4; 276 stats.jitter = jitter_q4_ >> 4;
276 277
277 // Store this report. 278 // Store this report.
278 last_reported_statistics_ = stats; 279 last_reported_statistics_ = stats;
279 280
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 540
540 int32_t NullReceiveStatistics::Process() { return 0; } 541 int32_t NullReceiveStatistics::Process() { return 0; }
541 542
542 void NullReceiveStatistics::RegisterRtcpStatisticsCallback( 543 void NullReceiveStatistics::RegisterRtcpStatisticsCallback(
543 RtcpStatisticsCallback* callback) {} 544 RtcpStatisticsCallback* callback) {}
544 545
545 void NullReceiveStatistics::RegisterRtpStatisticsCallback( 546 void NullReceiveStatistics::RegisterRtpStatisticsCallback(
546 StreamDataCountersCallback* callback) {} 547 StreamDataCountersCallback* callback) {}
547 548
548 } // namespace webrtc 549 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtcp_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698