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 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 return false; | 613 return false; |
614 // Check if this is a retransmission. | 614 // Check if this is a retransmission. |
615 int64_t min_rtt = 0; | 615 int64_t min_rtt = 0; |
616 rtp_rtcp_->RTT(rtp_receiver_->SSRC(), nullptr, nullptr, &min_rtt, nullptr); | 616 rtp_rtcp_->RTT(rtp_receiver_->SSRC(), nullptr, nullptr, &min_rtt, nullptr); |
617 return !in_order && | 617 return !in_order && |
618 statistician->IsRetransmitOfOldPacket(header, min_rtt); | 618 statistician->IsRetransmitOfOldPacket(header, min_rtt); |
619 } | 619 } |
620 | 620 |
621 void RtpStreamReceiver::UpdateHistograms() { | 621 void RtpStreamReceiver::UpdateHistograms() { |
622 FecPacketCounter counter = ulpfec_receiver_->GetPacketCounter(); | 622 FecPacketCounter counter = ulpfec_receiver_->GetPacketCounter(); |
| 623 if (counter.first_packet_time_ms == -1) |
| 624 return; |
| 625 |
| 626 int64_t elapsed_sec = |
| 627 (clock_->TimeInMilliseconds() - counter.first_packet_time_ms) / 1000; |
| 628 if (elapsed_sec < metrics::kMinRunTimeInSeconds) |
| 629 return; |
| 630 |
623 if (counter.num_packets > 0) { | 631 if (counter.num_packets > 0) { |
624 RTC_HISTOGRAM_PERCENTAGE( | 632 RTC_HISTOGRAM_PERCENTAGE( |
625 "WebRTC.Video.ReceivedFecPacketsInPercent", | 633 "WebRTC.Video.ReceivedFecPacketsInPercent", |
626 static_cast<int>(counter.num_fec_packets * 100 / counter.num_packets)); | 634 static_cast<int>(counter.num_fec_packets * 100 / counter.num_packets)); |
627 } | 635 } |
628 if (counter.num_fec_packets > 0) { | 636 if (counter.num_fec_packets > 0) { |
629 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.RecoveredMediaPacketsInPercentOfFec", | 637 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.RecoveredMediaPacketsInPercentOfFec", |
630 static_cast<int>(counter.num_recovered_packets * | 638 static_cast<int>(counter.num_recovered_packets * |
631 100 / counter.num_fec_packets)); | 639 100 / counter.num_fec_packets)); |
632 } | 640 } |
633 } | 641 } |
634 | 642 |
635 void RtpStreamReceiver::EnableReceiveRtpHeaderExtension( | 643 void RtpStreamReceiver::EnableReceiveRtpHeaderExtension( |
636 const std::string& extension, int id) { | 644 const std::string& extension, int id) { |
637 // One-byte-extension local identifiers are in the range 1-14 inclusive. | 645 // One-byte-extension local identifiers are in the range 1-14 inclusive. |
638 RTC_DCHECK_GE(id, 1); | 646 RTC_DCHECK_GE(id, 1); |
639 RTC_DCHECK_LE(id, 14); | 647 RTC_DCHECK_LE(id, 14); |
640 RTC_DCHECK(RtpExtension::IsSupportedForVideo(extension)); | 648 RTC_DCHECK(RtpExtension::IsSupportedForVideo(extension)); |
641 RTC_CHECK(rtp_header_parser_->RegisterRtpHeaderExtension( | 649 RTC_CHECK(rtp_header_parser_->RegisterRtpHeaderExtension( |
642 StringToRtpExtensionType(extension), id)); | 650 StringToRtpExtensionType(extension), id)); |
643 } | 651 } |
644 | 652 |
645 } // namespace webrtc | 653 } // namespace webrtc |
OLD | NEW |