diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 6457868..ebe6de9 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -232,3 +232,6 @@ Henrik Niehaus Guy Martin for adding SVDRP commands to list and disconnect clients + +Martin1234 + for suggesting a service call, returning the number of clients diff --git a/HISTORY b/HISTORY index df58351..2d75055 100644 --- a/HISTORY +++ b/HISTORY @@ -1,6 +1,7 @@ VDR Plugin 'streamdev' Revision History --------------------------------------- +- added service call returning the number of clients (suggested by Martin1234) - added SVDRP commands to list and disconnect clients (thanks to Guy Martin) - fixed recplayer issues with large TS files (>4GB) - Don't abort externremux when internal read buffer is empty diff --git a/server/streamdev-server.c b/server/streamdev-server.c index e1475da..33d08a5 100644 --- a/server/streamdev-server.c +++ b/server/streamdev-server.c @@ -243,4 +243,17 @@ cString cPluginStreamdevServer::SVDRPCommand(const char *Command, const char *Op return reply; } +bool cPluginStreamdevServer::Service(const char *Id, void *Data) +{ + if (strcmp(Id, "StreamdevServer::ClientCount-v1.0") == 0) { + if (Data) { + int *count = (int *) Data; + cThreadLock lock; + *count = cStreamdevServer::Clients(lock).Count(); + } + return true; + } + return false; +} + VDRPLUGINCREATOR(cPluginStreamdevServer); // Don't touch this! diff --git a/server/streamdev-server.h b/server/streamdev-server.h index 0d588fc..4654e26 100644 --- a/server/streamdev-server.h +++ b/server/streamdev-server.h @@ -46,6 +46,7 @@ public: virtual bool SetupParse(const char *Name, const char *Value); virtual const char **SVDRPHelpPages(void); virtual cString SVDRPCommand(const char *Command, const char *Option, int &ReplyCode); + virtual bool Service(const char *Id, void *Data = NULL); }; #endif // VDR_STREAMDEVSERVER_H