OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | |
3 * | |
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 | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 */ | |
10 #ifndef WEBRTC_TEST_DRIFTING_CLOCK_H_ | |
11 #define WEBRTC_TEST_DRIFTING_CLOCK_H_ | |
12 | |
13 #include "webrtc/system_wrappers/include/clock.h" | |
14 | |
15 namespace webrtc { | |
16 namespace test { | |
17 class DriftingClock : public Clock { | |
18 public: | |
19 // drift > 0 means DriftingClock goes slower than clock. | |
pbos-webrtc
2016/02/09 20:42:25
Do drift_factor here and have 0 be still, 0.5 be h
danilchap
2016/02/10 12:40:35
Done.
Is 'speed' instead of 'drift_factor' a clear
| |
20 // drift = 1.0 means DriftingClock goes twice as slow as clock. | |
21 // drift < 0 means DriftingClock goes faster than clock. | |
22 // drift = -0.5 means DriftingClock goes twice as fast as clock. | |
23 DriftingClock(Clock* clock, float drift); | |
24 | |
25 int64_t TimeInMilliseconds() const override; | |
26 int64_t TimeInMicroseconds() const override; | |
27 void CurrentNtp(uint32_t& seconds, uint32_t& fractions) const override; | |
28 int64_t CurrentNtpInMilliseconds() const override; | |
29 | |
30 private: | |
31 float Drift() const; | |
32 | |
33 Clock* const clock_; | |
34 const float drift_; | |
35 int64_t start_time_; | |
36 }; | |
37 } // namespace test | |
38 } // namespace webrtc | |
39 | |
40 #endif // WEBRTC_TEST_DRIFTING_CLOCK_H_ | |
OLD | NEW |