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_SPARSE( | 71 RTC_HISTOGRAM_PERCENTAGE( |
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_SPARSE( | 76 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.RecoveredMediaPacketsInPercentOfFec", |
77 "WebRTC.Video.RecoveredMediaPacketsInPercentOfFec", | 77 static_cast<int>(counter.num_recovered_packets * |
78 static_cast<int>(counter.num_recovered_packets * 100 / | 78 100 / counter.num_fec_packets)); |
79 counter.num_fec_packets)); | |
80 } | 79 } |
81 } | 80 } |
82 | 81 |
83 bool ViEReceiver::SetReceiveCodec(const VideoCodec& video_codec) { | 82 bool ViEReceiver::SetReceiveCodec(const VideoCodec& video_codec) { |
84 int8_t old_pltype = -1; | 83 int8_t old_pltype = -1; |
85 if (rtp_payload_registry_->ReceivePayloadType(video_codec.plName, | 84 if (rtp_payload_registry_->ReceivePayloadType(video_codec.plName, |
86 kVideoPayloadTypeFrequency, | 85 kVideoPayloadTypeFrequency, |
87 0, | 86 0, |
88 video_codec.maxBitrate, | 87 video_codec.maxBitrate, |
89 &old_pltype) != -1) { | 88 &old_pltype) != -1) { |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 rtp_receive_statistics_->GetStatistician(header.ssrc); | 473 rtp_receive_statistics_->GetStatistician(header.ssrc); |
475 if (!statistician) | 474 if (!statistician) |
476 return false; | 475 return false; |
477 // Check if this is a retransmission. | 476 // Check if this is a retransmission. |
478 int64_t min_rtt = 0; | 477 int64_t min_rtt = 0; |
479 rtp_rtcp_->RTT(rtp_receiver_->SSRC(), NULL, NULL, &min_rtt, NULL); | 478 rtp_rtcp_->RTT(rtp_receiver_->SSRC(), NULL, NULL, &min_rtt, NULL); |
480 return !in_order && | 479 return !in_order && |
481 statistician->IsRetransmitOfOldPacket(header, min_rtt); | 480 statistician->IsRetransmitOfOldPacket(header, min_rtt); |
482 } | 481 } |
483 } // namespace webrtc | 482 } // namespace webrtc |
OLD | NEW |