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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/receive_statistics_impl.cc

Issue 2393723004: replace NtpTime->Clock with Clock->NtpTime dependency (Closed)
Patch Set: . Created 3 years, 10 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 | « no previous file | webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc » ('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
11 #include "webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h" 11 #include "webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h"
12 12
13 #include <math.h> 13 #include <math.h>
14 14
15 #include <cstdlib> 15 #include <cstdlib>
16 16
17 #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h" 17 #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h"
18 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h" 18 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h"
19 #include "webrtc/modules/rtp_rtcp/source/time_util.h" 19 #include "webrtc/modules/rtp_rtcp/source/time_util.h"
20 #include "webrtc/system_wrappers/include/clock.h"
20 21
21 namespace webrtc { 22 namespace webrtc {
22 23
23 const int64_t kStatisticsTimeoutMs = 8000; 24 const int64_t kStatisticsTimeoutMs = 8000;
24 const int64_t kStatisticsProcessIntervalMs = 1000; 25 const int64_t kStatisticsProcessIntervalMs = 1000;
25 26
26 StreamStatistician::~StreamStatistician() {} 27 StreamStatistician::~StreamStatistician() {}
27 28
28 StreamStatisticianImpl::StreamStatisticianImpl( 29 StreamStatisticianImpl::StreamStatisticianImpl(
29 Clock* clock, 30 Clock* clock,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 72
72 if (receive_counters_.transmitted.packets == 1) { 73 if (receive_counters_.transmitted.packets == 1) {
73 received_seq_first_ = header.sequenceNumber; 74 received_seq_first_ = header.sequenceNumber;
74 receive_counters_.first_packet_time_ms = clock_->TimeInMilliseconds(); 75 receive_counters_.first_packet_time_ms = clock_->TimeInMilliseconds();
75 } 76 }
76 77
77 // Count only the new packets received. That is, if packets 1, 2, 3, 5, 4, 6 78 // Count only the new packets received. That is, if packets 1, 2, 3, 5, 4, 6
78 // are received, 4 will be ignored. 79 // are received, 4 will be ignored.
79 if (in_order) { 80 if (in_order) {
80 // Current time in samples. 81 // Current time in samples.
81 NtpTime receive_time(*clock_); 82 NtpTime receive_time = clock_->CurrentNtpTime();
82 83
83 // Wrong if we use RetransmitOfOldPacket. 84 // Wrong if we use RetransmitOfOldPacket.
84 if (receive_counters_.transmitted.packets > 1 && 85 if (receive_counters_.transmitted.packets > 1 &&
85 received_seq_max_ > header.sequenceNumber) { 86 received_seq_max_ > header.sequenceNumber) {
86 // Wrap around detected. 87 // Wrap around detected.
87 received_seq_wraps_++; 88 received_seq_wraps_++;
88 } 89 }
89 // New max. 90 // New max.
90 received_seq_max_ = header.sequenceNumber; 91 received_seq_max_ = header.sequenceNumber;
91 92
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 void NullReceiveStatistics::SetMaxReorderingThreshold( 511 void NullReceiveStatistics::SetMaxReorderingThreshold(
511 int max_reordering_threshold) {} 512 int max_reordering_threshold) {}
512 513
513 void NullReceiveStatistics::RegisterRtcpStatisticsCallback( 514 void NullReceiveStatistics::RegisterRtcpStatisticsCallback(
514 RtcpStatisticsCallback* callback) {} 515 RtcpStatisticsCallback* callback) {}
515 516
516 void NullReceiveStatistics::RegisterRtpStatisticsCallback( 517 void NullReceiveStatistics::RegisterRtpStatisticsCallback(
517 StreamDataCountersCallback* callback) {} 518 StreamDataCountersCallback* callback) {}
518 519
519 } // namespace webrtc 520 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698