Index: livestreamer.h
===================================================================
RCS file: /var/cvsroot/streamdev/server/livestreamer.h,v
retrieving revision 1.11
diff -u -2 -r1.11 livestreamer.h
--- livestreamer.h	23 Apr 2007 15:44:55 -0000	1.11
+++ livestreamer.h	23 Apr 2007 17:44:42 -0000
@@ -6,5 +6,4 @@
 
 #include "server/streamer.h"
-#include "server/livefilter.h"
 #include "common.h"
 
@@ -51,3 +55,42 @@
 };
 
+
+// --- cStreamdevFilterStreamer -------------------------------------------------
+
+#  if VDRVERSNUM >= 10300
+
+//#include <vdr/status.h>
+
+class cStreamdevLiveFilter;
+
+class cStreamdevFilterStreamer: public cStreamdevStreamer /*, public cStatus*/ {
+private:
+	cDevice                *m_Device;
+	cStreamdevLiveFilter   *m_Filter;
+	//const cChannel         *m_Channel;
+
+public:
+	cStreamdevFilterStreamer();
+	virtual ~cStreamdevFilterStreamer();
+
+	void SetDevice(cDevice *Device);
+	//void SetChannel(const cChannel *Channel);
+	bool SetFilter(u_short Pid, u_char Tid, u_char Mask, bool On);
+	
+	virtual void Attach(void);
+	virtual void Detach(void);
+
+	// cStatus message handlers
+	//virtual void ChannelSwitch(const cDevice *Device, int ChannelNumber);
+};
+
+#  endif // if VDRVERSNUM >= 10300
+
 #endif // VDR_STREAMDEV_LIVESTREAMER_H
+
+// Local Variables:
+// c-basic-offset: 8
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=8 sw=8
Index: livestreamer.c
===================================================================
RCS file: /var/cvsroot/streamdev/server/livestreamer.c,v
retrieving revision 1.12
diff -u -1 -r1.12 livestreamer.c
--- livestreamer.c	23 Apr 2007 15:44:55 -0000	1.12
+++ livestreamer.c	23 Apr 2007 17:48:00 -0000
@@ -3,2 +8,3 @@
 #include "server/livestreamer.h"
+#include "server/livefilter.h"
 #include "remux/ts2ps.h"
@@ -323,2 +574,116 @@
 	return result;
 }
+
+// --- cStreamdevFilterStreamer -------------------------------------------------
+
+#if VDRVERSNUM >= 10300
+cStreamdevFilterStreamer::cStreamdevFilterStreamer():
+		cStreamdevStreamer("streamdev-filterstreaming"),
+		m_Device(NULL),
+		m_Filter(NULL)/*,
+		m_Channel(NULL)*/
+{
+}
+
+cStreamdevFilterStreamer::~cStreamdevFilterStreamer() 
+{
+	Dprintf("Desctructing Filter streamer\n");
+	Detach();
+	m_Device = NULL;
+	DELETENULL(m_Filter);
+	Stop();
+}
+
+void cStreamdevFilterStreamer::Attach(void) 
+{ 
+	Dprintf("cStreamdevFilterStreamer::Attach()\n");
+	LOCK_THREAD;
+	if(m_Device && m_Filter)
+		m_Device->AttachFilter(m_Filter);
+}
+
+void cStreamdevFilterStreamer::Detach(void) 
+{ 
+	Dprintf("cStreamdevFilterStreamer::Detach()\n");
+	LOCK_THREAD;
+	if(m_Device && m_Filter)
+		m_Device->Detach(m_Filter); 
+}
+
+#if 0
+void cStreamdevFilterStreamer::SetChannel(const cChannel *Channel)
+{
+	LOCK_THREAD;
+	Dprintf("cStreamdevFilterStreamer::SetChannel(%s : %s)", Channel?Channel->Name():"<null>",
+		Channel ? *Channel->GetChannelID().ToString() : "");
+	m_Channel = Channel;
+}
+#endif
+
+void cStreamdevFilterStreamer::SetDevice(cDevice *Device)
+{
+	Dprintf("cStreamdevFilterStreamer::SetDevice()\n");
+	LOCK_THREAD;
+	if(Device != m_Device) {
+		Detach();
+		m_Device = Device;
+		//m_Channel = NULL;
+		Attach();
+	}
+}
+
+bool cStreamdevFilterStreamer::SetFilter(u_short Pid, u_char Tid, u_char Mask, bool On) 
+{	
+	Dprintf("cStreamdevFilterStreamer::SetFilter(%u,0x%x,0x%x,%s)\n", Pid, Tid, Mask, On?"On":"Off");
+
+	if(!m_Device)
+		return false;
+
+	if (On) {
+		if (m_Filter == NULL) {
+			m_Filter = new cStreamdevLiveFilter(this);
+			Dprintf("attaching filter to device\n");
+			Attach();
+		}
+		m_Filter->Set(Pid, Tid, Mask);
+	} else if (m_Filter != NULL) 
+		m_Filter->Del(Pid, Tid, Mask);
+
+	return true;
+}
+
+#if 0
+void cStreamdevFilterStreamer::ChannelSwitch(const cDevice *Device, int ChannelNumber) {
+	LOCK_THREAD;
+	if(Device == m_Device) {
+		if(ChannelNumber > 0) {
+			cChannel *ch = Channels.GetByNumber(ChannelNumber);
+			if(ch != NULL) {
+				if(m_Filter != NULL &&
+				   m_Channel != NULL &&
+				   (! TRANSPONDER(ch, m_Channel))) {
+					
+					isyslog("***** LiveFilterStreamer: transponder changed ! %s",
+						*ch->GetChannelID().ToString());
+
+					uchar buffer[TS_SIZE] = {TS_SYNC_BYTE, 0xff, 0xff, 0xff, 0x7f, 0};
+					strcpy((char*)(buffer + 5), ch->GetChannelID().ToString());
+					int p = Put(buffer, TS_SIZE);
+					if (p != TS_SIZE)
+						ReportOverflow(TS_SIZE - p);
+				}
+				m_Channel = ch;
+			}
+		}
+	}
+}
+#endif
+
+#endif // if VDRVERSNUM >= 10300
+
+// Local Variables:
+// c-basic-offset: 8
+// indent-tabs-mode: t
+// End:
+//
+// vim: et sts=8 sw=8
