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 |
11 #include "webrtc/video/receive_statistics_proxy.h" | 11 #include "webrtc/video/receive_statistics_proxy.h" |
12 | 12 |
13 #include <cmath> | 13 #include <cmath> |
14 | 14 |
15 #include "webrtc/base/checks.h" | 15 #include "webrtc/base/checks.h" |
16 #include "webrtc/modules/video_coding/include/video_codec_interface.h" | 16 #include "webrtc/modules/video_coding/include/video_codec_interface.h" |
17 #include "webrtc/system_wrappers/include/clock.h" | 17 #include "webrtc/system_wrappers/include/clock.h" |
18 #include "webrtc/system_wrappers/include/metrics.h" | 18 #include "webrtc/system_wrappers/include/metrics.h" |
19 | 19 |
20 namespace webrtc { | 20 namespace webrtc { |
21 | 21 |
22 ReceiveStatisticsProxy::ReceiveStatisticsProxy( | 22 ReceiveStatisticsProxy::ReceiveStatisticsProxy( |
23 const VideoReceiveStream::Config& config, | 23 const VideoReceiveStream::Config* config, |
24 Clock* clock) | 24 Clock* clock) |
25 : clock_(clock), | 25 : clock_(clock), |
26 config_(config), | 26 config_(*config), |
27 // 1000ms window, scale 1000 for ms to s. | 27 // 1000ms window, scale 1000 for ms to s. |
28 decode_fps_estimator_(1000, 1000), | 28 decode_fps_estimator_(1000, 1000), |
29 renders_fps_estimator_(1000, 1000), | 29 renders_fps_estimator_(1000, 1000), |
30 render_fps_tracker_(100, 10u), | 30 render_fps_tracker_(100, 10u), |
31 render_pixel_tracker_(100, 10u) { | 31 render_pixel_tracker_(100, 10u) { |
32 stats_.ssrc = config.rtp.remote_ssrc; | 32 stats_.ssrc = config_.rtp.remote_ssrc; |
33 for (auto it : config.rtp.rtx) | 33 for (auto it : config_.rtp.rtx) |
34 rtx_stats_[it.second.ssrc] = StreamDataCounters(); | 34 rtx_stats_[it.second.ssrc] = StreamDataCounters(); |
35 } | 35 } |
36 | 36 |
37 ReceiveStatisticsProxy::~ReceiveStatisticsProxy() { | 37 ReceiveStatisticsProxy::~ReceiveStatisticsProxy() { |
38 UpdateHistograms(); | 38 UpdateHistograms(); |
39 } | 39 } |
40 | 40 |
41 void ReceiveStatisticsProxy::UpdateHistograms() { | 41 void ReceiveStatisticsProxy::UpdateHistograms() { |
42 int fraction_lost = report_block_stats_.FractionLostInPercent(); | 42 int fraction_lost = report_block_stats_.FractionLostInPercent(); |
43 if (fraction_lost != -1) { | 43 if (fraction_lost != -1) { |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 ++num_samples; | 301 ++num_samples; |
302 } | 302 } |
303 | 303 |
304 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { | 304 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { |
305 if (num_samples < min_required_samples || num_samples == 0) | 305 if (num_samples < min_required_samples || num_samples == 0) |
306 return -1; | 306 return -1; |
307 return sum / num_samples; | 307 return sum / num_samples; |
308 } | 308 } |
309 | 309 |
310 } // namespace webrtc | 310 } // namespace webrtc |
OLD | NEW |