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

89 lines
1.6 KiB
C
Raw Permalink Normal View History

2007-10-05 21:00:44 +02:00
/*
* statistics.h: IPTV plugin for the Video Disk Recorder
*
* See the README file for copyright information and how to reach the author.
*
* $Id: statistics.h,v 1.11 2008/01/19 21:08:03 ajhseppa Exp $
2007-10-05 21:00:44 +02:00
*/
#ifndef __IPTV_STATISTICS_H
#define __IPTV_STATISTICS_H
2007-10-08 18:24:48 +02:00
#include <vdr/thread.h>
2007-10-05 21:00:44 +02:00
// Section statistics
class cIptvSectionStatistics {
2007-10-05 21:00:44 +02:00
public:
cIptvSectionStatistics();
virtual ~cIptvSectionStatistics();
cString GetSectionStatistic();
2007-10-08 18:24:48 +02:00
protected:
void AddSectionStatistic(long Bytes, long Calls);
2007-10-08 18:24:48 +02:00
private:
2007-10-08 18:24:48 +02:00
long filteredData;
long numberOfCalls;
cTimeMs timer;
2007-10-08 18:24:48 +02:00
cMutex mutex;
2007-10-05 21:00:44 +02:00
};
2007-10-10 00:12:17 +02:00
// Pid statistics
class cIptvPidStatistics {
2007-10-05 21:00:44 +02:00
public:
2007-10-10 00:12:17 +02:00
cIptvPidStatistics();
virtual ~cIptvPidStatistics();
cString GetPidStatistic();
2007-10-05 21:00:44 +02:00
protected:
void AddPidStatistic(u_short Pid, long Payload);
2007-10-05 21:00:44 +02:00
private:
struct pidStruct {
u_short pid;
long DataAmount;
};
2007-10-08 00:54:09 +02:00
pidStruct mostActivePids[IPTV_STATS_ACTIVE_PIDS_COUNT];
cTimeMs timer;
2007-10-08 18:24:48 +02:00
cMutex mutex;
2007-10-08 18:24:48 +02:00
private:
static int SortPids(const void* data1, const void* data2);
2007-10-05 21:00:44 +02:00
};
// Streamer statistics
class cIptvStreamerStatistics {
2007-10-05 21:00:44 +02:00
public:
cIptvStreamerStatistics();
virtual ~cIptvStreamerStatistics();
cString GetStreamerStatistic();
2007-10-08 18:24:48 +02:00
protected:
void AddStreamerStatistic(long Bytes);
2007-10-08 18:24:48 +02:00
private:
2007-10-08 18:24:48 +02:00
long dataBytes;
cTimeMs timer;
2007-10-08 18:24:48 +02:00
cMutex mutex;
2007-10-05 21:00:44 +02:00
};
2007-10-09 19:58:17 +02:00
// Buffer statistics
class cIptvBufferStatistics {
2007-10-09 19:58:17 +02:00
public:
cIptvBufferStatistics();
virtual ~cIptvBufferStatistics();
cString GetBufferStatistic();
2007-10-09 19:58:17 +02:00
protected:
void AddBufferStatistic(long Bytes, long Used);
2007-10-09 19:58:17 +02:00
private:
2007-10-10 00:12:17 +02:00
long dataBytes;
2007-10-09 19:58:17 +02:00
long freeSpace;
long usedSpace;
cTimeMs timer;
cMutex mutex;
};
2007-10-05 21:00:44 +02:00
#endif // __IPTV_STATISTICS_H