webrtc/src/video_engine/vie_performance_monitor.h
mflodman@webrtc.org 611e4c3253 Refactored ViEPerformanceMonitor.
Only style changes, will follow up with references/ptrs.

Review URL: http://webrtc-codereview.appspot.com/289009

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1045 4adac7df-926f-26a2-2b94-8c16560cd09d
2011-11-29 02:39:28 +00:00

55 lines
1.5 KiB
C++

/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
// ViEPerformanceMonitor is used to check the current CPU usage and triggers a
// callback when getting over a specified threshold.
#ifndef WEBRTC_VIDEO_ENGINE_VIE_PERFORMANCE_MONITOR_H_
#define WEBRTC_VIDEO_ENGINE_VIE_PERFORMANCE_MONITOR_H_
#include "typedefs.h"
#include "vie_defines.h"
namespace webrtc {
class CriticalSectionWrapper;
class CpuWrapper;
class EventWrapper;
class ThreadWrapper;
class ViEBaseObserver;
class ViEPerformanceMonitor {
public:
explicit ViEPerformanceMonitor(int engine_id);
~ViEPerformanceMonitor();
int Init(ViEBaseObserver* vie_base_observer);
void Terminate();
bool ViEBaseObserverRegistered();
protected:
static bool ViEMonitorThreadFunction(void* obj);
bool ViEMonitorProcess();
private:
const int engine_id_;
CriticalSectionWrapper& pointer_critsect_;
ThreadWrapper* monitor_thread_;
EventWrapper& monitor_event_;
int average_application_cpu_;
int average_system_cpu_;
CpuWrapper* cpu_;
ViEBaseObserver* vie_base_observer_;
};
} // namespace webrtc
#endif // WEBRTC_VIDEO_ENGINE_VIE_PERFORMANCE_MONITOR_H_