From ba7c61fb3901eb08eec4662c355f8e4275d68c61 Mon Sep 17 00:00:00 2001 From: Frank Schmirler Date: Sun, 11 Dec 2011 17:03:09 +0100 Subject: Support for non-cycle-free setups (e.g. where two VDRs mutually share their DVB cards through streamdev-client/-server). Must be enabled in streamdev-server setup. Obsoletes recursion patches. --- client/device.c | 3 ++- client/device.h | 2 ++ client/streamdev-client.c | 8 ++++++++ client/streamdev-client.h | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/device.c b/client/device.c index 5d81727..2dec904 100644 --- a/client/device.c +++ b/client/device.c @@ -22,6 +22,7 @@ using namespace std; #define VIDEOBUFSIZE MEGABYTE(3) cStreamdevDevice *cStreamdevDevice::m_Device = NULL; +const cChannel *cStreamdevDevice::m_DenyChannel = NULL; cStreamdevDevice::cStreamdevDevice(void) { m_Channel = NULL; @@ -91,7 +92,7 @@ bool cStreamdevDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool prio = Priority < 0 || Priority > this->Priority(); bool ndr = false; - if (!StreamdevClientSetup.StartClient) + if (!StreamdevClientSetup.StartClient || Channel == m_DenyChannel) return false; Dprintf("ProvidesChannel, Channel=%s, Prio=%d\n", Channel->Name(), Priority); diff --git a/client/device.h b/client/device.h index fe8568f..1b03c43 100644 --- a/client/device.h +++ b/client/device.h @@ -26,6 +26,7 @@ private: bool m_DvrClosed; static cStreamdevDevice *m_Device; + static const cChannel *m_DenyChannel; bool OpenDvrInt(void); void CloseDvrInt(void); @@ -70,6 +71,7 @@ public: virtual int SignalQuality(void) const; static void UpdatePriority(void); + static void DenyChannel(const cChannel *Channel) { m_DenyChannel = Channel; } static bool Init(void); static bool ReInit(void); diff --git a/client/streamdev-client.c b/client/streamdev-client.c index 62c57bd..088837f 100644 --- a/client/streamdev-client.c +++ b/client/streamdev-client.c @@ -52,6 +52,14 @@ bool cPluginStreamdevClient::SetupParse(const char *Name, const char *Value) { return StreamdevClientSetup.SetupParse(Name, Value); } +bool cPluginStreamdevClient::Service(const char *Id, void *Data) { + if (!strcmp(Id, LOOP_PREVENTION_SERVICE)) { + cStreamdevDevice::DenyChannel((const cChannel*) Data); + return true; + } + return false; +} + void cPluginStreamdevClient::MainThreadHook(void) { cStreamdevDevice::UpdatePriority(); } diff --git a/client/streamdev-client.h b/client/streamdev-client.h index 1885ed1..77d8af9 100644 --- a/client/streamdev-client.h +++ b/client/streamdev-client.h @@ -23,6 +23,7 @@ public: virtual cOsdObject *MainMenuAction(void); virtual cMenuSetupPage *SetupMenu(void); virtual bool SetupParse(const char *Name, const char *Value); + virtual bool Service(const char *Id, void *Data = NULL); virtual void MainThreadHook(void); }; -- cgit v1.2.3