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.
|
|
|
|
*
|
2007-09-19 17:14:32 +02:00
|
|
|
* $Id: device.h,v 1.10 2007/09/19 15:14:32 ajhseppa Exp $
|
2007-09-12 19:28:59 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __IPTV_DEVICE_H
|
|
|
|
#define __IPTV_DEVICE_H
|
|
|
|
|
|
|
|
#include <vdr/device.h>
|
2007-09-14 17:44:25 +02:00
|
|
|
#include "protocoludp.h"
|
|
|
|
//#include "protocolrtsp.h"
|
2007-09-16 11:38:00 +02:00
|
|
|
#include "protocolhttp.h"
|
2007-09-16 14:18:15 +02:00
|
|
|
#include "protocolfile.h"
|
2007-09-12 19:28:59 +02:00
|
|
|
#include "streamer.h"
|
|
|
|
|
2007-09-19 17:14:32 +02:00
|
|
|
#include "pidfilter.h"
|
|
|
|
|
|
|
|
struct filterInfo {
|
|
|
|
bool active;
|
|
|
|
int fifoDesc;
|
|
|
|
char pipeName[128];
|
|
|
|
int lastProvided;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-09-12 19:28:59 +02:00
|
|
|
class cIptvDevice : public cDevice {
|
|
|
|
// static ones
|
|
|
|
public:
|
|
|
|
static unsigned int deviceCount;
|
|
|
|
static bool Initialize(unsigned int DeviceCount);
|
|
|
|
static unsigned int Count(void);
|
|
|
|
static cIptvDevice *Get(unsigned int DeviceIndex);
|
|
|
|
|
|
|
|
// private parts
|
|
|
|
private:
|
|
|
|
unsigned int deviceIndex;
|
|
|
|
bool isPacketDelivered;
|
|
|
|
bool isOpenDvr;
|
|
|
|
cRingBufferLinear *tsBuffer;
|
2007-09-15 23:27:00 +02:00
|
|
|
int tsBufferPrefill;
|
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-09-16 15:11:19 +02:00
|
|
|
//cIptvProtocolRtsp *pRtspProtocol;
|
2007-09-12 19:28:59 +02:00
|
|
|
cIptvStreamer *pIptvStreamer;
|
|
|
|
cMutex mutex;
|
2007-09-19 17:14:32 +02:00
|
|
|
trans filter;
|
|
|
|
filterInfo filters[32];
|
2007-09-12 19:28:59 +02:00
|
|
|
|
|
|
|
// constructor & destructor
|
|
|
|
public:
|
|
|
|
cIptvDevice(unsigned int DeviceIndex);
|
|
|
|
virtual ~cIptvDevice();
|
|
|
|
|
|
|
|
// for channel parsing
|
|
|
|
private:
|
2007-09-14 17:44:25 +02:00
|
|
|
cString GetChannelSettings(const char *Param, int *IpPort, cIptvProtocolIf* *Protocol);
|
2007-09-12 19:28:59 +02:00
|
|
|
bool ProvidesIptv(const char *Param) const;
|
|
|
|
|
|
|
|
// 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;
|
|
|
|
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
|
|
|
|
virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask);
|
2007-09-12 19:28:59 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __IPTV_DEVICE_H
|
|
|
|
|