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.
|
|
|
|
*
|
2007-10-08 18:24:48 +02:00
|
|
|
* $Id: statistics.h,v 1.7 2007/10/08 16:24:48 rahrenbe 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
|
|
|
#include "statisticif.h"
|
|
|
|
|
|
|
|
// Section statistics
|
|
|
|
class cIptvSectionStatistics : public cIptvStatisticIf {
|
|
|
|
public:
|
|
|
|
cIptvSectionStatistics();
|
|
|
|
virtual ~cIptvSectionStatistics();
|
2007-10-07 21:06:33 +02:00
|
|
|
cString GetStatistic();
|
|
|
|
|
2007-10-08 18:24:48 +02:00
|
|
|
protected:
|
|
|
|
void AddStatistic(long Bytes, long Calls);
|
|
|
|
|
2007-10-07 21:06:33 +02:00
|
|
|
private:
|
2007-10-08 18:24:48 +02:00
|
|
|
long filteredData;
|
|
|
|
long numberOfCalls;
|
2007-10-07 21:06:33 +02:00
|
|
|
cTimeMs timer;
|
2007-10-08 18:24:48 +02:00
|
|
|
cMutex mutex;
|
2007-10-05 21:00:44 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
// Device statistics
|
|
|
|
class cIptvDeviceStatistics : public cIptvStatisticIf {
|
|
|
|
public:
|
|
|
|
cIptvDeviceStatistics();
|
|
|
|
virtual ~cIptvDeviceStatistics();
|
2007-10-07 21:06:33 +02:00
|
|
|
cString GetStatistic();
|
2007-10-05 21:00:44 +02:00
|
|
|
|
|
|
|
protected:
|
2007-10-08 18:24:48 +02:00
|
|
|
void AddStatistic(long Bytes, u_short pid, long payload);
|
2007-10-05 21:00:44 +02:00
|
|
|
|
|
|
|
private:
|
2007-10-08 14:25:30 +02:00
|
|
|
struct pidStruct {
|
|
|
|
u_short pid;
|
|
|
|
long DataAmount;
|
|
|
|
};
|
2007-10-08 00:54:09 +02:00
|
|
|
pidStruct mostActivePids[IPTV_STATS_ACTIVE_PIDS_COUNT];
|
2007-10-08 18:24:48 +02:00
|
|
|
long dataBytes;
|
2007-10-07 21:06:33 +02:00
|
|
|
cTimeMs timer;
|
2007-10-08 18:24:48 +02:00
|
|
|
cMutex mutex;
|
2007-10-08 14:25:30 +02:00
|
|
|
|
2007-10-08 18:24:48 +02:00
|
|
|
private:
|
2007-10-08 14:25:30 +02:00
|
|
|
static int SortPids(const void* data1, const void* data2);
|
2007-10-05 21:00:44 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
// Streamer statistics
|
|
|
|
class cIptvStreamerStatistics : public cIptvStatisticIf {
|
|
|
|
public:
|
|
|
|
cIptvStreamerStatistics();
|
|
|
|
virtual ~cIptvStreamerStatistics();
|
2007-10-07 21:06:33 +02:00
|
|
|
cString GetStatistic();
|
|
|
|
|
2007-10-08 18:24:48 +02:00
|
|
|
protected:
|
|
|
|
void AddStatistic(long Bytes);
|
|
|
|
|
2007-10-07 21:06:33 +02:00
|
|
|
private:
|
2007-10-08 18:24:48 +02:00
|
|
|
long dataBytes;
|
2007-10-07 21:06:33 +02:00
|
|
|
cTimeMs timer;
|
2007-10-08 18:24:48 +02:00
|
|
|
cMutex mutex;
|
2007-10-05 21:00:44 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __IPTV_STATISTICS_H
|
|
|
|
|