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

Side by Side Diff: webrtc/modules/audio_conference_mixer/source/time_scheduler.h

Issue 2790533002: Remove ALL usage of CriticalSectionWrapper. (Closed)
Patch Set: remove winXP rw_lock include Created 3 years, 8 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
OLDNEW
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 // The TimeScheduler class keeps track of periodic events. It is non-drifting 11 // The TimeScheduler class keeps track of periodic events. It is non-drifting
12 // and keeps track of any missed periods so that it is possible to catch up. 12 // and keeps track of any missed periods so that it is possible to catch up.
13 // (compare to a metronome) 13 // (compare to a metronome)
14 #include "webrtc/base/criticalsection.h" 14 #include "webrtc/base/criticalsection.h"
15 15
16 #ifndef WEBRTC_MODULES_AUDIO_CONFERENCE_MIXER_SOURCE_TIME_SCHEDULER_H_ 16 #ifndef WEBRTC_MODULES_AUDIO_CONFERENCE_MIXER_SOURCE_TIME_SCHEDULER_H_
17 #define WEBRTC_MODULES_AUDIO_CONFERENCE_MIXER_SOURCE_TIME_SCHEDULER_H_ 17 #define WEBRTC_MODULES_AUDIO_CONFERENCE_MIXER_SOURCE_TIME_SCHEDULER_H_
18 18
19 namespace webrtc { 19 namespace webrtc {
20 class CriticalSectionWrapper;
21 20
22 class TimeScheduler { 21 class TimeScheduler {
23 public: 22 public:
24 TimeScheduler(const int64_t periodicityInMs); 23 TimeScheduler(const int64_t periodicityInMs);
25 ~TimeScheduler() = default; 24 ~TimeScheduler() = default;
26 25
27 // Signal that a periodic event has been triggered. 26 // Signal that a periodic event has been triggered.
28 int32_t UpdateScheduler(); 27 int32_t UpdateScheduler();
29 28
30 // Set updateTimeInMs to the amount of time until UpdateScheduler() should 29 // Set updateTimeInMs to the amount of time until UpdateScheduler() should
31 // be called. This time will never be negative. 30 // be called. This time will never be negative.
32 int32_t TimeToNextUpdate(int64_t& updateTimeInMS) const; 31 int32_t TimeToNextUpdate(int64_t& updateTimeInMS) const;
33 32
34 private: 33 private:
35 rtc::CriticalSection _crit; 34 rtc::CriticalSection _crit;
36 35
37 bool _isStarted; 36 bool _isStarted;
38 int64_t _lastPeriodMark; // In ns 37 int64_t _lastPeriodMark; // In ns
39 38
40 int64_t _periodicityInMs; 39 int64_t _periodicityInMs;
41 int64_t _periodicityInTicks; 40 int64_t _periodicityInTicks;
42 uint32_t _missedPeriods; 41 uint32_t _missedPeriods;
43 }; 42 };
44 } // namespace webrtc 43 } // namespace webrtc
45 44
46 #endif // WEBRTC_MODULES_AUDIO_CONFERENCE_MIXER_SOURCE_TIME_SCHEDULER_H_ 45 #endif // WEBRTC_MODULES_AUDIO_CONFERENCE_MIXER_SOURCE_TIME_SCHEDULER_H_
OLDNEW
« no previous file with comments | « webrtc/modules/audio_conference_mixer/source/memory_pool_posix.h ('k') | webrtc/modules/audio_device/mac/audio_device_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698