server_connectionVTP-new-data.patch by Petri Hintukainen

- Add new data (LiveFilterStreamer and LiveFilterSocket)
- Misc cleanup
Modified Files:
	server/connectionVTP.c server/connectionVTP.h
This commit is contained in:
schmirl 2007-04-24 11:03:41 +00:00
parent ac4c391c43
commit a0dfe7b20a
2 changed files with 20 additions and 15 deletions

View File

@ -1,5 +1,5 @@
/* /*
* $Id: connectionVTP.c,v 1.10 2007/04/24 10:43:40 schmirl Exp $ * $Id: connectionVTP.c,v 1.11 2007/04/24 11:03:41 schmirl Exp $
*/ */
#include "server/connectionVTP.h" #include "server/connectionVTP.h"
@ -466,6 +466,8 @@ cConnectionVTP::cConnectionVTP(void):
cServerConnection("VTP"), cServerConnection("VTP"),
m_LiveSocket(NULL), m_LiveSocket(NULL),
m_LiveStreamer(NULL), m_LiveStreamer(NULL),
m_FilterSocket(NULL),
m_FilterStreamer(NULL),
m_LastCommand(NULL), m_LastCommand(NULL),
m_NoTSPIDS(false), m_NoTSPIDS(false),
m_LSTEHandler(NULL), m_LSTEHandler(NULL),
@ -485,6 +487,11 @@ cConnectionVTP::~cConnectionVTP()
delete m_LSTEHandler; delete m_LSTEHandler;
} }
inline bool cConnectionVTP::Abort(void) const
{
return m_LiveStreamer && m_LiveStreamer->Abort();
}
void cConnectionVTP::Welcome(void) void cConnectionVTP::Welcome(void)
{ {
Respond(220, "Welcome to Video Disk Recorder (VTP)"); Respond(220, "Welcome to Video Disk Recorder (VTP)");
@ -547,8 +554,8 @@ bool cConnectionVTP::Command(char *Cmd)
else if (strcasecmp(Cmd, "ADDF") == 0) return CmdADDF(param); else if (strcasecmp(Cmd, "ADDF") == 0) return CmdADDF(param);
else if (strcasecmp(Cmd, "DELF") == 0) return CmdDELF(param); else if (strcasecmp(Cmd, "DELF") == 0) return CmdDELF(param);
else if (strcasecmp(Cmd, "ABRT") == 0) return CmdABRT(param); else if (strcasecmp(Cmd, "ABRT") == 0) return CmdABRT(param);
else if (strcasecmp(Cmd, "QUIT") == 0) return CmdQUIT(param); else if (strcasecmp(Cmd, "QUIT") == 0) return CmdQUIT();
else if (strcasecmp(Cmd, "SUSP") == 0) return CmdSUSP(param); else if (strcasecmp(Cmd, "SUSP") == 0) return CmdSUSP();
// Commands adopted from SVDRP // Commands adopted from SVDRP
//else if (strcasecmp(Cmd, "DELR") == 0) return CmdDELR(param); //else if (strcasecmp(Cmd, "DELR") == 0) return CmdDELR(param);
else if (strcasecmp(Cmd, "MODT") == 0) return CmdMODT(param); else if (strcasecmp(Cmd, "MODT") == 0) return CmdMODT(param);
@ -777,13 +784,13 @@ bool cConnectionVTP::CmdABRT(char *Opts)
return Respond(220, "Data connection closed"); return Respond(220, "Data connection closed");
} }
bool cConnectionVTP::CmdQUIT(char *Opts) bool cConnectionVTP::CmdQUIT(void)
{ {
DeferClose(); DeferClose();
return Respond(221, "Video Disk Recorder closing connection"); return Respond(221, "Video Disk Recorder closing connection");
} }
bool cConnectionVTP::CmdSUSP(char *Opts) bool cConnectionVTP::CmdSUSP(void)
{ {
if (StreamdevServerSetup.SuspendMode == smAlways || cSuspendCtl::IsActive()) if (StreamdevServerSetup.SuspendMode == smAlways || cSuspendCtl::IsActive())
return Respond(220, "Server is suspended"); return Respond(220, "Server is suspended");

View File

@ -2,9 +2,10 @@
#define VDR_STREAMDEV_SERVERS_CONNECTIONVTP_H #define VDR_STREAMDEV_SERVERS_CONNECTIONVTP_H
#include "server/connection.h" #include "server/connection.h"
#include "server/livestreamer.h"
class cTBSocket; class cTBSocket;
class cStreamdevLiveStreamer;
class cStreamdevFilterStreamer;
class cLSTEHandler; class cLSTEHandler;
class cLSTCHandler; class cLSTCHandler;
class cLSTTHandler; class cLSTTHandler;
@ -18,6 +19,8 @@ class cConnectionVTP: public cServerConnection {
private: private:
cTBSocket *m_LiveSocket; cTBSocket *m_LiveSocket;
cStreamdevLiveStreamer *m_LiveStreamer; cStreamdevLiveStreamer *m_LiveStreamer;
cTBSocket *m_FilterSocket;
cStreamdevFilterStreamer *m_FilterStreamer;
char *m_LastCommand; char *m_LastCommand;
bool m_NoTSPIDS; bool m_NoTSPIDS;
@ -53,8 +56,8 @@ public:
bool CmdADDF(char *Opts); bool CmdADDF(char *Opts);
bool CmdDELF(char *Opts); bool CmdDELF(char *Opts);
bool CmdABRT(char *Opts); bool CmdABRT(char *Opts);
bool CmdQUIT(char *Opts); bool CmdQUIT(void);
bool CmdSUSP(char *Opts); bool CmdSUSP(void);
// Thread-safe implementations of SVDRP commands // Thread-safe implementations of SVDRP commands
bool CmdLSTE(char *Opts); bool CmdLSTE(char *Opts);
@ -73,9 +76,4 @@ public:
__attribute__ ((format (printf, 3, 4))); __attribute__ ((format (printf, 3, 4)));
}; };
inline bool cConnectionVTP::Abort(void) const
{
return m_LiveStreamer && m_LiveStreamer->Abort();
}
#endif // VDR_STREAMDEV_SERVERS_CONNECTIONVTP_H #endif // VDR_STREAMDEV_SERVERS_CONNECTIONVTP_H