OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 bool cpu_restricted_resolution) { | 692 bool cpu_restricted_resolution) { |
693 rtc::CritScope lock(&crit_); | 693 rtc::CritScope lock(&crit_); |
694 stats_.cpu_limited_resolution = cpu_restricted_resolution; | 694 stats_.cpu_limited_resolution = cpu_restricted_resolution; |
695 ++stats_.number_of_cpu_adapt_changes; | 695 ++stats_.number_of_cpu_adapt_changes; |
696 TRACE_EVENT_INSTANT0("webrtc_stats", "WebRTC.Video.AdaptationChanges"); | 696 TRACE_EVENT_INSTANT0("webrtc_stats", "WebRTC.Video.AdaptationChanges"); |
697 } | 697 } |
698 | 698 |
699 void SendStatisticsProxy::OnQualityRestrictedResolutionChanged( | 699 void SendStatisticsProxy::OnQualityRestrictedResolutionChanged( |
700 int num_quality_downscales) { | 700 int num_quality_downscales) { |
701 rtc::CritScope lock(&crit_); | 701 rtc::CritScope lock(&crit_); |
| 702 ++stats_.number_of_quality_adapt_changes; |
702 quality_downscales_ = num_quality_downscales; | 703 quality_downscales_ = num_quality_downscales; |
703 stats_.bw_limited_resolution = quality_downscales_ > 0; | 704 stats_.bw_limited_resolution = quality_downscales_ > 0; |
704 } | 705 } |
705 | 706 |
706 void SendStatisticsProxy::RtcpPacketTypesCounterUpdated( | 707 void SendStatisticsProxy::RtcpPacketTypesCounterUpdated( |
707 uint32_t ssrc, | 708 uint32_t ssrc, |
708 const RtcpPacketTypeCounter& packet_counter) { | 709 const RtcpPacketTypeCounter& packet_counter) { |
709 rtc::CritScope lock(&crit_); | 710 rtc::CritScope lock(&crit_); |
710 VideoSendStream::StreamStats* stats = GetStatsEntry(ssrc); | 711 VideoSendStream::StreamStats* stats = GetStatsEntry(ssrc); |
711 if (!stats) | 712 if (!stats) |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 } | 845 } |
845 | 846 |
846 int SendStatisticsProxy::BoolSampleCounter::Fraction( | 847 int SendStatisticsProxy::BoolSampleCounter::Fraction( |
847 int64_t min_required_samples, | 848 int64_t min_required_samples, |
848 float multiplier) const { | 849 float multiplier) const { |
849 if (num_samples < min_required_samples || num_samples == 0) | 850 if (num_samples < min_required_samples || num_samples == 0) |
850 return -1; | 851 return -1; |
851 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); | 852 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); |
852 } | 853 } |
853 } // namespace webrtc | 854 } // namespace webrtc |
OLD | NEW |