Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: webrtc/video/receive_statistics_proxy.cc

Issue 1250203002: Add encode and decode time to histograms stats: (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: added todo Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/video/receive_statistics_proxy.h ('k') | webrtc/video/send_statistics_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 21 matching lines...) Expand all
32 int fraction_lost = report_block_stats_.FractionLostInPercent(); 32 int fraction_lost = report_block_stats_.FractionLostInPercent();
33 if (fraction_lost != -1) { 33 if (fraction_lost != -1) {
34 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.ReceivedPacketsLostInPercent", 34 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.ReceivedPacketsLostInPercent",
35 fraction_lost); 35 fraction_lost);
36 } 36 }
37 37
38 int render_fps = static_cast<int>(render_fps_tracker_total_.units_second()); 38 int render_fps = static_cast<int>(render_fps_tracker_total_.units_second());
39 if (render_fps > 0) 39 if (render_fps > 0)
40 RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.RenderFramesPerSecond", render_fps); 40 RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.RenderFramesPerSecond", render_fps);
41 41
42 const int kMinRequiredSamples = 100; 42 const int kMinRequiredSamples = 200;
43 int width = render_width_counter_.Avg(kMinRequiredSamples); 43 int width = render_width_counter_.Avg(kMinRequiredSamples);
44 int height = render_height_counter_.Avg(kMinRequiredSamples); 44 int height = render_height_counter_.Avg(kMinRequiredSamples);
45 if (width != -1) { 45 if (width != -1) {
46 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedWidthInPixels", width); 46 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedWidthInPixels", width);
47 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedHeightInPixels", height); 47 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedHeightInPixels", height);
48 } 48 }
49 // TODO(asapersson): DecoderTiming() is call periodically (each 1000ms) and
50 // not per frame. Change decode time to include every frame.
51 const int kMinRequiredDecodeSamples = 5;
52 int decode_ms = decode_time_counter_.Avg(kMinRequiredDecodeSamples);
53 if (decode_ms != -1)
54 RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.DecodeTimeInMs", decode_ms);
49 } 55 }
50 56
51 VideoReceiveStream::Stats ReceiveStatisticsProxy::GetStats() const { 57 VideoReceiveStream::Stats ReceiveStatisticsProxy::GetStats() const {
52 rtc::CritScope lock(&crit_); 58 rtc::CritScope lock(&crit_);
53 return stats_; 59 return stats_;
54 } 60 }
55 61
56 void ReceiveStatisticsProxy::IncomingRate(const int video_channel, 62 void ReceiveStatisticsProxy::IncomingRate(const int video_channel,
57 const unsigned int framerate, 63 const unsigned int framerate,
58 const unsigned int bitrate_bps) { 64 const unsigned int bitrate_bps) {
(...skipping 10 matching lines...) Expand all
69 int min_playout_delay_ms, 75 int min_playout_delay_ms,
70 int render_delay_ms) { 76 int render_delay_ms) {
71 rtc::CritScope lock(&crit_); 77 rtc::CritScope lock(&crit_);
72 stats_.decode_ms = decode_ms; 78 stats_.decode_ms = decode_ms;
73 stats_.max_decode_ms = max_decode_ms; 79 stats_.max_decode_ms = max_decode_ms;
74 stats_.current_delay_ms = current_delay_ms; 80 stats_.current_delay_ms = current_delay_ms;
75 stats_.target_delay_ms = target_delay_ms; 81 stats_.target_delay_ms = target_delay_ms;
76 stats_.jitter_buffer_ms = jitter_buffer_ms; 82 stats_.jitter_buffer_ms = jitter_buffer_ms;
77 stats_.min_playout_delay_ms = min_playout_delay_ms; 83 stats_.min_playout_delay_ms = min_playout_delay_ms;
78 stats_.render_delay_ms = render_delay_ms; 84 stats_.render_delay_ms = render_delay_ms;
85 decode_time_counter_.Add(decode_ms);
79 } 86 }
80 87
81 void ReceiveStatisticsProxy::RtcpPacketTypesCounterUpdated( 88 void ReceiveStatisticsProxy::RtcpPacketTypesCounterUpdated(
82 uint32_t ssrc, 89 uint32_t ssrc,
83 const RtcpPacketTypeCounter& packet_counter) { 90 const RtcpPacketTypeCounter& packet_counter) {
84 rtc::CritScope lock(&crit_); 91 rtc::CritScope lock(&crit_);
85 if (stats_.ssrc != ssrc) 92 if (stats_.ssrc != ssrc)
86 return; 93 return;
87 stats_.rtcp_packet_type_counts = packet_counter; 94 stats_.rtcp_packet_type_counts = packet_counter;
88 } 95 }
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 ++num_samples; 163 ++num_samples;
157 } 164 }
158 165
159 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { 166 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const {
160 if (num_samples < min_required_samples || num_samples == 0) 167 if (num_samples < min_required_samples || num_samples == 0)
161 return -1; 168 return -1;
162 return sum / num_samples; 169 return sum / num_samples;
163 } 170 }
164 171
165 } // namespace webrtc 172 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/receive_statistics_proxy.h ('k') | webrtc/video/send_statistics_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698