based on server_livefilter-streamer-type.patch by Petri Hintukainen

- Use cStreamer (base class) instead of cLiveStreamer
  (no need to know streamer type)
  * works with cLiveStreamer and cLiveFilterStreamer
  * avoid circular dependency
- visibility of cStreamdevLiveReceiver: Moved from livestreamer.h -> .c
Modified Files:
	server/livefilter.c server/livefilter.h server/livestreamer.c
	server/livestreamer.h
This commit is contained in:
schmirl 2007-04-23 15:44:55 +00:00
parent 6dd3cc412e
commit 0553fce43c
4 changed files with 43 additions and 44 deletions

View File

@ -1,20 +1,24 @@
/*
* $Id: livefilter.c,v 1.2 2005/02/08 13:59:16 lordjaxom Exp $
* $Id: livefilter.c,v 1.3 2007/04/23 15:44:55 schmirl Exp $
*/
#include "server/livefilter.h"
#include "server/livestreamer.h"
#include "server/streamer.h"
#include "common.h"
#ifndef TS_SIZE
# define TS_SIZE 188
#endif
#ifndef TS_SYNC_BYTE
# define TS_SYNC_BYTE 0x47
#endif
#if VDRVERSNUM >= 10300
cStreamdevLiveFilter::cStreamdevLiveFilter(cStreamdevLiveStreamer *Streamer) {
cStreamdevLiveFilter::cStreamdevLiveFilter(cStreamdevStreamer *Streamer) {
m_Streamer = Streamer;
}
cStreamdevLiveFilter::~cStreamdevLiveFilter() {
}
void cStreamdevLiveFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length)
{
uchar buffer[TS_SIZE];

View File

@ -1,5 +1,5 @@
/*
* $Id: livefilter.h,v 1.2 2005/11/07 19:28:41 lordjaxom Exp $
* $Id: livefilter.h,v 1.3 2007/04/23 15:44:55 schmirl Exp $
*/
#ifndef VDR_STREAMEV_LIVEFILTER_H
@ -11,20 +11,17 @@
#include <vdr/filter.h>
class cStreamdevLiveStreamer;
class cStreamdevStreamer;
class cStreamdevLiveFilter: public cFilter {
friend class cStreamdevLiveStreamer;
private:
cStreamdevLiveStreamer *m_Streamer;
cStreamdevStreamer *m_Streamer;
protected:
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length);
public:
cStreamdevLiveFilter(cStreamdevLiveStreamer *Streamer);
virtual ~cStreamdevLiveFilter();
cStreamdevLiveFilter(cStreamdevStreamer *Streamer);
};
# endif // VDRVERSNUM >= 10300

View File

@ -8,12 +8,31 @@
// --- cStreamdevLiveReceiver -------------------------------------------------
class cStreamdevLiveReceiver: public cReceiver {
friend class cStreamdevStreamer;
private:
cStreamdevStreamer *m_Streamer;
protected:
virtual void Activate(bool On);
virtual void Receive(uchar *Data, int Length);
public:
#if VDRVERSNUM < 10500
cStreamdevLiveReceiver::cStreamdevLiveReceiver(cStreamdevLiveStreamer *Streamer, int Ca,
cStreamdevLiveReceiver(cStreamdevStreamer *Streamer, int Ca, int Priority, const int *Pids);
#else
cStreamdevLiveReceiver(cStreamdevStreamer *Streamer, tChannelID ChannelID, int Priority, const int *Pids);
#endif
virtual ~cStreamdevLiveReceiver();
};
#if VDRVERSNUM < 10500
cStreamdevLiveReceiver::cStreamdevLiveReceiver(cStreamdevStreamer *Streamer, int Ca,
int Priority, const int *Pids):
cReceiver(Ca, Priority, 0, Pids),
#else
cStreamdevLiveReceiver::cStreamdevLiveReceiver(cStreamdevLiveStreamer *Streamer, tChannelID ChannelID,
cStreamdevLiveReceiver::cStreamdevLiveReceiver(cStreamdevStreamer *Streamer, tChannelID ChannelID,
int Priority, const int *Pids):
cReceiver(ChannelID, Priority, 0, Pids),
#endif
@ -33,6 +52,13 @@ void cStreamdevLiveReceiver::Receive(uchar *Data, int Length) {
m_Streamer->ReportOverflow(Length - p);
}
inline void cStreamdevLiveReceiver::Activate(bool On)
{
Dprintf("LiveReceiver->Activate(%d)\n", On);
m_Streamer->Activate(On);
}
// --- cStreamdevLiveStreamer -------------------------------------------------
cStreamdevLiveStreamer::cStreamdevLiveStreamer(int Priority):

View File

@ -12,27 +12,7 @@ class cTS2PSRemux;
class cTS2ESRemux;
class cExternRemux;
class cRemux;
// --- cStreamdevLiveReceiver -------------------------------------------------
class cStreamdevLiveReceiver: public cReceiver {
friend class cStreamdevLiveStreamer;
private:
cStreamdevLiveStreamer *m_Streamer;
protected:
virtual void Activate(bool On);
virtual void Receive(uchar *Data, int Length);
public:
#if VDRVERSNUM < 10500
cStreamdevLiveReceiver(cStreamdevLiveStreamer *Streamer, int Ca, int Priority, const int *Pids);
#else
cStreamdevLiveReceiver(cStreamdevLiveStreamer *Streamer, tChannelID ChannelID, int Priority, const int *Pids);
#endif
virtual ~cStreamdevLiveReceiver();
};
class cStreamdevLiveReceiver;
// --- cStreamdevLiveStreamer -------------------------------------------------
@ -70,12 +50,4 @@ public:
virtual std::string Report(void);
};
// --- cStreamdevLiveReceiver reverse inlines ---------------------------------
inline void cStreamdevLiveReceiver::Activate(bool On)
{
Dprintf("LiveReceiver->Activate(%d)\n", On);
m_Streamer->Activate(On);
}
#endif // VDR_STREAMDEV_LIVESTREAMER_H