2007-09-12 19:28:59 +02:00
|
|
|
/*
|
|
|
|
* device.h: IPTV plugin for the Video Disk Recorder
|
|
|
|
*
|
|
|
|
* See the README file for copyright information and how to reach the author.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __IPTV_DEVICE_H
|
|
|
|
#define __IPTV_DEVICE_H
|
|
|
|
|
|
|
|
#include <vdr/device.h>
|
2007-10-09 01:51:58 +02:00
|
|
|
#include "common.h"
|
2007-09-14 17:44:25 +02:00
|
|
|
#include "protocoludp.h"
|
2007-09-16 11:38:00 +02:00
|
|
|
#include "protocolhttp.h"
|
2007-09-16 14:18:15 +02:00
|
|
|
#include "protocolfile.h"
|
2007-10-15 23:03:45 +02:00
|
|
|
#include "protocolext.h"
|
2007-09-12 19:28:59 +02:00
|
|
|
#include "streamer.h"
|
2007-09-24 15:03:38 +02:00
|
|
|
#include "sectionfilter.h"
|
2008-01-30 23:41:58 +01:00
|
|
|
#include "pidscanner.h"
|
2007-10-01 20:14:57 +02:00
|
|
|
#include "sidscanner.h"
|
2007-10-05 21:00:44 +02:00
|
|
|
#include "statistics.h"
|
2007-09-19 17:14:32 +02:00
|
|
|
|
2007-10-10 00:12:17 +02:00
|
|
|
class cIptvDevice : public cDevice, public cIptvPidStatistics, public cIptvBufferStatistics {
|
2007-09-12 19:28:59 +02:00
|
|
|
// static ones
|
|
|
|
public:
|
|
|
|
static unsigned int deviceCount;
|
|
|
|
static bool Initialize(unsigned int DeviceCount);
|
|
|
|
static unsigned int Count(void);
|
2007-10-06 22:57:53 +02:00
|
|
|
static cIptvDevice *GetIptvDevice(int CardIndex);
|
2007-09-12 19:28:59 +02:00
|
|
|
|
|
|
|
// private parts
|
|
|
|
private:
|
2007-09-19 20:17:30 +02:00
|
|
|
enum {
|
2007-09-24 19:20:58 +02:00
|
|
|
eMaxSecFilterCount = 32
|
2007-09-19 20:17:30 +02:00
|
|
|
};
|
2007-09-12 19:28:59 +02:00
|
|
|
unsigned int deviceIndex;
|
2008-02-17 20:18:47 +01:00
|
|
|
int dvrFd;
|
2007-09-12 19:28:59 +02:00
|
|
|
bool isPacketDelivered;
|
|
|
|
bool isOpenDvr;
|
2008-01-31 23:28:53 +01:00
|
|
|
bool sidScanEnabled;
|
|
|
|
bool pidScanEnabled;
|
2007-09-12 19:28:59 +02:00
|
|
|
cRingBufferLinear *tsBuffer;
|
2007-09-15 23:27:00 +02:00
|
|
|
int tsBufferPrefill;
|
2010-11-29 20:09:17 +01:00
|
|
|
tChannelID channelId;
|
2007-09-14 17:44:25 +02:00
|
|
|
cIptvProtocolUdp *pUdpProtocol;
|
2007-09-16 11:38:00 +02:00
|
|
|
cIptvProtocolHttp *pHttpProtocol;
|
2007-09-16 14:18:15 +02:00
|
|
|
cIptvProtocolFile *pFileProtocol;
|
2007-10-15 23:03:45 +02:00
|
|
|
cIptvProtocolExt *pExtProtocol;
|
2007-09-12 19:28:59 +02:00
|
|
|
cIptvStreamer *pIptvStreamer;
|
2008-01-30 23:41:58 +01:00
|
|
|
cPidScanner *pPidScanner;
|
2007-10-01 20:14:57 +02:00
|
|
|
cSidScanner *pSidScanner;
|
2007-09-12 19:28:59 +02:00
|
|
|
cMutex mutex;
|
2010-11-29 20:09:17 +01:00
|
|
|
cIptvSectionFilter *secfilters[eMaxSecFilterCount];
|
2007-09-12 19:28:59 +02:00
|
|
|
|
|
|
|
// constructor & destructor
|
|
|
|
public:
|
|
|
|
cIptvDevice(unsigned int DeviceIndex);
|
|
|
|
virtual ~cIptvDevice();
|
2007-10-09 01:51:58 +02:00
|
|
|
cString GetInformation(unsigned int Page = IPTV_DEVICE_INFO_ALL);
|
|
|
|
|
2008-01-05 00:36:37 +01:00
|
|
|
// copy and assignment constructors
|
2007-10-09 01:51:58 +02:00
|
|
|
private:
|
2008-01-05 00:36:37 +01:00
|
|
|
cIptvDevice(const cIptvDevice&);
|
|
|
|
cIptvDevice& operator=(const cIptvDevice&);
|
|
|
|
|
|
|
|
// for statistics and general information
|
2007-10-09 01:51:58 +02:00
|
|
|
cString GetGeneralInformation(void);
|
|
|
|
cString GetPidsInformation(void);
|
|
|
|
cString GetFiltersInformation(void);
|
2007-09-12 19:28:59 +02:00
|
|
|
|
2007-09-21 23:50:52 +02:00
|
|
|
// for channel parsing & buffering
|
2007-09-12 19:28:59 +02:00
|
|
|
private:
|
2007-09-21 23:50:52 +02:00
|
|
|
void ResetBuffering(void);
|
|
|
|
bool IsBuffering(void);
|
2007-09-22 10:17:35 +02:00
|
|
|
bool DeleteFilter(unsigned int Index);
|
2009-03-20 23:56:37 +01:00
|
|
|
bool IsBlackListed(u_short Pid, u_char Tid, u_char Mask) const;
|
2007-09-12 19:28:59 +02:00
|
|
|
|
2011-06-19 21:07:01 +02:00
|
|
|
// for channel info
|
|
|
|
virtual int SignalStrength(void) const;
|
|
|
|
virtual int SignalQuality(void) const;
|
|
|
|
|
2007-09-12 19:28:59 +02:00
|
|
|
// for channel selection
|
|
|
|
public:
|
|
|
|
virtual bool ProvidesSource(int Source) const;
|
|
|
|
virtual bool ProvidesTransponder(const cChannel *Channel) const;
|
|
|
|
virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1, bool *NeedsDetachReceivers = NULL) const;
|
2011-09-04 16:58:18 +02:00
|
|
|
virtual bool ProvidesEIT(void) const;
|
2008-01-28 22:36:32 +01:00
|
|
|
virtual int NumProvidedSystems(void) const;
|
2007-09-12 19:28:59 +02:00
|
|
|
protected:
|
|
|
|
virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView);
|
|
|
|
|
|
|
|
// for recording
|
|
|
|
protected:
|
|
|
|
virtual bool SetPid(cPidHandle *Handle, int Type, bool On);
|
|
|
|
virtual bool OpenDvr(void);
|
|
|
|
virtual void CloseDvr(void);
|
|
|
|
virtual bool GetTSPacket(uchar *&Data);
|
2007-09-14 18:10:44 +02:00
|
|
|
|
|
|
|
// for section filtering
|
2007-09-21 00:01:42 +02:00
|
|
|
public:
|
2007-09-14 18:10:44 +02:00
|
|
|
virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask);
|
2007-10-14 20:45:34 +02:00
|
|
|
virtual void CloseFilter(int Handle);
|
2007-09-21 00:01:42 +02:00
|
|
|
|
|
|
|
// for transponder lock
|
|
|
|
public:
|
|
|
|
virtual bool HasLock(int);
|
2007-09-12 19:28:59 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __IPTV_DEVICE_H
|