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 |
11 #include "webrtc/modules/audio_conference_mixer/source/time_scheduler.h" | 11 #include "webrtc/modules/audio_conference_mixer/source/time_scheduler.h" |
12 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" | 12 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" |
13 | 13 |
14 namespace webrtc { | 14 namespace webrtc { |
15 TimeScheduler::TimeScheduler(const int64_t periodicityInMs) | 15 TimeScheduler::TimeScheduler(const int64_t periodicityInMs) |
16 : _crit(CriticalSectionWrapper::CreateCriticalSection()), | 16 : _crit(CriticalSectionWrapper::CreateCriticalSection()), |
17 _isStarted(false), | 17 _isStarted(false), |
18 _lastPeriodMark(), | 18 _lastPeriodMark(), |
19 _periodicityInMs(periodicityInMs), | 19 _periodicityInMs(periodicityInMs), |
20 _periodicityInTicks(TickTime::MillisecondsToTicks(periodicityInMs)), | 20 _periodicityInTicks(TickTime::MillisecondsToTicks(periodicityInMs)), |
21 _missedPeriods(0) | 21 _missedPeriods(0) |
22 { | 22 { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 TickTime tickNow = TickTime::Now(); | 92 TickTime tickNow = TickTime::Now(); |
93 TickInterval ticksSinceLastUpdate = tickNow - _lastPeriodMark; | 93 TickInterval ticksSinceLastUpdate = tickNow - _lastPeriodMark; |
94 const int64_t millisecondsSinceLastUpdate = | 94 const int64_t millisecondsSinceLastUpdate = |
95 ticksSinceLastUpdate.Milliseconds(); | 95 ticksSinceLastUpdate.Milliseconds(); |
96 | 96 |
97 updateTimeInMS = _periodicityInMs - millisecondsSinceLastUpdate; | 97 updateTimeInMS = _periodicityInMs - millisecondsSinceLastUpdate; |
98 updateTimeInMS = (updateTimeInMS < 0) ? 0 : updateTimeInMS; | 98 updateTimeInMS = (updateTimeInMS < 0) ? 0 : updateTimeInMS; |
99 return 0; | 99 return 0; |
100 } | 100 } |
101 } // namespace webrtc | 101 } // namespace webrtc |
OLD | NEW |