Added service call returning the number of clients (closes #1967)

This commit is contained in:
Frank Schmirler 2014-11-07 23:51:13 +01:00
parent 99b223c55f
commit 1ee2049c4d
4 changed files with 18 additions and 0 deletions

View File

@ -232,3 +232,6 @@ Henrik Niehaus
Guy Martin Guy Martin
for adding SVDRP commands to list and disconnect clients for adding SVDRP commands to list and disconnect clients
Martin1234
for suggesting a service call, returning the number of clients

View File

@ -1,6 +1,7 @@
VDR Plugin 'streamdev' Revision History 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) - added SVDRP commands to list and disconnect clients (thanks to Guy Martin)
- fixed recplayer issues with large TS files (>4GB) - fixed recplayer issues with large TS files (>4GB)
- Don't abort externremux when internal read buffer is empty - Don't abort externremux when internal read buffer is empty

View File

@ -243,4 +243,17 @@ cString cPluginStreamdevServer::SVDRPCommand(const char *Command, const char *Op
return reply; 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! VDRPLUGINCREATOR(cPluginStreamdevServer); // Don't touch this!

View File

@ -46,6 +46,7 @@ public:
virtual bool SetupParse(const char *Name, const char *Value); virtual bool SetupParse(const char *Name, const char *Value);
virtual const char **SVDRPHelpPages(void); virtual const char **SVDRPHelpPages(void);
virtual cString SVDRPCommand(const char *Command, const char *Option, int &ReplyCode); virtual cString SVDRPCommand(const char *Command, const char *Option, int &ReplyCode);
virtual bool Service(const char *Id, void *Data = NULL);
}; };
#endif // VDR_STREAMDEVSERVER_H #endif // VDR_STREAMDEVSERVER_H