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 /server | |
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 'server')
-rw-r--r-- | server/connectionVTP.c | 24 | ||||
-rw-r--r-- | server/connectionVTP.h | 1 | ||||
-rw-r--r-- | server/po/de_DE.po | 5 | ||||
-rw-r--r-- | server/po/es_ES.po | 5 | ||||
-rw-r--r-- | server/po/fi_FI.po | 5 | ||||
-rw-r--r-- | server/po/fr_FR.po | 5 | ||||
-rw-r--r-- | server/po/it_IT.po | 5 | ||||
-rw-r--r-- | server/po/lt_LT.po | 5 | ||||
-rw-r--r-- | server/po/ru_RU.po | 5 | ||||
-rw-r--r-- | server/po/sk_SK.po | 5 | ||||
-rw-r--r-- | server/setup.c | 5 | ||||
-rw-r--r-- | server/setup.h | 1 |
12 files changed, 63 insertions, 8 deletions
diff --git a/server/connectionVTP.c b/server/connectionVTP.c index 71fa43f..8515e61 100644 --- a/server/connectionVTP.c +++ b/server/connectionVTP.c @@ -732,8 +732,24 @@ bool cLSTRHandler::Next(bool &Last) return false; } +class cStreamdevLoopPrevention { +private: + bool Unlock; +public: + cStreamdevLoopPrevention(const cChannel* Channel, bool LoopPrevention): Unlock(LoopPrevention) { + if (LoopPrevention) + cPluginManager::CallAllServices(LOOP_PREVENTION_SERVICE, (void *)Channel); + } + ~cStreamdevLoopPrevention() { + if (Unlock) + cPluginManager::CallAllServices(LOOP_PREVENTION_SERVICE, NULL); + } +}; + // --- cConnectionVTP --------------------------------------------------------- +#define LOOP_PREVENTION(c) cStreamdevLoopPrevention LoopPrevention(c, m_LoopPrevention); + cConnectionVTP::cConnectionVTP(void): cServerConnection("VTP"), m_LiveSocket(NULL), @@ -753,6 +769,10 @@ cConnectionVTP::cConnectionVTP(void): m_LSTTHandler(NULL), m_LSTRHandler(NULL) { + m_LoopPrevention = StreamdevServerSetup.LoopPrevention; + if (m_LoopPrevention) + // Loop prevention enabled - but is there anybody out there? + m_LoopPrevention = cPluginManager::CallFirstService(LOOP_PREVENTION_SERVICE); } cConnectionVTP::~cConnectionVTP() @@ -921,6 +941,8 @@ bool cConnectionVTP::CmdPROV(char *Opts) if ((chan = ChannelFromString(Opts)) == NULL) return Respond(550, "Undefined channel \"%s\"", Opts); + LOOP_PREVENTION(chan); + if (ProvidesChannel(chan, prio)) { m_TuneChannel = chan; m_TunePriority = prio; @@ -1088,6 +1110,8 @@ bool cConnectionVTP::CmdTUNE(char *Opts) if ((chan = ChannelFromString(Opts)) == NULL) return Respond(550, "Undefined channel \"%s\"", Opts); + LOOP_PREVENTION(chan); + if (chan != m_TuneChannel) { isyslog("streamdev-server TUNE %s: Priority unknown - using 0", Opts); prio = 0; diff --git a/server/connectionVTP.h b/server/connectionVTP.h index 9aab650..5a5f4b2 100644 --- a/server/connectionVTP.h +++ b/server/connectionVTP.h @@ -29,6 +29,7 @@ private: char *m_LastCommand; eStreamType m_StreamType; bool m_FiltersSupport; + bool m_LoopPrevention; RecPlayer *m_RecPlayer; // Priority is only known in PROV command diff --git a/server/po/de_DE.po b/server/po/de_DE.po index 382d0c0..374e79e 100644 --- a/server/po/de_DE.po +++ b/server/po/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: streamdev 0.5.0\n" "Report-Msgid-Bugs-To: <http://www.vdr-developer.org/mantisbt/>\n" -"POT-Creation-Date: 2011-12-08 12:50+0100\n" +"POT-Creation-Date: 2011-12-11 11:25+0100\n" "PO-Revision-Date: 2008-03-30 02:11+0200\n" "Last-Translator: Frank Schmirler <vdrdev@schmirler.de>\n" "Language-Team: <vdr@linuxtv.org>\n" @@ -66,6 +66,9 @@ msgstr "Port des VDR-zu-VDR Servers" msgid "Bind to IP" msgstr "Binde an IP" +msgid "Loop Prevention" +msgstr "Schleifen verhindern" + msgid "HTTP Server" msgstr "HTTP Server" diff --git a/server/po/es_ES.po b/server/po/es_ES.po index 1a4c6af..b8f8da7 100644 --- a/server/po/es_ES.po +++ b/server/po/es_ES.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: streamdev 0.5.0\n" "Report-Msgid-Bugs-To: <http://www.vdr-developer.org/mantisbt/>\n" -"POT-Creation-Date: 2011-12-08 12:50+0100\n" +"POT-Creation-Date: 2011-12-11 11:25+0100\n" "PO-Revision-Date: 2010-06-19 03:58+0100\n" "Last-Translator: Javier Bradineras <jbradi@hotmail.com>\n" "Language-Team: <vdr@linuxtv.org>\n" @@ -66,6 +66,9 @@ msgstr "Puerto del Servidor VDR-a-VDR" msgid "Bind to IP" msgstr "IP asociada" +msgid "Loop Prevention" +msgstr "" + msgid "HTTP Server" msgstr "Servidor HTTP" diff --git a/server/po/fi_FI.po b/server/po/fi_FI.po index f04a833..1abd208 100644 --- a/server/po/fi_FI.po +++ b/server/po/fi_FI.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: streamdev 0.5.0\n" "Report-Msgid-Bugs-To: <http://www.vdr-developer.org/mantisbt/>\n" -"POT-Creation-Date: 2011-12-08 12:50+0100\n" +"POT-Creation-Date: 2011-12-11 11:25+0100\n" "PO-Revision-Date: 2008-03-30 02:11+0200\n" "Last-Translator: Rolf Ahrenberg\n" "Language-Team: Finnish <vdr@linuxtv.org>\n" @@ -67,6 +67,9 @@ msgstr "VDR-palvelimen portti" msgid "Bind to IP" msgstr "Sido osoitteeseen" +msgid "Loop Prevention" +msgstr "" + msgid "HTTP Server" msgstr "HTTP-palvelin" diff --git a/server/po/fr_FR.po b/server/po/fr_FR.po index 70b5c60..aeb85e7 100644 --- a/server/po/fr_FR.po +++ b/server/po/fr_FR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: streamdev 0.5.0\n" "Report-Msgid-Bugs-To: <http://www.vdr-developer.org/mantisbt/>\n" -"POT-Creation-Date: 2011-12-08 12:50+0100\n" +"POT-Creation-Date: 2011-12-11 11:25+0100\n" "PO-Revision-Date: 2008-03-30 02:11+0200\n" "Last-Translator: micky979 <micky979@free.fr>\n" "Language-Team: <vdr@linuxtv.org>\n" @@ -66,6 +66,9 @@ msgstr "Port du serveur VDR-to-VDR" msgid "Bind to IP" msgstr "Attacher aux IP" +msgid "Loop Prevention" +msgstr "" + msgid "HTTP Server" msgstr "Serveur HTTP" diff --git a/server/po/it_IT.po b/server/po/it_IT.po index 0cab4b1..e881011 100644 --- a/server/po/it_IT.po +++ b/server/po/it_IT.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: streamdev 0.5.0\n" "Report-Msgid-Bugs-To: <http://www.vdr-developer.org/mantisbt/>\n" -"POT-Creation-Date: 2011-12-08 12:50+0100\n" +"POT-Creation-Date: 2011-12-11 11:25+0100\n" "PO-Revision-Date: 2010-06-19 03:58+0100\n" "Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n" "Language-Team: <vdr@linuxtv.org>\n" @@ -68,6 +68,9 @@ msgstr "Porta Server VDR-a-VDR" msgid "Bind to IP" msgstr "IP associati" +msgid "Loop Prevention" +msgstr "" + msgid "HTTP Server" msgstr "Server HTTP" diff --git a/server/po/lt_LT.po b/server/po/lt_LT.po index df630d0..a7988ca 100644 --- a/server/po/lt_LT.po +++ b/server/po/lt_LT.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: streamdev 0.5.0\n" "Report-Msgid-Bugs-To: <http://www.vdr-developer.org/mantisbt/>\n" -"POT-Creation-Date: 2011-12-08 12:50+0100\n" +"POT-Creation-Date: 2011-12-11 11:25+0100\n" "PO-Revision-Date: 2009-11-26 21:57+0200\n" "Last-Translator: Valdemaras Pipiras <varas@ambernet.lt>\n" "Language-Team: Lietuvių\n" @@ -66,6 +66,9 @@ msgstr "VDR-su-VDR Serverio portas" msgid "Bind to IP" msgstr "PririÅ¡ti IP" +msgid "Loop Prevention" +msgstr "" + msgid "HTTP Server" msgstr "HTTP Serveris" diff --git a/server/po/ru_RU.po b/server/po/ru_RU.po index 203030d..4355a86 100644 --- a/server/po/ru_RU.po +++ b/server/po/ru_RU.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: streamdev 0.5.0\n" "Report-Msgid-Bugs-To: <http://www.vdr-developer.org/mantisbt/>\n" -"POT-Creation-Date: 2011-12-08 12:50+0100\n" +"POT-Creation-Date: 2011-12-11 11:25+0100\n" "PO-Revision-Date: 2008-06-26 15:36+0100\n" "Last-Translator: Oleg Roitburd <oleg@roitburd.de>\n" "Language-Team: <vdr@linuxtv.org>\n" @@ -66,6 +66,9 @@ msgstr "VDR-to-VDR ßÞàâ áÕàÒÕàÐ" msgid "Bind to IP" msgstr "¿àØáÞÕÔØÝØâìáï Ú IP" +msgid "Loop Prevention" +msgstr "" + msgid "HTTP Server" msgstr "HTTP áÕàÒÕà" diff --git a/server/po/sk_SK.po b/server/po/sk_SK.po index 1eec849..6af21b5 100644 --- a/server/po/sk_SK.po +++ b/server/po/sk_SK.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: streamdev_SK\n" "Report-Msgid-Bugs-To: <http://www.vdr-developer.org/mantisbt/>\n" -"POT-Creation-Date: 2011-12-08 12:50+0100\n" +"POT-Creation-Date: 2011-12-11 11:25+0100\n" "PO-Revision-Date: \n" "Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n" "Language-Team: Slovak <hrala.milan@gmail.com>\n" @@ -68,6 +68,9 @@ msgstr "Port serveru pre VDR-do-VDR" msgid "Bind to IP" msgstr "viaza» na IP" +msgid "Loop Prevention" +msgstr "" + msgid "HTTP Server" msgstr "server HTTP" diff --git a/server/setup.c b/server/setup.c index 6acf3ac..381b8d8 100644 --- a/server/setup.c +++ b/server/setup.c @@ -14,6 +14,7 @@ cStreamdevServerSetup::cStreamdevServerSetup(void) { MaxClients = 5; StartVTPServer = true; VTPServerPort = 2004; + LoopPrevention = false; StartHTTPServer = true; HTTPServerPort = 3000; HTTPStreamType = stTS; @@ -33,6 +34,7 @@ bool cStreamdevServerSetup::SetupParse(const char *Name, const char *Value) { else if (strcmp(Name, "StartServer") == 0) StartVTPServer = atoi(Value); else if (strcmp(Name, "ServerPort") == 0) VTPServerPort = atoi(Value); else if (strcmp(Name, "VTPBindIP") == 0) strcpy(VTPBindIP, Value); + else if (strcmp(Name, "LoopPrevention") == 0) LoopPrevention = atoi(Value); else if (strcmp(Name, "StartHTTPServer") == 0) StartHTTPServer = atoi(Value); else if (strcmp(Name, "HTTPServerPort") == 0) HTTPServerPort = atoi(Value); else if (strcmp(Name, "HTTPStreamType") == 0) HTTPStreamType = atoi(Value); @@ -89,6 +91,8 @@ void cStreamdevServerMenuSetupPage::Set(void) { Add(new cMenuEditBoolItem(tr("Start VDR-to-VDR Server"), &m_NewSetup.StartVTPServer)); Add(new cMenuEditIntItem (tr("VDR-to-VDR Server Port"), &m_NewSetup.VTPServerPort, 0, 65535)); Add(new cMenuEditIpItem (tr("Bind to IP"), m_NewSetup.VTPBindIP)); + if (cPluginManager::CallFirstService(LOOP_PREVENTION_SERVICE)) + Add(new cMenuEditBoolItem(tr("Loop Prevention"), &m_NewSetup.LoopPrevention)); AddCategory (tr("HTTP Server")); Add(new cMenuEditBoolItem(tr("Start HTTP Server"), &m_NewSetup.StartHTTPServer)); @@ -134,6 +138,7 @@ void cStreamdevServerMenuSetupPage::Store(void) { SetupStore("StartServer", m_NewSetup.StartVTPServer); SetupStore("ServerPort", m_NewSetup.VTPServerPort); SetupStore("VTPBindIP", m_NewSetup.VTPBindIP); + SetupStore("LoopPrevention", m_NewSetup.LoopPrevention); SetupStore("StartHTTPServer", m_NewSetup.StartHTTPServer); SetupStore("HTTPServerPort", m_NewSetup.HTTPServerPort); SetupStore("HTTPStreamType", m_NewSetup.HTTPStreamType); diff --git a/server/setup.h b/server/setup.h index 0baa66e..4b5eb50 100644 --- a/server/setup.h +++ b/server/setup.h @@ -17,6 +17,7 @@ struct cStreamdevServerSetup { int StartVTPServer; int VTPServerPort; char VTPBindIP[20]; + int LoopPrevention; int StartHTTPServer; int HTTPServerPort; int HTTPStreamType; |