2007-09-12 17:28:59 +00: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-08 23:51:58 +00:00
|
|
|
#include "common.h"
|
2007-09-14 15:44:25 +00:00
|
|
|
#include "protocoludp.h"
|
2013-02-23 02:03:27 +02:00
|
|
|
#include "protocolcurl.h"
|
2007-09-16 09:38:00 +00:00
|
|
|
#include "protocolhttp.h"
|
2007-09-16 12:18:15 +00:00
|
|
|
#include "protocolfile.h"
|
2007-10-15 21:03:45 +00:00
|
|
|
#include "protocolext.h"
|
2007-09-12 17:28:59 +00:00
|
|
|
#include "streamer.h"
|
2007-09-24 13:03:38 +00:00
|
|
|
#include "sectionfilter.h"
|
2008-01-30 22:41:58 +00:00
|
|
|
#include "pidscanner.h"
|
2007-10-01 18:14:57 +00:00
|
|
|
#include "sidscanner.h"
|
2007-10-05 19:00:44 +00:00
|
|
|
#include "statistics.h"
|
2007-09-19 15:14:32 +00:00
|
|
|
|
2007-10-09 22:12:17 +00:00
|
|
|
class cIptvDevice : public cDevice, public cIptvPidStatistics, public cIptvBufferStatistics {
|
2007-09-12 17:28:59 +00:00
|
|
|
// static ones
|
|
|
|
public:
|
|
|
|
static unsigned int deviceCount;
|
|
|
|
static bool Initialize(unsigned int DeviceCount);
|
|
|
|
static unsigned int Count(void);
|
2007-10-06 20:57:53 +00:00
|
|
|
static cIptvDevice *GetIptvDevice(int CardIndex);
|
2007-09-12 17:28:59 +00:00
|
|
|
|
|
|
|
// private parts
|
|
|
|
private:
|
2007-09-19 18:17:30 +00:00
|
|
|
enum {
|
2007-09-24 17:20:58 +00:00
|
|
|
eMaxSecFilterCount = 32
|
2007-09-19 18:17:30 +00:00
|
|
|
};
|
2013-02-23 15:31:11 +02: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 17:28:59 +00:00
|
|
|
|
|
|
|
// constructor & destructor
|
|
|
|
public:
|
2013-02-23 15:31:11 +02:00
|
|
|
cIptvDevice(unsigned int deviceIndexP);
|
2007-09-12 17:28:59 +00:00
|
|
|
virtual ~cIptvDevice();
|
2013-02-23 15:31:11 +02:00
|
|
|
cString GetInformation(unsigned int pageP = IPTV_DEVICE_INFO_ALL);
|
2007-10-08 23:51:58 +00:00
|
|
|
|
2008-01-04 23:36:37 +00:00
|
|
|
// copy and assignment constructors
|
2007-10-08 23:51:58 +00:00
|
|
|
private:
|
2008-01-04 23:36:37 +00:00
|
|
|
cIptvDevice(const cIptvDevice&);
|
|
|
|
cIptvDevice& operator=(const cIptvDevice&);
|
|
|
|
|
|
|
|
// for statistics and general information
|
2007-10-08 23:51:58 +00:00
|
|
|
cString GetGeneralInformation(void);
|
|
|
|
cString GetPidsInformation(void);
|
|
|
|
cString GetFiltersInformation(void);
|
2007-09-12 17:28:59 +00:00
|
|
|
|
2007-09-21 21:50:52 +00:00
|
|
|
// for channel parsing & buffering
|
2007-09-12 17:28:59 +00:00
|
|
|
private:
|
2007-09-21 21:50:52 +00:00
|
|
|
void ResetBuffering(void);
|
2013-02-23 15:31:11 +02: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 17:28:59 +00:00
|
|
|
|
2011-06-19 22:07:01 +03:00
|
|
|
// for channel info
|
2012-09-30 18:42:40 +03:00
|
|
|
public:
|
2012-04-02 19:15:53 +03:00
|
|
|
virtual cString DeviceType(void) const;
|
2012-03-25 16:42:06 +03:00
|
|
|
virtual cString DeviceName(void) const;
|
2011-06-19 22:07:01 +03:00
|
|
|
virtual int SignalStrength(void) const;
|
|
|
|
virtual int SignalQuality(void) const;
|
|
|
|
|
2007-09-12 17:28:59 +00:00
|
|
|
// for channel selection
|
|
|
|
public:
|
2013-02-23 15:31:11 +02: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 17:58:18 +03:00
|
|
|
virtual bool ProvidesEIT(void) const;
|
2008-01-28 21:36:32 +00:00
|
|
|
virtual int NumProvidedSystems(void) const;
|
2007-09-12 17:28:59 +00:00
|
|
|
protected:
|
2013-02-23 15:31:11 +02:00
|
|
|
virtual bool SetChannelDevice(const cChannel *channelP, bool liveViewP);
|
2007-09-12 17:28:59 +00:00
|
|
|
|
|
|
|
// for recording
|
|
|
|
protected:
|
2013-02-23 15:31:11 +02:00
|
|
|
virtual bool SetPid(cPidHandle *handleP, int typeP, bool onP);
|
2007-09-12 17:28:59 +00:00
|
|
|
virtual bool OpenDvr(void);
|
|
|
|
virtual void CloseDvr(void);
|
2013-02-23 15:31:11 +02:00
|
|
|
virtual bool GetTSPacket(uchar *&dataP);
|
2007-09-14 16:10:44 +00:00
|
|
|
|
|
|
|
// for section filtering
|
2007-09-20 22:01:42 +00:00
|
|
|
public:
|
2013-02-23 15:31:11 +02: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);
|
2007-09-20 22:01:42 +00:00
|
|
|
|
|
|
|
// for transponder lock
|
|
|
|
public:
|
2013-02-23 15:31:11 +02:00
|
|
|
virtual bool HasLock(int timeoutMsP) const;
|
2012-09-30 18:42:40 +03:00
|
|
|
|
|
|
|
// for common interface
|
|
|
|
public:
|
|
|
|
virtual bool HasInternalCam(void);
|
2007-09-12 17:28:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __IPTV_DEVICE_H
|