Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Side by Side Diff: webrtc/voice_engine/monitor_module.h

Issue 2722613002: Simplify webrtc::voe::MonitorModule and remove the .cc file. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/voice_engine/BUILD.gn ('k') | webrtc/voice_engine/monitor_module.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
16 #include "webrtc/modules/include/module.h" 14 #include "webrtc/modules/include/module.h"
17 #include "webrtc/typedefs.h"
18 #include "webrtc/voice_engine/voice_engine_defines.h"
19
20 class MonitorObserver
21 {
22 public:
23 virtual void OnPeriodicProcess() = 0;
24 protected:
25 virtual ~MonitorObserver() {}
26 };
27
28 15
29 namespace webrtc { 16 namespace webrtc {
30 namespace voe { 17 namespace voe {
31 18
32 class MonitorModule : public Module 19 // When associated with a ProcessThread, calls a callback method
33 { 20 // |OnPeriodicProcess()| implemented by the |Observer|.
34 public: 21 // TODO(tommi): This could be replaced with PostDelayedTask().
35 int32_t RegisterObserver(MonitorObserver& observer); 22 template <typename Observer>
23 class MonitorModule : public Module {
24 public:
25 explicit MonitorModule(Observer* observer) : observer_(observer) {}
26 ~MonitorModule() override {}
36 27
37 int32_t DeRegisterObserver(); 28 private:
29 int64_t TimeUntilNextProcess() override { return 1000; }
30 void Process() override { observer_->OnPeriodicProcess(); }
henrika_webrtc 2017/02/28 08:24:21 To me it looks like TransmitMixer::OnPeridodicProc
tommi 2017/02/28 08:38:41 Good point... I looked around for VE_SATURATION_WA
38 31
39 MonitorModule(); 32 Observer* const observer_;
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 }; 33 };
52 34
53 } // namespace voe 35 } // namespace voe
54
55 } // namespace webrtc 36 } // namespace webrtc
56 37
57 #endif // VOICE_ENGINE_MONITOR_MODULE 38 #endif // VOICE_ENGINE_MONITOR_MODULE
OLDNEW
« no previous file with comments | « webrtc/voice_engine/BUILD.gn ('k') | webrtc/voice_engine/monitor_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698