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"
|
2013-03-27 21:13:15 +01:00
|
|
|
#include "deviceif.h"
|
2007-09-14 17:44:25 +02:00
|
|
|
#include "protocoludp.h"
|
2013-02-23 01:03:27 +01:00
|
|
|
#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"
|
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
|
|
|
|
2013-03-27 21:13:15 +01:00
|
|
|
class cIptvDevice : public cDevice, public cIptvPidStatistics, public cIptvBufferStatistics, public cIptvDeviceIf {
|
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:
|
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;
|
2013-03-27 21:13:15 +01:00
|
|
|
cIptvSectionFilterHandler *pIptvSectionM;
|
2013-02-23 14:31:11 +01:00
|
|
|
cPidScanner *pPidScannerM;
|
|
|
|
cSidScanner *pSidScannerM;
|
|
|
|
cMutex mutexM;
|
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);
|
2007-10-09 01:51:58 +02:00
|
|
|
|
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);
|
2013-02-23 14:31:11 +01:00
|
|
|
bool IsBuffering(void) const;
|
2007-09-12 19:28:59 +02:00
|
|
|
|
2011-06-19 21:07:01 +02:00
|
|
|
// for channel info
|
2012-09-30 17:42:40 +02:00
|
|
|
public:
|
2012-04-02 18:15:53 +02:00
|
|
|
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);
|
2007-09-14 18:10:44 +02:00
|
|
|
|
|
|
|
// for section filtering
|
2007-09-21 00:01:42 +02:00
|
|
|
public:
|
2013-02-23 14:31:11 +01:00
|
|
|
virtual int OpenFilter(u_short pidP, u_char tidP, u_char maskP);
|
|
|
|
virtual void CloseFilter(int handleP);
|
2007-09-21 00:01:42 +02:00
|
|
|
|
|
|
|
// for transponder lock
|
|
|
|
public:
|
2013-02-23 14:31:11 +01:00
|
|
|
virtual bool HasLock(int timeoutMsP) const;
|
2012-09-30 17:42:40 +02:00
|
|
|
|
|
|
|
// for common interface
|
|
|
|
public:
|
|
|
|
virtual bool HasInternalCam(void);
|
2013-03-27 21:13:15 +01:00
|
|
|
|
|
|
|
// for internal device interface
|
|
|
|
public:
|
|
|
|
virtual void WriteData(u_char *bufferP, int lengthP);
|
|
|
|
virtual unsigned int CheckData(void);
|
2007-09-12 19:28:59 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __IPTV_DEVICE_H
|