OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |