1
0
mirror of https://github.com/rofafor/vdr-plugin-iptv.git synced 2023-10-10 13:37:03 +02:00
vdr-plugin-iptv/device.h

123 lines
3.4 KiB
C
Raw Permalink 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"
#include "deviceif.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"
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 void Shutdown(void);
2007-09-12 19:28:59 +02:00
static unsigned int Count(void);
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;
cChannel channelM;
2013-02-23 14:31:11 +01:00
cIptvProtocolUdp *pUdpProtocolM;
cIptvProtocolCurl *pCurlProtocolM;
cIptvProtocolHttp *pHttpProtocolM;
cIptvProtocolFile *pFileProtocolM;
cIptvProtocolExt *pExtProtocolM;
cIptvStreamer *pIptvStreamerM;
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);
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
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;
virtual const cChannel *GetCurrentlyTunedTransponder(void) const;
virtual bool IsTunedToTransponder(const cChannel *channelP) const;
virtual bool MaySwitchTransponder(const cChannel *channelP) 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
2014-01-28 16:10:11 +01:00
private:
uchar *GetData(int *availableP = NULL);
void SkipData(int countP);
2007-09-12 19:28:59 +02:00
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 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);
// 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