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