OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 timing.UpdateCurrentDelay(timeStamp); | 78 timing.UpdateCurrentDelay(timeStamp); |
79 waitTime = timing.MaxWaitingTime( | 79 waitTime = timing.MaxWaitingTime( |
80 timing.RenderTimeMs(timeStamp, clock.TimeInMilliseconds()), | 80 timing.RenderTimeMs(timeStamp, clock.TimeInMilliseconds()), |
81 clock.TimeInMilliseconds()); | 81 clock.TimeInMilliseconds()); |
82 EXPECT_EQ(waitTime, jitterDelayMs); | 82 EXPECT_EQ(waitTime, jitterDelayMs); |
83 | 83 |
84 // Add decode time estimates. | 84 // Add decode time estimates. |
85 for (int i = 0; i < 10; i++) { | 85 for (int i = 0; i < 10; i++) { |
86 int64_t startTimeMs = clock.TimeInMilliseconds(); | 86 int64_t startTimeMs = clock.TimeInMilliseconds(); |
87 clock.AdvanceTimeMilliseconds(10); | 87 clock.AdvanceTimeMilliseconds(10); |
88 timing.StopDecodeTimer(timeStamp, startTimeMs, | 88 timing.StopDecodeTimer(timeStamp, |
89 clock.TimeInMilliseconds(), timing.RenderTimeMs( | 89 clock.TimeInMilliseconds() - startTimeMs, |
| 90 clock.TimeInMilliseconds(), |
| 91 timing.RenderTimeMs( |
90 timeStamp, clock.TimeInMilliseconds())); | 92 timeStamp, clock.TimeInMilliseconds())); |
91 timeStamp += 90000 / 25; | 93 timeStamp += 90000 / 25; |
92 clock.AdvanceTimeMilliseconds(1000 / 25 - 10); | 94 clock.AdvanceTimeMilliseconds(1000 / 25 - 10); |
93 timing.IncomingTimestamp(timeStamp, clock.TimeInMilliseconds()); | 95 timing.IncomingTimestamp(timeStamp, clock.TimeInMilliseconds()); |
94 } | 96 } |
95 maxDecodeTimeMs = 10; | 97 maxDecodeTimeMs = 10; |
96 timing.SetJitterDelay(jitterDelayMs); | 98 timing.SetJitterDelay(jitterDelayMs); |
97 clock.AdvanceTimeMilliseconds(1000); | 99 clock.AdvanceTimeMilliseconds(1000); |
98 timeStamp += 90000; | 100 timeStamp += 90000; |
99 timing.UpdateCurrentDelay(timeStamp); | 101 timing.UpdateCurrentDelay(timeStamp); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 int64_t render_time = timing.RenderTimeMs(0xFFFFFFFFu, | 140 int64_t render_time = timing.RenderTimeMs(0xFFFFFFFFu, |
139 clock.TimeInMilliseconds()); | 141 clock.TimeInMilliseconds()); |
140 EXPECT_EQ(3 * 1000 / kFramerate, render_time); | 142 EXPECT_EQ(3 * 1000 / kFramerate, render_time); |
141 render_time = timing.RenderTimeMs(89u, // One second later in 90 kHz. | 143 render_time = timing.RenderTimeMs(89u, // One second later in 90 kHz. |
142 clock.TimeInMilliseconds()); | 144 clock.TimeInMilliseconds()); |
143 EXPECT_EQ(3 * 1000 / kFramerate + 1, render_time); | 145 EXPECT_EQ(3 * 1000 / kFramerate + 1, render_time); |
144 } | 146 } |
145 } | 147 } |
146 | 148 |
147 } // namespace webrtc | 149 } // namespace webrtc |
OLD | NEW |