2004-12-30 23:43:55 +01:00
|
|
|
/*
|
2010-12-02 09:57:17 +01:00
|
|
|
* $Id: device.h,v 1.10 2010/08/18 10:26:55 schmirl Exp $
|
2004-12-30 23:43:55 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef VDR_STREAMDEV_DEVICE_H
|
|
|
|
#define VDR_STREAMDEV_DEVICE_H
|
|
|
|
|
|
|
|
#include <vdr/device.h>
|
|
|
|
|
|
|
|
#include "client/socket.h"
|
|
|
|
#include "client/filter.h"
|
|
|
|
|
|
|
|
class cTBString;
|
|
|
|
|
|
|
|
#define CMD_LOCK_OBJ(x) cMutexLock CmdLock((cMutex*)&(x)->m_Mutex)
|
|
|
|
|
|
|
|
class cStreamdevDevice: public cDevice {
|
|
|
|
|
|
|
|
private:
|
2013-01-29 00:02:17 +01:00
|
|
|
bool m_Disabled;
|
|
|
|
cClientSocket *m_ClientSocket;
|
2004-12-30 23:43:55 +01:00
|
|
|
const cChannel *m_Channel;
|
|
|
|
cTSBuffer *m_TSBuffer;
|
|
|
|
cStreamdevFilters *m_Filters;
|
2007-04-24 12:43:40 +02:00
|
|
|
int m_Pids;
|
2004-12-30 23:43:55 +01:00
|
|
|
|
2011-12-11 17:03:09 +01:00
|
|
|
static const cChannel *m_DenyChannel;
|
2004-12-30 23:43:55 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView);
|
2013-02-18 12:43:02 +01:00
|
|
|
#if APIVERSNUM >= 10738
|
|
|
|
virtual bool HasLock(int TimeoutMs) const
|
|
|
|
#else
|
|
|
|
virtual bool HasLock(int TimeoutMs)
|
|
|
|
#endif
|
2005-02-08 16:21:19 +01:00
|
|
|
{
|
|
|
|
//printf("HasLock is %d\n", (ClientSocket.DataSocket(siLive) != NULL));
|
|
|
|
//return ClientSocket.DataSocket(siLive) != NULL;
|
|
|
|
return true;
|
|
|
|
}
|
2004-12-30 23:43:55 +01:00
|
|
|
|
|
|
|
virtual bool SetPid(cPidHandle *Handle, int Type, bool On);
|
|
|
|
virtual bool OpenDvr(void);
|
|
|
|
virtual void CloseDvr(void);
|
|
|
|
virtual bool GetTSPacket(uchar *&Data);
|
|
|
|
|
|
|
|
virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask);
|
|
|
|
|
|
|
|
public:
|
|
|
|
cStreamdevDevice(void);
|
|
|
|
virtual ~cStreamdevDevice();
|
|
|
|
|
2008-10-02 09:14:47 +02:00
|
|
|
virtual bool HasInternalCam(void) { return true; }
|
2004-12-30 23:43:55 +01:00
|
|
|
virtual bool ProvidesSource(int Source) const;
|
2007-04-23 13:42:16 +02:00
|
|
|
virtual bool ProvidesTransponder(const cChannel *Channel) const;
|
2004-12-30 23:43:55 +01:00
|
|
|
virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1,
|
|
|
|
bool *NeedsDetachReceivers = NULL) const;
|
2009-06-23 12:26:54 +02:00
|
|
|
#if APIVERSNUM >= 10700
|
2011-02-16 08:57:05 +01:00
|
|
|
virtual int NumProvidedSystems(void) const;
|
2011-09-10 00:08:04 +02:00
|
|
|
#endif
|
|
|
|
#if APIVERSNUM >= 10719
|
|
|
|
virtual bool AvoidRecording(void) const { return true; }
|
2009-06-23 12:26:54 +02:00
|
|
|
#endif
|
2011-12-09 09:05:09 +01:00
|
|
|
#if APIVERSNUM >= 10722
|
|
|
|
virtual bool IsTunedToTransponder(const cChannel *Channel) const;
|
|
|
|
#else
|
2007-04-23 13:42:16 +02:00
|
|
|
virtual bool IsTunedToTransponder(const cChannel *Channel);
|
2011-12-09 09:05:09 +01:00
|
|
|
#endif
|
2012-06-07 19:23:14 +02:00
|
|
|
virtual cString DeviceName(void) const;
|
|
|
|
virtual cString DeviceType(void) const;
|
2011-07-06 09:13:50 +02:00
|
|
|
virtual int SignalStrength(void) const;
|
|
|
|
virtual int SignalQuality(void) const;
|
2004-12-30 23:43:55 +01:00
|
|
|
|
2013-01-29 00:02:17 +01:00
|
|
|
bool ReInit(bool Disable);
|
|
|
|
void UpdatePriority(bool SwitchingChannels = false) const;
|
|
|
|
bool SuspendServer() { return m_ClientSocket->SuspendServer(); }
|
2011-12-11 17:03:09 +01:00
|
|
|
static void DenyChannel(const cChannel *Channel) { m_DenyChannel = Channel; }
|
2004-12-30 23:43:55 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VDR_STREAMDEV_DEVICE_H
|