vdr-plugin-streamdev/server/livestreamer.h

78 lines
2.1 KiB
C
Raw Normal View History

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 "server/livefilter.h"
#include "common.h"
2005-02-11 17:44:14 +01:00
class cTS2PSRemux;
class cTS2ESRemux;
class cExternRemux;
2005-02-09 20:47:09 +01:00
class cRemux;
2004-12-30 23:43:55 +01:00
// --- cStreamdevLiveReceiver -------------------------------------------------
2004-12-30 23:43:55 +01:00
class cStreamdevLiveReceiver: public cReceiver {
friend class cStreamdevLiveStreamer;
private:
cStreamdevLiveStreamer *m_Streamer;
protected:
2005-02-08 20:54:52 +01:00
virtual void Activate(bool On);
2004-12-30 23:43:55 +01:00
virtual void Receive(uchar *Data, int Length);
public:
cStreamdevLiveReceiver(cStreamdevLiveStreamer *Streamer, int Ca, int Priority, const int *Pids);
2004-12-30 23:43:55 +01:00
virtual ~cStreamdevLiveReceiver();
};
// --- 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;
2005-02-09 20:47:09 +01:00
cRemux *m_PESRemux;
2005-02-11 17:44:14 +01:00
cTS2ESRemux *m_ESRemux;
cTS2PSRemux *m_PSRemux;
cExternRemux *m_ExtRemux;
2004-12-30 23:43:55 +01:00
public:
cStreamdevLiveStreamer(int Priority);
virtual ~cStreamdevLiveStreamer();
void SetDevice(cDevice *Device) { m_Device = Device; }
bool SetPid(int Pid, bool On);
bool SetChannel(const cChannel *Channel, eStreamType StreamType, int Apid = 0);
2004-12-30 23:43:55 +01:00
bool SetFilter(u_short Pid, u_char Tid, u_char Mask, bool On);
2005-02-09 20:47:09 +01:00
virtual int Put(const uchar *Data, int Count);
virtual uchar *Get(int &Count);
virtual void Del(int Count);
2005-02-11 17:44:14 +01:00
virtual void Attach(void) { m_Device->AttachReceiver(m_Receiver); }
virtual void Detach(void) { m_Device->Detach(m_Receiver); }
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
};
// --- cStreamdevLiveReceiver reverse inlines ---------------------------------
inline void cStreamdevLiveReceiver::Activate(bool On)
{
2005-02-11 17:44:14 +01:00
Dprintf("LiveReceiver->Activate(%d)\n", On);
m_Streamer->Activate(On);
}
2004-12-30 23:43:55 +01:00
#endif // VDR_STREAMDEV_LIVESTREAMER_H