vdr-plugin-iptv/device.h

120 lines
3.3 KiB
C
Raw Normal View History

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>
#include "common.h"
2007-09-14 17:44:25 +02:00
#include "protocoludp.h"
#include "protocolcurl.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"
#include "sectionfilter.h"
#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-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);
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
};
2013-02-23 14:31:11 +01:00
unsigned int deviceIndexM;
int dvrFdM;
bool isPacketDeliveredM;
bool isOpenDvrM;
bool sidScanEnabledM;
bool pidScanEnabledM;
cRingBufferLinear *tsBufferM;
mutable int tsBufferPrefillM;
tChannelID channelIdM;
cIptvProtocolUdp *pUdpProtocolM;
cIptvProtocolCurl *pCurlProtocolM;
cIptvProtocolHttp *pHttpProtocolM;
cIptvProtocolFile *pFileProtocolM;
cIptvProtocolExt *pExtProtocolM;
cIptvStreamer *pIptvStreamerM;
cPidScanner *pPidScannerM;
cSidScanner *pSidScannerM;
cMutex mutexM;
cIptvSectionFilter *secFiltersM[eMaxSecFilterCount];
2007-09-12 19:28:59 +02:00
// constructor & destructor
public:
2013-02-23 14:31:11 +01:00
cIptvDevice(unsigned int deviceIndexP);
2007-09-12 19:28:59 +02:00
virtual ~cIptvDevice();
2013-02-23 14:31:11 +01:00
cString GetInformation(unsigned int pageP = IPTV_DEVICE_INFO_ALL);
2008-01-05 00:36:37 +01:00
// copy and assignment constructors
private:
2008-01-05 00:36:37 +01:00
cIptvDevice(const cIptvDevice&);
cIptvDevice& operator=(const cIptvDevice&);
// for statistics and general information
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);
2013-02-23 14:31:11 +01:00
bool IsBuffering(void) const;
bool DeleteFilter(unsigned int indexP);
bool IsBlackListed(u_short pidP, u_char tidP, u_char maskP) const;
2007-09-12 19:28:59 +02:00
2011-06-19 21:07:01 +02:00
// for channel info
public:
virtual cString DeviceType(void) const;
2012-03-25 15:42:06 +02:00
virtual cString DeviceName(void) const;
2011-06-19 21:07:01 +02:00
virtual int SignalStrength(void) const;
virtual int SignalQuality(void) const;
2007-09-12 19:28:59 +02:00
// for channel selection
public:
2013-02-23 14:31:11 +01:00
virtual bool ProvidesSource(int sourceP) const;
virtual bool ProvidesTransponder(const cChannel *channelP) const;
virtual bool ProvidesChannel(const cChannel *channelP, int priorityP = -1, bool *needsDetachReceiversP = 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:
2013-02-23 14:31:11 +01:00
virtual bool SetChannelDevice(const cChannel *channelP, bool liveViewP);
2007-09-12 19:28:59 +02:00
// for recording
protected:
2013-02-23 14:31:11 +01:00
virtual bool SetPid(cPidHandle *handleP, int typeP, bool onP);
2007-09-12 19:28:59 +02:00
virtual bool OpenDvr(void);
virtual void CloseDvr(void);
2013-02-23 14:31:11 +01:00
virtual bool GetTSPacket(uchar *&dataP);
// for section filtering
public:
2013-02-23 14:31:11 +01:00
virtual int OpenFilter(u_short pidP, u_char tidP, u_char maskP);
virtual int ReadFilter(int handleP, void *bufferP, size_t lengthP);
virtual void CloseFilter(int handleP);
// for transponder lock
public:
2013-02-23 14:31:11 +01:00
virtual bool HasLock(int timeoutMsP) const;
// for common interface
public:
virtual bool HasInternalCam(void);
2007-09-12 19:28:59 +02:00
};
#endif // __IPTV_DEVICE_H