blob: ea29d93d804ca4564f83c1cb0a6c81d28d6a910e [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
leozwang@webrtc.org813e4b02012-03-01 18:34:25 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
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
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010014#include "webrtc/modules/include/module.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000015
16namespace webrtc {
niklase@google.com470e71d2011-07-07 08:21:25 +000017namespace voe {
18
tommib1175bb2017-02-28 01:16:48 -080019// When associated with a ProcessThread, calls a callback method
20// |OnPeriodicProcess()| implemented by the |Observer|.
21// TODO(tommi): This could be replaced with PostDelayedTask().
22// Better yet, delete it and delete code related to |_saturationWarning|
23// in TransmitMixer (and the OnPeriodicProcess callback).
24template <typename Observer>
25class MonitorModule : public Module {
26 public:
27 explicit MonitorModule(Observer* observer) : observer_(observer) {}
28 ~MonitorModule() override {}
niklase@google.com470e71d2011-07-07 08:21:25 +000029
tommib1175bb2017-02-28 01:16:48 -080030 private:
31 int64_t TimeUntilNextProcess() override { return 1000; }
32 void Process() override { observer_->OnPeriodicProcess(); }
niklase@google.com470e71d2011-07-07 08:21:25 +000033
tommib1175bb2017-02-28 01:16:48 -080034 Observer* const observer_;
niklase@google.com470e71d2011-07-07 08:21:25 +000035};
36
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +000037} // namespace voe
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +000038} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +000039
tommib1175bb2017-02-28 01:16:48 -080040#endif // VOICE_ENGINE_MONITOR_MODULE