2004-12-30 23:43:55 +01:00
|
|
|
#ifndef VDR_STREAMDEV_LIVESTREAMER_H
|
|
|
|
#define VDR_STREAMDEV_LIVESTREAMER_H
|
|
|
|
|
|
|
|
#include <vdr/config.h>
|
|
|
|
#include <vdr/receiver.h>
|
|
|
|
|
|
|
|
#include "server/streamer.h"
|
|
|
|
#include "common.h"
|
|
|
|
|
2012-12-16 12:40:44 +01:00
|
|
|
#define LIVEBUFSIZE (20000 * TS_SIZE)
|
|
|
|
|
2009-06-19 08:32:38 +02:00
|
|
|
namespace Streamdev {
|
2009-06-30 08:04:33 +02:00
|
|
|
class cTSRemux;
|
2009-06-19 08:32:38 +02:00
|
|
|
}
|
2007-04-24 13:13:05 +02:00
|
|
|
class cStreamdevPatFilter;
|
2007-04-23 17:44:55 +02:00
|
|
|
class cStreamdevLiveReceiver;
|
2004-12-30 23:43:55 +01:00
|
|
|
|
2005-02-10 23:24:26 +01:00
|
|
|
// --- cStreamdevLiveStreamer -------------------------------------------------
|
|
|
|
|
2004-12-30 23:43:55 +01:00
|
|
|
class cStreamdevLiveStreamer: public cStreamdevStreamer {
|
|
|
|
private:
|
|
|
|
int m_Priority;
|
2005-02-08 14:59:16 +01:00
|
|
|
int m_Pids[MAXRECEIVEPIDS + 1];
|
|
|
|
int m_NumPids;
|
2005-02-09 20:47:09 +01:00
|
|
|
eStreamType m_StreamType;
|
2004-12-30 23:43:55 +01:00
|
|
|
const cChannel *m_Channel;
|
|
|
|
cDevice *m_Device;
|
|
|
|
cStreamdevLiveReceiver *m_Receiver;
|
2012-12-16 12:40:44 +01:00
|
|
|
cStreamdevBuffer *m_ReceiveBuffer;
|
2007-04-24 13:13:05 +02:00
|
|
|
cStreamdevPatFilter *m_PatFilter;
|
2009-06-30 08:04:33 +02:00
|
|
|
Streamdev::cTSRemux *m_Remux;
|
2004-12-30 23:43:55 +01:00
|
|
|
|
2007-04-24 13:13:05 +02:00
|
|
|
void StartReceiver(void);
|
|
|
|
bool HasPid(int Pid);
|
|
|
|
|
2012-12-16 12:40:44 +01:00
|
|
|
protected:
|
|
|
|
virtual uchar* GetFromReceiver(int &Count) { return m_ReceiveBuffer->Get(Count); }
|
|
|
|
virtual void DelFromReceiver(int Count) { m_ReceiveBuffer->Del(Count); }
|
|
|
|
|
|
|
|
virtual int Put(const uchar *Data, int Count);
|
|
|
|
|
2004-12-30 23:43:55 +01:00
|
|
|
public:
|
2010-12-02 09:57:17 +01:00
|
|
|
cStreamdevLiveStreamer(int Priority, const cServerConnection *Connection);
|
2004-12-30 23:43:55 +01:00
|
|
|
virtual ~cStreamdevLiveStreamer();
|
|
|
|
|
|
|
|
void SetDevice(cDevice *Device) { m_Device = Device; }
|
|
|
|
bool SetPid(int Pid, bool On);
|
2007-04-24 13:13:05 +02:00
|
|
|
bool SetPids(int Pid, const int *Pids1 = NULL, const int *Pids2 = NULL, const int *Pids3 = NULL);
|
2010-12-02 09:57:17 +01:00
|
|
|
bool SetChannel(const cChannel *Channel, eStreamType StreamType, const int* Apid = NULL, const int* Dpid = NULL);
|
|
|
|
void SetPriority(int Priority);
|
2011-07-06 09:13:50 +02:00
|
|
|
void GetSignal(int *DevNum, int *Strength, int *Quality) const;
|
2012-12-16 13:29:15 +01:00
|
|
|
virtual cString ToText() const;
|
2004-12-30 23:43:55 +01:00
|
|
|
|
2012-12-16 12:40:44 +01:00
|
|
|
void Receive(uchar *Data, int Length);
|
2012-12-16 13:21:19 +01:00
|
|
|
virtual bool IsReceiving(void) const;
|
|
|
|
|
2005-02-09 20:47:09 +01:00
|
|
|
virtual uchar *Get(int &Count);
|
|
|
|
virtual void Del(int Count);
|
|
|
|
|
2005-03-12 13:54:19 +01:00
|
|
|
virtual void Attach(void);
|
|
|
|
virtual void Detach(void);
|
2004-12-30 23:43:55 +01:00
|
|
|
|
|
|
|
// Statistical purposes:
|
2005-02-08 18:22:35 +01:00
|
|
|
virtual std::string Report(void);
|
2004-12-30 23:43:55 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VDR_STREAMDEV_LIVESTREAMER_H
|