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.
This commit is contained in:
Frank Schmirler
2011-12-11 17:03:09 +01:00
parent 6a971b9145
commit ba7c61fb39
21 changed files with 89 additions and 182 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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();
}

View File

@@ -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);
};