1
0
mirror of https://github.com/rofafor/vdr-plugin-iptv.git synced 2023-10-10 13:37:03 +02:00
vdr-plugin-iptv/statistics.h
Rolf Ahrenberg 53b5644973 Migration changes for git and UTF-8.
Updated contact information.
2008-08-23 08:15:30 +03:00

88 lines
1.6 KiB
C++

/*
* statistics.h: IPTV plugin for the Video Disk Recorder
*
* See the README file for copyright information and how to reach the author.
*
*/
#ifndef __IPTV_STATISTICS_H
#define __IPTV_STATISTICS_H
#include <vdr/thread.h>
// Section statistics
class cIptvSectionStatistics {
public:
cIptvSectionStatistics();
virtual ~cIptvSectionStatistics();
cString GetSectionStatistic();
protected:
void AddSectionStatistic(long Bytes, long Calls);
private:
long filteredData;
long numberOfCalls;
cTimeMs timer;
cMutex mutex;
};
// Pid statistics
class cIptvPidStatistics {
public:
cIptvPidStatistics();
virtual ~cIptvPidStatistics();
cString GetPidStatistic();
protected:
void AddPidStatistic(u_short Pid, long Payload);
private:
struct pidStruct {
u_short pid;
long DataAmount;
};
pidStruct mostActivePids[IPTV_STATS_ACTIVE_PIDS_COUNT];
cTimeMs timer;
cMutex mutex;
private:
static int SortPids(const void* data1, const void* data2);
};
// Streamer statistics
class cIptvStreamerStatistics {
public:
cIptvStreamerStatistics();
virtual ~cIptvStreamerStatistics();
cString GetStreamerStatistic();
protected:
void AddStreamerStatistic(long Bytes);
private:
long dataBytes;
cTimeMs timer;
cMutex mutex;
};
// Buffer statistics
class cIptvBufferStatistics {
public:
cIptvBufferStatistics();
virtual ~cIptvBufferStatistics();
cString GetBufferStatistic();
protected:
void AddBufferStatistic(long Bytes, long Used);
private:
long dataBytes;
long freeSpace;
long usedSpace;
cTimeMs timer;
cMutex mutex;
};
#endif // __IPTV_STATISTICS_H