| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 assert(remote_bitrate_estimator); | 62 assert(remote_bitrate_estimator); |
| 63 } | 63 } |
| 64 | 64 |
| 65 ViEReceiver::~ViEReceiver() { | 65 ViEReceiver::~ViEReceiver() { |
| 66 UpdateHistograms(); | 66 UpdateHistograms(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void ViEReceiver::UpdateHistograms() { | 69 void ViEReceiver::UpdateHistograms() { |
| 70 FecPacketCounter counter = fec_receiver_->GetPacketCounter(); | 70 FecPacketCounter counter = fec_receiver_->GetPacketCounter(); |
| 71 if (counter.num_packets > 0) { | 71 if (counter.num_packets > 0) { |
| 72 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.ReceivedFecPacketsInPercent", | 72 RTC_HISTOGRAM_PERCENTAGE( |
| 73 counter.num_fec_packets * 100 / counter.num_packets); | 73 "WebRTC.Video.ReceivedFecPacketsInPercent", |
| 74 static_cast<int>(counter.num_fec_packets * 100 / counter.num_packets)); |
| 74 } | 75 } |
| 75 if (counter.num_fec_packets > 0) { | 76 if (counter.num_fec_packets > 0) { |
| 76 RTC_HISTOGRAM_PERCENTAGE( | 77 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.RecoveredMediaPacketsInPercentOfFec", |
| 77 "WebRTC.Video.RecoveredMediaPacketsInPercentOfFec", | 78 static_cast<int>(counter.num_recovered_packets * |
| 78 counter.num_recovered_packets * 100 / counter.num_fec_packets); | 79 100 / 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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 rtp_receive_statistics_->GetStatistician(header.ssrc); | 460 rtp_receive_statistics_->GetStatistician(header.ssrc); |
| 460 if (!statistician) | 461 if (!statistician) |
| 461 return false; | 462 return false; |
| 462 // Check if this is a retransmission. | 463 // Check if this is a retransmission. |
| 463 int64_t min_rtt = 0; | 464 int64_t min_rtt = 0; |
| 464 rtp_rtcp_->RTT(rtp_receiver_->SSRC(), NULL, NULL, &min_rtt, NULL); | 465 rtp_rtcp_->RTT(rtp_receiver_->SSRC(), NULL, NULL, &min_rtt, NULL); |
| 465 return !in_order && | 466 return !in_order && |
| 466 statistician->IsRetransmitOfOldPacket(header, min_rtt); | 467 statistician->IsRetransmitOfOldPacket(header, min_rtt); |
| 467 } | 468 } |
| 468 } // namespace webrtc | 469 } // namespace webrtc |
| OLD | NEW |