OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 #ifndef WEBRTC_VOICE_ENGINE_MONITOR_MODULE_H | 11 #ifndef WEBRTC_VOICE_ENGINE_MONITOR_MODULE_H |
12 #define WEBRTC_VOICE_ENGINE_MONITOR_MODULE_H | 12 #define WEBRTC_VOICE_ENGINE_MONITOR_MODULE_H |
13 | 13 |
| 14 #include "webrtc/base/criticalsection.h" |
| 15 #include "webrtc/base/thread_annotations.h" |
14 #include "webrtc/modules/include/module.h" | 16 #include "webrtc/modules/include/module.h" |
15 #include "webrtc/typedefs.h" | 17 #include "webrtc/typedefs.h" |
16 #include "webrtc/voice_engine/voice_engine_defines.h" | 18 #include "webrtc/voice_engine/voice_engine_defines.h" |
17 | 19 |
18 class MonitorObserver | 20 class MonitorObserver |
19 { | 21 { |
20 public: | 22 public: |
21 virtual void OnPeriodicProcess() = 0; | 23 virtual void OnPeriodicProcess() = 0; |
22 protected: | 24 protected: |
23 virtual ~MonitorObserver() {} | 25 virtual ~MonitorObserver() {} |
24 }; | 26 }; |
25 | 27 |
26 | 28 |
27 namespace webrtc { | 29 namespace webrtc { |
28 class CriticalSectionWrapper; | |
29 | |
30 namespace voe { | 30 namespace voe { |
31 | 31 |
32 class MonitorModule : public Module | 32 class MonitorModule : public Module |
33 { | 33 { |
34 public: | 34 public: |
35 int32_t RegisterObserver(MonitorObserver& observer); | 35 int32_t RegisterObserver(MonitorObserver& observer); |
36 | 36 |
37 int32_t DeRegisterObserver(); | 37 int32_t DeRegisterObserver(); |
38 | 38 |
39 MonitorModule(); | 39 MonitorModule(); |
40 | 40 |
41 virtual ~MonitorModule(); | 41 virtual ~MonitorModule(); |
42 public: // module | 42 public: // module |
43 int64_t TimeUntilNextProcess() override; | 43 int64_t TimeUntilNextProcess() override; |
44 | 44 |
45 int32_t Process() override; | 45 int32_t Process() override; |
46 | 46 |
47 private: | 47 private: |
48 MonitorObserver* _observerPtr; | 48 rtc::CriticalSection _callbackCritSect; |
49 CriticalSectionWrapper&» _callbackCritSect; | 49 MonitorObserver* _observerPtr GUARDED_BY(_callbackCritSect); |
50 int64_t _lastProcessTime; | 50 int64_t _lastProcessTime; |
51 }; | 51 }; |
52 | 52 |
53 } // namespace voe | 53 } // namespace voe |
54 | 54 |
55 } // namespace webrtc | 55 } // namespace webrtc |
56 | 56 |
57 #endif // VOICE_ENGINE_MONITOR_MODULE | 57 #endif // VOICE_ENGINE_MONITOR_MODULE |
OLD | NEW |