diff options
author | Frank Schmirler <vdr@schmirler.de> | 2011-12-11 17:03:09 +0100 |
---|---|---|
committer | Frank Schmirler <vdr@schmirler.de> | 2011-12-11 17:03:09 +0100 |
commit | ba7c61fb3901eb08eec4662c355f8e4275d68c61 (patch) | |
tree | 12204dc365624ea9ffea96e084b7b1586da8f541 /client | |
parent | 6a971b9145b1be99039b653c44b0884de687110f (diff) | |
download | vdr-plugin-streamdev-ba7c61fb3901eb08eec4662c355f8e4275d68c61.tar.gz vdr-plugin-streamdev-ba7c61fb3901eb08eec4662c355f8e4275d68c61.tar.bz2 |
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.
Diffstat (limited to 'client')
-rw-r--r-- | client/device.c | 3 | ||||
-rw-r--r-- | client/device.h | 2 | ||||
-rw-r--r-- | client/streamdev-client.c | 8 | ||||
-rw-r--r-- | client/streamdev-client.h | 1 |
4 files changed, 13 insertions, 1 deletions
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); }; |