vdr-plugin-streamdev/server/server.h

52 lines
1.2 KiB
C
Raw Normal View History

2004-12-30 23:43:55 +01:00
/*
* $Id: server.h,v 1.6 2008/10/22 11:59:32 schmirl Exp $
2004-12-30 23:43:55 +01:00
*/
#ifndef VDR_STREAMDEV_SERVER_H
#define VDR_STREAMDEV_SERVER_H
#include <vdr/thread.h>
#include "server/component.h"
#include "server/connection.h"
#define DEFAULT_EXTERNREMUX (*AddDirectory(cPlugin::ConfigDirectory(PLUGIN_NAME_I18N), "externremux.sh"))
#define STREAMDEVHOSTSPATH (*AddDirectory(cPlugin::ConfigDirectory(PLUGIN_NAME_I18N), "streamdevhosts.conf"))
2005-05-09 22:22:29 +02:00
extern char *opt_auth;
extern char *opt_remux;
2004-12-30 23:43:55 +01:00
class cStreamdevServer: public cThread {
private:
2005-05-09 22:22:29 +02:00
static cStreamdevServer *m_Instance;
static cList<cServerComponent> m_Servers;
static cList<cServerConnection> m_Clients;
2004-12-30 23:43:55 +01:00
protected:
2005-05-09 22:22:29 +02:00
void Stop(void);
2004-12-30 23:43:55 +01:00
virtual void Action(void);
2005-05-09 22:22:29 +02:00
static void Register(cServerComponent *Server);
2004-12-30 23:43:55 +01:00
public:
cStreamdevServer(void);
virtual ~cStreamdevServer();
2005-05-09 22:22:29 +02:00
static void Initialize(void);
static void Destruct(void);
2004-12-30 23:43:55 +01:00
static bool Active(void);
static const cList<cServerConnection>& Clients(cThreadLock& Lock);
2004-12-30 23:43:55 +01:00
};
2005-05-09 22:22:29 +02:00
inline bool cStreamdevServer::Active(void)
{
return m_Instance != NULL
&& m_Instance->m_Clients.Count() > 0;
2004-12-30 23:43:55 +01:00
}
extern cSVDRPhosts StreamdevHosts;
#endif // VDR_STREAMDEV_SERVER_H