2010-12-02 08:53:01 +01:00
|
|
|
/*
|
2010-12-02 08:59:14 +01:00
|
|
|
* $Id: device.h,v 1.5 2007/04/24 10:43:40 schmirl Exp $
|
2010-12-02 08:53:01 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef VDR_STREAMDEV_DEVICE_H
|
|
|
|
#define VDR_STREAMDEV_DEVICE_H
|
|
|
|
|
|
|
|
#include <vdr/device.h>
|
|
|
|
|
|
|
|
#include "client/socket.h"
|
|
|
|
#include "client/assembler.h"
|
|
|
|
#include "client/filter.h"
|
|
|
|
|
|
|
|
class cTBString;
|
|
|
|
|
|
|
|
#define CMD_LOCK_OBJ(x) cMutexLock CmdLock((cMutex*)&(x)->m_Mutex)
|
|
|
|
|
|
|
|
class cStreamdevDevice: public cDevice {
|
|
|
|
friend class cRemoteRecordings;
|
|
|
|
|
|
|
|
private:
|
|
|
|
const cChannel *m_Channel;
|
|
|
|
cTSBuffer *m_TSBuffer;
|
|
|
|
cStreamdevAssembler *m_Assembler;
|
|
|
|
#if VDRVERSNUM >= 10307
|
|
|
|
cStreamdevFilters *m_Filters;
|
|
|
|
#endif
|
2010-12-02 08:59:14 +01:00
|
|
|
int m_Pids;
|
|
|
|
bool m_DvrClosed;
|
2010-12-02 08:53:01 +01:00
|
|
|
|
|
|
|
static cStreamdevDevice *m_Device;
|
|
|
|
|
2010-12-02 08:59:14 +01:00
|
|
|
bool OpenDvrInt(void);
|
|
|
|
void CloseDvrInt(void);
|
|
|
|
|
2010-12-02 08:53:01 +01:00
|
|
|
protected:
|
|
|
|
virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView);
|
|
|
|
virtual bool HasLock(int TimeoutMs)
|
|
|
|
{
|
|
|
|
//printf("HasLock is %d\n", (ClientSocket.DataSocket(siLive) != NULL));
|
|
|
|
//return ClientSocket.DataSocket(siLive) != NULL;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual bool SetPid(cPidHandle *Handle, int Type, bool On);
|
|
|
|
virtual bool OpenDvr(void);
|
|
|
|
virtual void CloseDvr(void);
|
|
|
|
virtual bool GetTSPacket(uchar *&Data);
|
|
|
|
|
|
|
|
#if VDRVERSNUM >= 10300
|
|
|
|
virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
public:
|
|
|
|
cStreamdevDevice(void);
|
|
|
|
virtual ~cStreamdevDevice();
|
|
|
|
|
|
|
|
virtual bool ProvidesSource(int Source) const;
|
2010-12-02 08:59:14 +01:00
|
|
|
virtual bool ProvidesTransponder(const cChannel *Channel) const;
|
2010-12-02 08:53:01 +01:00
|
|
|
virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1,
|
|
|
|
bool *NeedsDetachReceivers = NULL) const;
|
2010-12-02 08:59:14 +01:00
|
|
|
virtual bool IsTunedToTransponder(const cChannel *Channel);
|
2010-12-02 08:53:01 +01:00
|
|
|
|
|
|
|
static bool Init(void);
|
|
|
|
static bool ReInit(void);
|
|
|
|
|
|
|
|
static cStreamdevDevice *GetDevice(void) { return m_Device; }
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VDR_STREAMDEV_DEVICE_H
|