| 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 19 matching lines...) Expand all Loading... |
| 30 stats_.ssrc = ssrc; | 30 stats_.ssrc = ssrc; |
| 31 } | 31 } |
| 32 | 32 |
| 33 ReceiveStatisticsProxy::~ReceiveStatisticsProxy() { | 33 ReceiveStatisticsProxy::~ReceiveStatisticsProxy() { |
| 34 UpdateHistograms(); | 34 UpdateHistograms(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 void ReceiveStatisticsProxy::UpdateHistograms() { | 37 void ReceiveStatisticsProxy::UpdateHistograms() { |
| 38 int fraction_lost = report_block_stats_.FractionLostInPercent(); | 38 int fraction_lost = report_block_stats_.FractionLostInPercent(); |
| 39 if (fraction_lost != -1) { | 39 if (fraction_lost != -1) { |
| 40 RTC_HISTOGRAM_PERCENTAGE_SPARSE("WebRTC.Video.ReceivedPacketsLostInPercent", | 40 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.ReceivedPacketsLostInPercent", |
| 41 fraction_lost); | 41 fraction_lost); |
| 42 } | 42 } |
| 43 const int kMinRequiredSamples = 200; | 43 const int kMinRequiredSamples = 200; |
| 44 int samples = static_cast<int>(render_fps_tracker_.TotalSampleCount()); | 44 int samples = static_cast<int>(render_fps_tracker_.TotalSampleCount()); |
| 45 if (samples > kMinRequiredSamples) { | 45 if (samples > kMinRequiredSamples) { |
| 46 RTC_HISTOGRAM_COUNTS_SPARSE_100("WebRTC.Video.RenderFramesPerSecond", | 46 RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.RenderFramesPerSecond", |
| 47 round(render_fps_tracker_.ComputeTotalRate())); | 47 round(render_fps_tracker_.ComputeTotalRate())); |
| 48 RTC_HISTOGRAM_COUNTS_SPARSE_100000("WebRTC.Video.RenderSqrtPixelsPerSecond", | 48 RTC_HISTOGRAM_COUNTS_100000( |
| 49 "WebRTC.Video.RenderSqrtPixelsPerSecond", |
| 49 round(render_pixel_tracker_.ComputeTotalRate())); | 50 round(render_pixel_tracker_.ComputeTotalRate())); |
| 50 } | 51 } |
| 51 int width = render_width_counter_.Avg(kMinRequiredSamples); | 52 int width = render_width_counter_.Avg(kMinRequiredSamples); |
| 52 int height = render_height_counter_.Avg(kMinRequiredSamples); | 53 int height = render_height_counter_.Avg(kMinRequiredSamples); |
| 53 if (width != -1) { | 54 if (width != -1) { |
| 54 RTC_HISTOGRAM_COUNTS_SPARSE_10000("WebRTC.Video.ReceivedWidthInPixels", | 55 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedWidthInPixels", width); |
| 55 width); | 56 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedHeightInPixels", height); |
| 56 RTC_HISTOGRAM_COUNTS_SPARSE_10000("WebRTC.Video.ReceivedHeightInPixels", | |
| 57 height); | |
| 58 } | 57 } |
| 59 int qp = qp_counters_.vp8.Avg(kMinRequiredSamples); | 58 int qp = qp_counters_.vp8.Avg(kMinRequiredSamples); |
| 60 if (qp != -1) | 59 if (qp != -1) |
| 61 RTC_HISTOGRAM_COUNTS_SPARSE_200("WebRTC.Video.Decoded.Vp8.Qp", qp); | 60 RTC_HISTOGRAM_COUNTS_200("WebRTC.Video.Decoded.Vp8.Qp", qp); |
| 62 | 61 |
| 63 // TODO(asapersson): DecoderTiming() is call periodically (each 1000ms) and | 62 // TODO(asapersson): DecoderTiming() is call periodically (each 1000ms) and |
| 64 // not per frame. Change decode time to include every frame. | 63 // not per frame. Change decode time to include every frame. |
| 65 const int kMinRequiredDecodeSamples = 5; | 64 const int kMinRequiredDecodeSamples = 5; |
| 66 int decode_ms = decode_time_counter_.Avg(kMinRequiredDecodeSamples); | 65 int decode_ms = decode_time_counter_.Avg(kMinRequiredDecodeSamples); |
| 67 if (decode_ms != -1) | 66 if (decode_ms != -1) |
| 68 RTC_HISTOGRAM_COUNTS_SPARSE_1000("WebRTC.Video.DecodeTimeInMs", decode_ms); | 67 RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.DecodeTimeInMs", decode_ms); |
| 69 | 68 |
| 70 int delay_ms = delay_counter_.Avg(kMinRequiredDecodeSamples); | 69 int delay_ms = delay_counter_.Avg(kMinRequiredDecodeSamples); |
| 71 if (delay_ms != -1) | 70 if (delay_ms != -1) |
| 72 RTC_HISTOGRAM_COUNTS_SPARSE_10000("WebRTC.Video.OnewayDelayInMs", delay_ms); | 71 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.OnewayDelayInMs", delay_ms); |
| 73 } | 72 } |
| 74 | 73 |
| 75 VideoReceiveStream::Stats ReceiveStatisticsProxy::GetStats() const { | 74 VideoReceiveStream::Stats ReceiveStatisticsProxy::GetStats() const { |
| 76 rtc::CritScope lock(&crit_); | 75 rtc::CritScope lock(&crit_); |
| 77 return stats_; | 76 return stats_; |
| 78 } | 77 } |
| 79 | 78 |
| 80 void ReceiveStatisticsProxy::OnIncomingPayloadType(int payload_type) { | 79 void ReceiveStatisticsProxy::OnIncomingPayloadType(int payload_type) { |
| 81 rtc::CritScope lock(&crit_); | 80 rtc::CritScope lock(&crit_); |
| 82 stats_.current_payload_type = payload_type; | 81 stats_.current_payload_type = payload_type; |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 ++num_samples; | 207 ++num_samples; |
| 209 } | 208 } |
| 210 | 209 |
| 211 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { | 210 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { |
| 212 if (num_samples < min_required_samples || num_samples == 0) | 211 if (num_samples < min_required_samples || num_samples == 0) |
| 213 return -1; | 212 return -1; |
| 214 return sum / num_samples; | 213 return sum / num_samples; |
| 215 } | 214 } |
| 216 | 215 |
| 217 } // namespace webrtc | 216 } // namespace webrtc |
| OLD | NEW |