niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
leozwang@webrtc.org | 813e4b0 | 2012-03-01 18:34:25 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 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 | |
tommi | 31fc21f | 2016-01-21 10:37:37 -0800 | [diff] [blame] | 14 | #include "webrtc/base/criticalsection.h" |
| 15 | #include "webrtc/base/thread_annotations.h" |
Henrik Kjellander | ff761fb | 2015-11-04 08:31:52 +0100 | [diff] [blame] | 16 | #include "webrtc/modules/include/module.h" |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 17 | #include "webrtc/typedefs.h" |
| 18 | #include "webrtc/voice_engine/voice_engine_defines.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 19 | |
| 20 | class MonitorObserver |
| 21 | { |
| 22 | public: |
| 23 | virtual void OnPeriodicProcess() = 0; |
| 24 | protected: |
| 25 | virtual ~MonitorObserver() {} |
| 26 | }; |
| 27 | |
| 28 | |
| 29 | namespace webrtc { |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 30 | namespace voe { |
| 31 | |
| 32 | class MonitorModule : public Module |
| 33 | { |
| 34 | public: |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 35 | int32_t RegisterObserver(MonitorObserver& observer); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 36 | |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 37 | int32_t DeRegisterObserver(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 38 | |
| 39 | MonitorModule(); |
| 40 | |
| 41 | virtual ~MonitorModule(); |
| 42 | public: // module |
kjellander@webrtc.org | 14665ff | 2015-03-04 12:58:35 +0000 | [diff] [blame] | 43 | int64_t TimeUntilNextProcess() override; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 44 | |
pbos | a26ac92 | 2016-02-25 04:50:01 -0800 | [diff] [blame^] | 45 | void Process() override; |
kjellander@webrtc.org | 14665ff | 2015-03-04 12:58:35 +0000 | [diff] [blame] | 46 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 47 | private: |
tommi | 31fc21f | 2016-01-21 10:37:37 -0800 | [diff] [blame] | 48 | rtc::CriticalSection _callbackCritSect; |
| 49 | MonitorObserver* _observerPtr GUARDED_BY(_callbackCritSect); |
pkasting@chromium.org | 0b1534c | 2014-12-15 22:09:40 +0000 | [diff] [blame] | 50 | int64_t _lastProcessTime; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 51 | }; |
| 52 | |
pbos@webrtc.org | d900e8b | 2013-07-03 15:12:26 +0000 | [diff] [blame] | 53 | } // namespace voe |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 54 | |
pbos@webrtc.org | d900e8b | 2013-07-03 15:12:26 +0000 | [diff] [blame] | 55 | } // namespace webrtc |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 56 | |
| 57 | #endif // VOICE_ENGINE_MONITOR_MODULE |