2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
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.
11 #ifndef WEBRTC_VOICE_ENGINE_MONITOR_MODULE_H
12 #define WEBRTC_VOICE_ENGINE_MONITOR_MODULE_H
14 #include "webrtc/modules/interface/module.h"
15 #include "webrtc/typedefs.h"
16 #include "webrtc/voice_engine/voice_engine_defines.h"
21 virtual void OnPeriodicProcess() = 0;
23 virtual ~MonitorObserver() {}
28 class CriticalSectionWrapper;
32 class MonitorModule : public Module
35 int32_t RegisterObserver(MonitorObserver& observer);
37 int32_t DeRegisterObserver();
41 virtual ~MonitorModule();
43 virtual int32_t ChangeUniqueId(int32_t id) OVERRIDE;
45 virtual int32_t TimeUntilNextProcess() OVERRIDE;
47 virtual int32_t Process() OVERRIDE;
49 enum { kAverageProcessUpdateTimeMs = 1000 };
50 MonitorObserver* _observerPtr;
51 CriticalSectionWrapper& _callbackCritSect;
52 int32_t _lastProcessTime;
59 #endif // VOICE_ENGINE_MONITOR_MODULE