summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorFrank Schmirler <vdr@schmirler.de>2011-11-28 16:23:57 +0100
committerFrank Schmirler <vdr@schmirler.de>2011-11-28 16:23:57 +0100
commitafe255aa0b66732c216660c3cead34d07ca67ef8 (patch)
tree252017adb8b7fb2a4d1977962e963149667a75c0 /server
parentce1583a756fe7d80522ed3e82275705b9cbe00b7 (diff)
downloadvdr-plugin-streamdev-afe255aa0b66732c216660c3cead34d07ca67ef8.tar.gz
vdr-plugin-streamdev-afe255aa0b66732c216660c3cead34d07ca67ef8.tar.bz2
Added server menu with list of clients. Connections can be terminated
with the "red" key. The former main menu action of suspending live TV moved to the "blue" key. Squashed commit of the following: commit 7175d7de91b637eb057831b5c27af78d3870f146 Author: Frank Schmirler <vdr@schmirler.de> Date: Sun Nov 27 11:51:26 2011 +0100 Updated README commit 94aef85adc9c2922205145550ff00e59c694e36d Author: Frank Schmirler <vdr@schmirler.de> Date: Sun Nov 27 11:32:16 2011 +0100 Moved "closing connection" log message to overload of cTBSocket::Close() in cServerConnection. commit 9b91301d943cfbec5208419704cfece84267223d Author: Frank Schmirler <vdr@schmirler.de> Date: Fri Nov 25 00:24:37 2011 +0100 Don't keep a pointer to the connection in components MulticastGroup structure as the connection may now be deleted from outside via menu. commit 7347e24123ec0b852091ec035cabce0e10278a72 Author: Frank Schmirler <vdr@schmirler.de> Date: Thu Nov 24 23:45:59 2011 +0100 Fixed missing Display() call after disconnecting a client. commit c652e8fa8141d7e323cbdbbc0a662244a5a84955 Author: Frank Schmirler <vdr@schmirler.de> Date: Tue Nov 22 01:15:09 2011 +0100 Added server menu with list of clients. Connections can be terminated with the "red" key. The former main menu action of suspending live TV moved to the "blue" key.
Diffstat (limited to 'server')
-rw-r--r--server/Makefile2
-rw-r--r--server/componentIGMP.c36
-rw-r--r--server/componentIGMP.h3
-rw-r--r--server/connection.c10
-rw-r--r--server/connection.h6
-rw-r--r--server/connectionHTTP.c5
-rw-r--r--server/connectionHTTP.h4
-rw-r--r--server/connectionIGMP.c13
-rw-r--r--server/connectionIGMP.h5
-rw-r--r--server/connectionVTP.c13
-rw-r--r--server/connectionVTP.h2
-rw-r--r--server/livestreamer.c8
-rw-r--r--server/livestreamer.h1
-rw-r--r--server/menu.c68
-rw-r--r--server/menu.h24
-rw-r--r--server/po/de_DE.po13
-rw-r--r--server/po/es_ES.po14
-rw-r--r--server/po/fi_FI.po13
-rw-r--r--server/po/fr_FR.po13
-rw-r--r--server/po/it_IT.po13
-rw-r--r--server/po/lt_LT.po13
-rw-r--r--server/po/ru_RU.po13
-rw-r--r--server/po/sk_SK.po13
-rw-r--r--server/server.c12
-rw-r--r--server/server.h3
-rw-r--r--server/streamdev-server.c14
26 files changed, 263 insertions, 71 deletions
diff --git a/server/Makefile b/server/Makefile
index 8f512ac..ba09649 100644
--- a/server/Makefile
+++ b/server/Makefile
@@ -23,7 +23,7 @@ SERVEROBJS = $(PLUGIN).o \
componentHTTP.o connectionHTTP.o menuHTTP.o \
componentIGMP.o connectionIGMP.o \
streamer.o livestreamer.o livefilter.o recplayer.o \
- suspend.o setup.o
+ menu.o suspend.o setup.o
### The main target:
diff --git a/server/componentIGMP.c b/server/componentIGMP.c
index 223aa3c..7398c67 100644
--- a/server/componentIGMP.c
+++ b/server/componentIGMP.c
@@ -6,6 +6,7 @@
#include "server/componentIGMP.h"
#include "server/connectionIGMP.h"
+#include "server/server.h"
#include "server/setup.h"
#ifndef IGMP_ALL_HOSTS
@@ -37,7 +38,6 @@
class cMulticastGroup: public cListObject
{
public:
- cConnectionIGMP *connection;
in_addr_t group;
in_addr_t reporter;
struct timeval timeout;
@@ -48,7 +48,6 @@ public:
};
cMulticastGroup::cMulticastGroup(in_addr_t Group) :
- connection(NULL),
group(Group),
reporter(0)
{
@@ -235,10 +234,7 @@ cServerConnection* cComponentIGMP::ProcessMessage(struct igmp *Igmp, in_addr_t G
group = new cMulticastGroup(Group);
m_Groups.Add(group);
}
- if (!group->connection) {
- IGMPStartMulticast(group);
- conn = group->connection;
- }
+ conn = IGMPStartMulticast(group);
IGMPStartTimer(group, Sender);
if (Igmp->igmp_type == IGMP_V1_MEMBERSHIP_REPORT)
IGMPStartV1HostTimer(group);
@@ -430,20 +426,36 @@ void cComponentIGMP::IGMPSendGroupQuery(cMulticastGroup* Group)
IGMPSendQuery(Group->group, IGMP_LAST_MEMBER_QUERY_INTERVAL_TS);
}
-void cComponentIGMP::IGMPStartMulticast(cMulticastGroup* Group)
+cServerConnection* cComponentIGMP::IGMPStartMulticast(cMulticastGroup* Group)
{
+ cServerConnection *conn = NULL;
in_addr_t g = ntohl(Group->group);
if (g > MULTICAST_PRIV_MIN && g <= MULTICAST_PRIV_MAX) {
+ cThreadLock lock;
cChannel *channel = Channels.GetByNumber(g - MULTICAST_PRIV_MIN);
- Group->connection = (cConnectionIGMP*) NewClient();
- if (!Group->connection->SetChannel(channel, Group->group)) {
- DELETENULL(Group->connection);
+ const cList<cServerConnection>& clients = cStreamdevServer::Clients(lock);
+ cServerConnection *s = clients.First();
+ while (s) {
+ if (s->RemoteIpAddr() == Group->group)
+ break;
+ s = clients.Next(s);
+ }
+ if (!s) {
+ conn = NewClient();
+ if (!((cConnectionIGMP *)conn)->SetChannel(channel, Group->group)) {
+ DELETENULL(conn);
+ }
}
}
+ return conn;
}
void cComponentIGMP::IGMPStopMulticast(cMulticastGroup* Group)
{
- if (Group->connection)
- Group->connection->Stop();
+ cThreadLock lock;
+ const cList<cServerConnection>& clients = cStreamdevServer::Clients(lock);
+ for (cServerConnection *s = clients.First(); s; s = clients.Next(s)) {
+ if (s->RemoteIpAddr() == Group->group)
+ s->Close();
+ }
}
diff --git a/server/componentIGMP.h b/server/componentIGMP.h
index 09d8fde..8f6c027 100644
--- a/server/componentIGMP.h
+++ b/server/componentIGMP.h
@@ -10,7 +10,6 @@
#include <vdr/thread.h>
#include "server/component.h"
-class cConnectionIGMP;
class cMulticastGroup;
class cComponentIGMP: public cServerComponent, public cThread {
@@ -42,7 +41,7 @@ private:
void IGMPStartRetransmitTimer(cMulticastGroup* Group);
void IGMPClearRetransmitTimer(cMulticastGroup* Group);
void IGMPSendGroupQuery(cMulticastGroup* Group);
- void IGMPStartMulticast(cMulticastGroup* Group);
+ cServerConnection* IGMPStartMulticast(cMulticastGroup* Group);
void IGMPStopMulticast(cMulticastGroup* Group);
virtual void Action();
diff --git a/server/connection.c b/server/connection.c
index 366eec5..9b57980 100644
--- a/server/connection.c
+++ b/server/connection.c
@@ -237,6 +237,13 @@ bool cServerConnection::Respond(const char *Message, bool Last, ...)
return true;
}
+bool cServerConnection::Close()
+{
+ if (IsOpen())
+ isyslog("streamdev-server: closing %s connection to %s:%d", Protocol(), RemoteIp().c_str(), RemotePort());
+ return cTBSocket::Close();
+}
+
#if APIVERSNUM >= 10700
static int GetClippedNumProvidedSystems(int AvailableBits, cDevice *Device)
{
@@ -407,3 +414,6 @@ void cServerConnection::MainThreadHook()
{
m_SwitchLive->Switch();
}
+
+cString cServerConnection::ToText() const
+{ return cString::sprintf("%s\t%s:%d", Protocol(), RemoteIp().c_str(), RemotePort()); }
diff --git a/server/connection.h b/server/connection.h
index 6cc6764..0d7a1a0 100644
--- a/server/connection.h
+++ b/server/connection.h
@@ -103,6 +103,9 @@ public:
/* Will make the socket close after sending all queued output data */
void DeferClose(void) { m_DeferClose = true; }
+ /* Close the socket */
+ virtual bool Close(void);
+
/* Will retrieve an unused device for transmitting data. Receivers have
already been attached from the device if necessary. Use the returned
cDevice in a following call to StartTransfer */
@@ -122,6 +125,9 @@ public:
/* This connections protocol name */
virtual const char* Protocol(void) const { return m_Protocol; }
+ /* Representation in menu */
+ virtual cString ToText(void) const;
+
/* std::map with additional information */
const tStrStrMap& Headers(void) const { return m_Headers; }
};
diff --git a/server/connectionHTTP.c b/server/connectionHTTP.c
index 161d5c7..937f7ec 100644
--- a/server/connectionHTTP.c
+++ b/server/connectionHTTP.c
@@ -359,3 +359,8 @@ bool cConnectionHTTP::ProcessURI(const std::string& PathInfo)
return false;
}
+cString cConnectionHTTP::ToText() const
+{
+ cString str = cServerConnection::ToText();
+ return m_LiveStreamer ? cString::sprintf("%s\t%s", *str, *m_LiveStreamer->ToText()) : str;
+}
diff --git a/server/connectionHTTP.h b/server/connectionHTTP.h
index 56f89b0..8f071ce 100644
--- a/server/connectionHTTP.h
+++ b/server/connectionHTTP.h
@@ -47,6 +47,8 @@ public:
virtual void Attach(void) { if (m_LiveStreamer != NULL) m_LiveStreamer->Attach(); }
virtual void Detach(void) { if (m_LiveStreamer != NULL) m_LiveStreamer->Detach(); }
+ virtual cString ToText() const;
+
virtual bool CanAuthenticate(void);
virtual bool Command(char *Cmd);
@@ -57,7 +59,7 @@ public:
inline bool cConnectionHTTP::Abort(void) const
{
- return m_LiveStreamer && m_LiveStreamer->Abort();
+ return !IsOpen() || (m_LiveStreamer && m_LiveStreamer->Abort());
}
#endif // VDR_STREAMDEV_SERVERS_CONNECTIONVTP_H
diff --git a/server/connectionIGMP.c b/server/connectionIGMP.c
index 53b9acf..328fe44 100644
--- a/server/connectionIGMP.c
+++ b/server/connectionIGMP.c
@@ -64,10 +64,15 @@ void cConnectionIGMP::Welcome()
esyslog("streamdev-server IGMP: GetDevice failed");
}
-void cConnectionIGMP::Stop()
+bool cConnectionIGMP::Close()
{
- if (m_LiveStreamer) {
+ if (m_LiveStreamer)
m_LiveStreamer->Stop();
- DELETENULL(m_LiveStreamer);
- }
+ return cServerConnection::Close();
+}
+
+cString cConnectionIGMP::ToText() const
+{
+ cString str = cServerConnection::ToText();
+ return m_LiveStreamer ? cString::sprintf("%s\t%s", *str, *m_LiveStreamer->ToText()) : str;
}
diff --git a/server/connectionIGMP.h b/server/connectionIGMP.h
index facda65..255379b 100644
--- a/server/connectionIGMP.h
+++ b/server/connectionIGMP.h
@@ -28,20 +28,21 @@ public:
bool SetChannel(cChannel *Channel, in_addr_t Dst);
virtual void Welcome(void);
- void Stop();
+ virtual cString ToText() const;
/* Not used here */
virtual bool Command(char *Cmd) { return false; }
virtual void Attach(void) { if (m_LiveStreamer != NULL) m_LiveStreamer->Attach(); }
virtual void Detach(void) { if (m_LiveStreamer != NULL) m_LiveStreamer->Detach(); }
+ virtual bool Close(void);
virtual bool Abort(void) const;
};
inline bool cConnectionIGMP::Abort(void) const
{
- return !m_LiveStreamer || m_LiveStreamer->Abort();
+ return !IsOpen() || !m_LiveStreamer || m_LiveStreamer->Abort();
}
#endif // VDR_STREAMDEV_SERVERS_CONNECTIONIGMP_H
diff --git a/server/connectionVTP.c b/server/connectionVTP.c
index 9ffa540..71fa43f 100644
--- a/server/connectionVTP.c
+++ b/server/connectionVTP.c
@@ -774,7 +774,7 @@ cConnectionVTP::~cConnectionVTP()
bool cConnectionVTP::Abort(void) const
{
- return (m_LiveStreamer && m_LiveStreamer->Abort()) ||
+ return !IsOpen() || (m_LiveStreamer && m_LiveStreamer->Abort()) ||
(m_FilterStreamer && m_FilterStreamer->Abort());
}
@@ -1811,3 +1811,14 @@ bool cConnectionVTP::Respond(int Code, const char *Message, ...)
Code < 0 ? -Code : Code,
Code < 0 ? '-' : ' ', *str);
}
+
+cString cConnectionVTP::ToText() const
+{
+ cString str = cServerConnection::ToText();
+ if (m_LiveStreamer)
+ return cString::sprintf("%s\t%s", *str, *m_LiveStreamer->ToText());
+ else if (m_RecPlayer)
+ return cString::sprintf("%s\t%s", *str, m_RecPlayer->getCurrentRecording()->Name());
+ else
+ return str;
+}
diff --git a/server/connectionVTP.h b/server/connectionVTP.h
index 2d683f3..9aab650 100644
--- a/server/connectionVTP.h
+++ b/server/connectionVTP.h
@@ -53,6 +53,8 @@ public:
virtual void Welcome(void);
virtual void Reject(void);
+ virtual cString ToText() const;
+
virtual bool Abort(void) const;
virtual void Detach(void);
virtual void Attach(void);
diff --git a/server/livestreamer.c b/server/livestreamer.c
index 1064943..a90471a 100644
--- a/server/livestreamer.c
+++ b/server/livestreamer.c
@@ -460,6 +460,14 @@ void cStreamdevLiveStreamer::GetSignal(int *DevNum, int *Strength, int *Quality)
}
}
+cString cStreamdevLiveStreamer::ToText() const
+{
+ if (m_Device && m_Channel) {
+ return cString::sprintf("DVB%-2d %3d %s", m_Device->DeviceNumber() + 1, m_Channel->Number(), m_Channel->Name());
+ }
+ return cString("");
+}
+
void cStreamdevLiveStreamer::StartReceiver(void)
{
if (m_NumPids > 0) {
diff --git a/server/livestreamer.h b/server/livestreamer.h
index 6203966..037515c 100644
--- a/server/livestreamer.h
+++ b/server/livestreamer.h
@@ -40,6 +40,7 @@ public:
bool SetChannel(const cChannel *Channel, eStreamType StreamType, const int* Apid = NULL, const int* Dpid = NULL);
void SetPriority(int Priority);
void GetSignal(int *DevNum, int *Strength, int *Quality) const;
+ cString ToText() const;
virtual int Put(const uchar *Data, int Count);
virtual uchar *Get(int &Count);
diff --git a/server/menu.c b/server/menu.c
new file mode 100644
index 0000000..28b25f8
--- /dev/null
+++ b/server/menu.c
@@ -0,0 +1,68 @@
+/*
+ * $Id: menu.c,v 1.10 2010/07/19 13:49:31 schmirl Exp $
+ */
+
+#include <vdr/menuitems.h>
+#include <vdr/thread.h>
+#include <vdr/player.h>
+
+#include "server/menu.h"
+#include "server/setup.h"
+#include "server/server.h"
+#include "server/suspend.h"
+
+cStreamdevServerMenu::cStreamdevServerMenu(): cOsdMenu(tr("Streamdev Connections"), 4, 20) {
+ cThreadLock lock;
+ const cList<cServerConnection>& clients = cStreamdevServer::Clients(lock);
+ for (cServerConnection *s = clients.First(); s; s = clients.Next(s))
+ Add(new cOsdItem(s->ToText()));
+ SetHelpKeys();
+ Display();
+}
+
+cStreamdevServerMenu::~cStreamdevServerMenu() {
+}
+
+void cStreamdevServerMenu::SetHelpKeys() {
+ SetHelp(Count() ? tr("Disconnect") : NULL, NULL, NULL, StreamdevServerSetup.SuspendMode == smOffer ? tr("Suspend") : NULL);
+}
+
+eOSState cStreamdevServerMenu::Disconnect() {
+ cOsdItem *item = Get(Current());
+ if (item) {
+ cThreadLock lock;
+ const cList<cServerConnection>& clients = cStreamdevServer::Clients(lock);
+ const char *text = item->Text();
+ for (cServerConnection *s = clients.First(); s; s = clients.Next(s)) {
+ if (!strcmp(text, s->ToText())) {
+ s->Close();
+ Del(Current());
+ SetHelpKeys();
+ Display();
+ break;
+ }
+ }
+ }
+ return osContinue;
+}
+
+eOSState cStreamdevServerMenu::Suspend() {
+ if (StreamdevServerSetup.SuspendMode == smOffer && !cSuspendCtl::IsActive()) {
+ cControl::Launch(new cSuspendCtl);
+ return osBack;
+ }
+ return osContinue;
+}
+
+eOSState cStreamdevServerMenu::ProcessKey(eKeys Key) {
+ eOSState state = cOsdMenu::ProcessKey(Key);
+ if (state == osUnknown) {
+ switch (Key) {
+ case kRed: return Disconnect();
+ case kBlue: return Suspend();
+ case kOk: return osBack;
+ default: break;
+ }
+ }
+ return state;
+}
diff --git a/server/menu.h b/server/menu.h
new file mode 100644
index 0000000..097d5d2
--- /dev/null
+++ b/server/menu.h
@@ -0,0 +1,24 @@
+/*
+ * $Id: menu.h,v 1.4 2010/07/19 13:49:31 schmirl Exp $
+ */
+
+#ifndef VDR_STREAMDEV_MENU_H
+#define VDR_STREAMDEV_MENU_H
+
+#include <vdr/osdbase.h>
+#include "connection.h"
+
+class cStreamdevServerMenu: public cOsdMenu {
+private:
+ void SetHelpKeys();
+ eOSState Disconnect();
+ eOSState Suspend();
+protected:
+ virtual eOSState ProcessKey(eKeys Key);
+
+public:
+ cStreamdevServerMenu();
+ virtual ~cStreamdevServerMenu();
+};
+
+#endif // VDR_STREAMDEV_MENU_H
diff --git a/server/po/de_DE.po b/server/po/de_DE.po
index 5fb611d..800f1e9 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: 2010-06-14 13:06+0200\n"
+"POT-Creation-Date: 2011-11-22 01:05+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"
@@ -21,8 +21,14 @@ msgstr "VDR Streaming Server"
msgid "Streaming active"
msgstr "Streamen im Gange"
-msgid "Suspend Live TV"
-msgstr "Live-TV pausieren"
+msgid "Streamdev Connections"
+msgstr "Streamdev Verbindungen"
+
+msgid "Disconnect"
+msgstr "Trennen"
+
+msgid "Suspend"
+msgstr "Pausieren"
msgid "Offer suspend mode"
msgstr "Pausieren anbieten"
@@ -80,4 +86,3 @@ msgstr "Port des Multicast Clients"
msgid "Multicast Streamtype"
msgstr "Multicast Streamtyp"
-
diff --git a/server/po/es_ES.po b/server/po/es_ES.po
index d7fb59e..db1625b 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: 2010-06-14 13:06+0200\n"
+"POT-Creation-Date: 2011-11-22 01:05+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"
@@ -21,8 +21,14 @@ msgstr "Servidor de transmisiones del VDR"
msgid "Streaming active"
msgstr "Trasmisión activa"
-msgid "Suspend Live TV"
-msgstr "Suspender TV en vivo"
+msgid "Streamdev Connections"
+msgstr ""
+
+msgid "Disconnect"
+msgstr ""
+
+msgid "Suspend"
+msgstr "Suspender"
msgid "Offer suspend mode"
msgstr "Ofrecer modo de suspensión"
@@ -80,5 +86,3 @@ msgstr "Puerto del Cliente Multicast"
msgid "Multicast Streamtype"
msgstr "Tipo de flujo Multicast"
-
-
diff --git a/server/po/fi_FI.po b/server/po/fi_FI.po
index 99c6ee5..5cafc87 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: 2010-06-14 13:06+0200\n"
+"POT-Creation-Date: 2011-11-22 01:05+0100\n"
"PO-Revision-Date: 2008-03-30 02:11+0200\n"
"Last-Translator: Rolf Ahrenberg <rahrenbe@cc.hut.fi>\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -21,8 +21,14 @@ msgstr "VDR-suoratoistopalvelin"
msgid "Streaming active"
msgstr "Suoratoistopalvelin aktiivinen"
-msgid "Suspend Live TV"
-msgstr "Pysäytä suora TV-lähetys"
+msgid "Streamdev Connections"
+msgstr ""
+
+msgid "Disconnect"
+msgstr ""
+
+msgid "Suspend"
+msgstr "Pysäytä"
msgid "Offer suspend mode"
msgstr "tyrkytä"
@@ -80,4 +86,3 @@ msgstr "Multicast-portti"
msgid "Multicast Streamtype"
msgstr "Multicast-lähetysmuoto"
-
diff --git a/server/po/fr_FR.po b/server/po/fr_FR.po
index c4b458e..a77b330 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: 2010-06-14 13:06+0200\n"
+"POT-Creation-Date: 2011-11-22 01:05+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"
@@ -21,8 +21,14 @@ msgstr "Serveur de streaming VDR"
msgid "Streaming active"
msgstr "Streaming actif"
-msgid "Suspend Live TV"
-msgstr "Suspendre Live TV"
+msgid "Streamdev Connections"
+msgstr ""
+
+msgid "Disconnect"
+msgstr ""
+
+msgid "Suspend"
+msgstr "Suspendre"
msgid "Offer suspend mode"
msgstr "Offrir le mode suspendre"
@@ -80,4 +86,3 @@ msgstr ""
msgid "Multicast Streamtype"
msgstr ""
-
diff --git a/server/po/it_IT.po b/server/po/it_IT.po
index c5eed57..78409f6 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: 2010-06-14 13:06+0200\n"
+"POT-Creation-Date: 2011-11-22 01:05+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"
@@ -23,8 +23,14 @@ msgstr "Server trasmissione VDR"
msgid "Streaming active"
msgstr "Trasmissione attiva"
-msgid "Suspend Live TV"
-msgstr "Sospendi TV dal vivo"
+msgid "Streamdev Connections"
+msgstr ""
+
+msgid "Disconnect"
+msgstr ""
+
+msgid "Suspend"
+msgstr "Sospendi"
msgid "Offer suspend mode"
msgstr "Offri mod. sospensione"
@@ -82,4 +88,3 @@ msgstr "Porta Client Multicast"
msgid "Multicast Streamtype"
msgstr "Tipo flusso Multicast"
-
diff --git a/server/po/lt_LT.po b/server/po/lt_LT.po
index f12de4d..7bcbe15 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: 2010-06-14 13:06+0200\n"
+"POT-Creation-Date: 2011-11-22 01:05+0100\n"
"PO-Revision-Date: 2009-11-26 21:57+0200\n"
"Last-Translator: Valdemaras Pipiras <varas@ambernet.lt>\n"
"Language-Team: Lietuvių\n"
@@ -21,8 +21,14 @@ msgstr "VDR transliavimo serveris"
msgid "Streaming active"
msgstr "Transliavimas vyksta"
-msgid "Suspend Live TV"
-msgstr "Pristabdyti Live TV"
+msgid "Streamdev Connections"
+msgstr ""
+
+msgid "Disconnect"
+msgstr ""
+
+msgid "Suspend"
+msgstr "Pristabdyti"
msgid "Offer suspend mode"
msgstr "Klausti dÄ—l sustabdymo"
@@ -80,4 +86,3 @@ msgstr "Multicast kliento portas"
msgid "Multicast Streamtype"
msgstr "Multicast transliavimo tipas"
-
diff --git a/server/po/ru_RU.po b/server/po/ru_RU.po
index 21abeaf..1def219 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: 2010-06-14 13:06+0200\n"
+"POT-Creation-Date: 2011-11-22 01:05+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"
@@ -21,8 +21,14 @@ msgstr "VDR Streaming áÕàÒÕà"
msgid "Streaming active"
msgstr "ÁâàØÜØÝÓ ÐÚâØÒÕÝ"
-msgid "Suspend Live TV"
-msgstr "¾áâÐÝÞÒÚÐ Live TV"
+msgid "Streamdev Connections"
+msgstr ""
+
+msgid "Disconnect"
+msgstr ""
+
+msgid "Suspend"
+msgstr "¾áâÐÝÞÒÚÐ"
msgid "Offer suspend mode"
msgstr "¿àÕÔÛÐÓÐâì ÞáâÐÝÞÒÚã"
@@ -80,4 +86,3 @@ msgstr ""
msgid "Multicast Streamtype"
msgstr ""
-
diff --git a/server/po/sk_SK.po b/server/po/sk_SK.po
index 78d98c9..c61ccfe 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: 2010-06-14 13:06+0200\n"
+"POT-Creation-Date: 2011-11-22 01:05+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n"
"Language-Team: Slovak <hrala.milan@gmail.com>\n"
@@ -23,8 +23,14 @@ msgstr "VDR prúdový server"
msgid "Streaming active"
msgstr "streamovanie aktivne"
-msgid "Suspend Live TV"
-msgstr "Pozastavenie ¾ivého vysielania"
+msgid "Streamdev Connections"
+msgstr ""
+
+msgid "Disconnect"
+msgstr ""
+
+msgid "Suspend"
+msgstr "Pozastavenie"
msgid "Offer suspend mode"
msgstr "Výber re¾ímu pozastavenia"
@@ -82,4 +88,3 @@ msgstr "Port klienta Multicast"
msgid "Multicast Streamtype"
msgstr "Multicast typ streamu"
-
diff --git a/server/server.c b/server/server.c
index c7fa96f..8dd122e 100644
--- a/server/server.c
+++ b/server/server.c
@@ -152,9 +152,8 @@ void cStreamdevServer::Action(void)
cServerConnection *next = m_Clients.Next(s);
if (!result) {
- isyslog("streamdev: closing streamdev connection to %s:%d",
- s->RemoteIp().c_str(), s->RemotePort());
- s->Close();
+ if (s->IsOpen())
+ s->Close();
Lock();
m_Clients.Del(s);
Unlock();
@@ -178,9 +177,8 @@ void cStreamdevServer::Action(void)
}
}
-void cStreamdevServer::MainThreadHook(void)
+const cList<cServerConnection>& cStreamdevServer::Clients(cThreadLock& Lock)
{
- cThreadLock lock(m_Instance);
- for (cServerConnection *s = m_Clients.First(); s; s = m_Clients.Next(s))
- s->MainThreadHook();
+ Lock.Lock(m_Instance);
+ return m_Clients;
}
diff --git a/server/server.h b/server/server.h
index dfe9cc1..91a9cae 100644
--- a/server/server.h
+++ b/server/server.h
@@ -36,7 +36,8 @@ public:
static void Initialize(void);
static void Destruct(void);
static bool Active(void);
- static void MainThreadHook(void);
+
+ static const cList<cServerConnection>& Clients(cThreadLock& Lock);
};
inline bool cStreamdevServer::Active(void)
diff --git a/server/streamdev-server.c b/server/streamdev-server.c
index 0a98394..f2fa057 100644
--- a/server/streamdev-server.c
+++ b/server/streamdev-server.c
@@ -9,9 +9,9 @@
#include <getopt.h>
#include <vdr/tools.h>
#include "streamdev-server.h"
+#include "server/menu.h"
#include "server/setup.h"
#include "server/server.h"
-#include "server/suspend.h"
#if !defined(APIVERSNUM) || APIVERSNUM < 10516
#error "VDR-1.5.16 API version or greater is required!"
@@ -119,20 +119,20 @@ cString cPluginStreamdevServer::Active(void)
const char *cPluginStreamdevServer::MainMenuEntry(void)
{
- if (StreamdevServerSetup.SuspendMode == smOffer && !cSuspendCtl::IsActive())
- return tr("Suspend Live TV");
- return NULL;
+ return tr("Streamdev Connections");
}
cOsdObject *cPluginStreamdevServer::MainMenuAction(void)
{
- cControl::Launch(new cSuspendCtl);
- return NULL;
+ return new cStreamdevServerMenu();
}
void cPluginStreamdevServer::MainThreadHook(void)
{
- cStreamdevServer::MainThreadHook();
+ cThreadLock lock;
+ const cList<cServerConnection>& clients = cStreamdevServer::Clients(lock);
+ for (cServerConnection *s = clients.First(); s; s = clients.Next(s))
+ s->MainThreadHook();
}
cMenuSetupPage *cPluginStreamdevServer::SetupMenu(void)