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

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

Issue 1530913002: Rename RTC_HISTOGRAM_* macros to RTC_HISTOGRAM_*_SPARSE_* to indicate that these are for infrequent (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 | « webrtc/video/vie_channel.cc ('k') | no next file » | 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 assert(remote_bitrate_estimator); 61 assert(remote_bitrate_estimator);
62 } 62 }
63 63
64 ViEReceiver::~ViEReceiver() { 64 ViEReceiver::~ViEReceiver() {
65 UpdateHistograms(); 65 UpdateHistograms();
66 } 66 }
67 67
68 void ViEReceiver::UpdateHistograms() { 68 void ViEReceiver::UpdateHistograms() {
69 FecPacketCounter counter = fec_receiver_->GetPacketCounter(); 69 FecPacketCounter counter = fec_receiver_->GetPacketCounter();
70 if (counter.num_packets > 0) { 70 if (counter.num_packets > 0) {
71 RTC_HISTOGRAM_PERCENTAGE( 71 RTC_HISTOGRAM_PERCENTAGE_SPARSE(
72 "WebRTC.Video.ReceivedFecPacketsInPercent", 72 "WebRTC.Video.ReceivedFecPacketsInPercent",
73 static_cast<int>(counter.num_fec_packets * 100 / counter.num_packets)); 73 static_cast<int>(counter.num_fec_packets * 100 / counter.num_packets));
74 } 74 }
75 if (counter.num_fec_packets > 0) { 75 if (counter.num_fec_packets > 0) {
76 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.RecoveredMediaPacketsInPercentOfFec", 76 RTC_HISTOGRAM_PERCENTAGE_SPARSE(
77 static_cast<int>(counter.num_recovered_packets * 77 "WebRTC.Video.RecoveredMediaPacketsInPercentOfFec",
78 100 / counter.num_fec_packets)); 78 static_cast<int>(counter.num_recovered_packets * 100 /
79 counter.num_fec_packets));
79 } 80 }
80 } 81 }
81 82
82 bool ViEReceiver::SetReceiveCodec(const VideoCodec& video_codec) { 83 bool ViEReceiver::SetReceiveCodec(const VideoCodec& video_codec) {
83 int8_t old_pltype = -1; 84 int8_t old_pltype = -1;
84 if (rtp_payload_registry_->ReceivePayloadType(video_codec.plName, 85 if (rtp_payload_registry_->ReceivePayloadType(video_codec.plName,
85 kVideoPayloadTypeFrequency, 86 kVideoPayloadTypeFrequency,
86 0, 87 0,
87 video_codec.maxBitrate, 88 video_codec.maxBitrate,
88 &old_pltype) != -1) { 89 &old_pltype) != -1) {
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 rtp_receive_statistics_->GetStatistician(header.ssrc); 474 rtp_receive_statistics_->GetStatistician(header.ssrc);
474 if (!statistician) 475 if (!statistician)
475 return false; 476 return false;
476 // Check if this is a retransmission. 477 // Check if this is a retransmission.
477 int64_t min_rtt = 0; 478 int64_t min_rtt = 0;
478 rtp_rtcp_->RTT(rtp_receiver_->SSRC(), NULL, NULL, &min_rtt, NULL); 479 rtp_rtcp_->RTT(rtp_receiver_->SSRC(), NULL, NULL, &min_rtt, NULL);
479 return !in_order && 480 return !in_order &&
480 statistician->IsRetransmitOfOldPacket(header, min_rtt); 481 statistician->IsRetransmitOfOldPacket(header, min_rtt);
481 } 482 }
482 } // namespace webrtc 483 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/vie_channel.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698