diff options
-rw-r--r-- | device.c | 10 | ||||
-rw-r--r-- | frontend.c | 6 | ||||
-rw-r--r-- | frontend.h | 6 | ||||
-rw-r--r-- | frontend_local.c | 6 | ||||
-rw-r--r-- | frontend_local.h | 6 | ||||
-rw-r--r-- | frontend_svr.c | 14 | ||||
-rw-r--r-- | frontend_svr.h | 5 |
7 files changed, 30 insertions, 23 deletions
@@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: device.c,v 1.120 2012-03-17 20:14:41 phintuka Exp $ + * $Id: device.c,v 1.121 2012-03-17 20:19:27 phintuka Exp $ * */ @@ -247,9 +247,9 @@ bool cXinelibDevice::InitDevice() } if (*xc.local_frontend && strncmp(xc.local_frontend, "none", 4)) - m_clients.Add(m_local = new cXinelibLocal(xc.local_frontend)); + m_clients.Add(m_local = new cXinelibLocal(this, xc.local_frontend)); if (xc.remote_mode && xc.listen_port > 0) - m_clients.Add(m_server = new cXinelibServer(xc.listen_port)); + m_clients.Add(m_server = new cXinelibServer(this, xc.listen_port)); return true; } @@ -514,7 +514,7 @@ void cXinelibDevice::ConfigureWindow(int fullscreen, int width, int height, aspect, scale_video); else if(*xc.local_frontend && strncmp(xc.local_frontend, "none", 4)) { - cXinelibThread *tmp = new cXinelibLocal(xc.local_frontend); + cXinelibThread *tmp = new cXinelibLocal(this, xc.local_frontend); tmp->Start(); m_clients.Add(m_local = tmp); @@ -542,7 +542,7 @@ void cXinelibDevice::Listen(bool activate, int port) if(activate && port>0) { if(!m_server) { - cXinelibThread *tmp = new cXinelibServer(port); + cXinelibThread *tmp = new cXinelibServer(this, port); tmp->Start(); m_clients.Add(m_server = tmp); @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend.c,v 1.98 2012-03-17 19:59:04 phintuka Exp $ + * $Id: frontend.c,v 1.99 2012-03-17 20:19:27 phintuka Exp $ * */ @@ -235,10 +235,12 @@ void cXinelibThread::InfoHandler(const char *info) free(pmap); } -cXinelibThread::cXinelibThread(const char *Description) : cThread(Description) +cXinelibThread::cXinelibThread(cXinelibDevice *Dev, const char *Description) : cThread(Description) { TRACEF("cXinelibThread::cXinelibThread"); + m_Dev = Dev; + m_Volume = 255; m_bReady = false; m_bNoVideo = true; @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend.h,v 1.43 2012-03-17 20:04:49 phintuka Exp $ + * $Id: frontend.h,v 1.44 2012-03-17 20:19:27 phintuka Exp $ * */ @@ -28,7 +28,7 @@ class cXinelibThread : public cThread, public cListObject cXinelibThread(cXinelibThread&); // no copy contructor public: - cXinelibThread(const char *Description = NULL); + cXinelibThread(cXinelibDevice *Dev, const char *Description = NULL); virtual ~cXinelibThread(); // @@ -140,6 +140,8 @@ class cXinelibThread : public cThread, public cListObject // protected: + cXinelibDevice *m_Dev; + bool m_bReady; bool m_bNoVideo; bool m_bLiveMode; diff --git a/frontend_local.c b/frontend_local.c index ed7f05f6..98a8e453 100644 --- a/frontend_local.c +++ b/frontend_local.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend_local.c,v 1.56 2012-03-13 12:53:41 phintuka Exp $ + * $Id: frontend_local.c,v 1.57 2012-03-17 20:19:27 phintuka Exp $ * */ @@ -72,8 +72,8 @@ extern "C" { //----------------------------- cXinelibLocal -------------------------------- -cXinelibLocal::cXinelibLocal(const char *frontend_name) : - cXinelibThread("Local decoder/display (cXinelibThread)"), m_feLock(true) +cXinelibLocal::cXinelibLocal(cXinelibDevice *Dev, const char *frontend_name) : + cXinelibThread(Dev, "Local decoder/display (cXinelibThread)"), m_feLock(true) { fe = NULL; h_fe_lib = NULL; diff --git a/frontend_local.h b/frontend_local.h index 4a942a95..900afb6d 100644 --- a/frontend_local.h +++ b/frontend_local.h @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend_local.h,v 1.10 2012-03-13 12:53:41 phintuka Exp $ + * $Id: frontend_local.h,v 1.11 2012-03-17 20:19:27 phintuka Exp $ * */ @@ -19,11 +19,13 @@ extern "C" { typedef struct frontend_s frontend_t; } +class cXinelibDevice; + class cXinelibLocal : public cXinelibThread { public: - cXinelibLocal(const char *frontend_name); + cXinelibLocal(cXinelibDevice *Dev, const char *frontend_name); virtual ~cXinelibLocal(); protected: diff --git a/frontend_svr.c b/frontend_svr.c index 01ab74de..903b9b0d 100644 --- a/frontend_svr.c +++ b/frontend_svr.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend_svr.c,v 1.105 2012-03-17 20:06:29 phintuka Exp $ + * $Id: frontend_svr.c,v 1.106 2012-03-17 20:19:27 phintuka Exp $ * */ @@ -116,8 +116,8 @@ enum { #define DATA_NOPOLL(dt) ((dt) & (dtHttp | dtRtspMux)) #define DATA_NOCONTROL(dt) ((dt) & (dtHttp | dtRtspMux)) -cXinelibServer::cXinelibServer(int listen_port) : - cXinelibThread("Remote decoder/display server (cXinelibServer)") +cXinelibServer::cXinelibServer(cXinelibDevice *Dev, int listen_port) : + cXinelibThread(Dev, "Remote decoder/display server (cXinelibServer)") { int i; for(i=0; i<MAXCLIENTS; i++) { @@ -239,7 +239,7 @@ void cXinelibServer::CloseConnection(int cli) delete m_State[cli]; m_State[cli] = NULL; } - cXinelibDevice::Instance().ForcePrimaryDevice(false); + m_Dev->ForcePrimaryDevice(false); } } @@ -1087,7 +1087,7 @@ void cXinelibServer::Handle_Control_DATA(int cli, const char *arg) m_Writer[cli]->Put(sidVdr, 0, m_Header, m_HeaderLength); /* not anymore control connection, so dec primary device reference counter */ - cXinelibDevice::Instance().ForcePrimaryDevice(false); + m_Dev->ForcePrimaryDevice(false); } void cXinelibServer::Handle_Control_RTP(int cli, const char *arg) @@ -1198,7 +1198,7 @@ void cXinelibServer::Handle_Control_CONFIG(int cli) if(m_bPlayingFile && *m_FileName) { Unlock(); - int pos = cXinelibDevice::Instance().PlayFileCtrl("GETPOS"); + int pos = m_Dev->PlayFileCtrl("GETPOS"); Lock(); if(m_bPlayingFile && *m_FileName) { fd_control[cli].printf("PLAYFILE %d %s %s\r\n", @@ -1782,7 +1782,7 @@ void cXinelibServer::Handle_ClientConnected(int fd) fd_control[cli].set_handle(fd); fd_control[cli].set_buffers(KILOBYTE(128), KILOBYTE(128)); - if (!cXinelibDevice::Instance().ForcePrimaryDevice(true)) { + if (!m_Dev->ForcePrimaryDevice(true)) { const char *msg = "Not primary device.\r\n"; ssize_t len = strlen(msg); LOGMSG("Dropping client: xineliboutput is not the primary device !"); diff --git a/frontend_svr.h b/frontend_svr.h index f0708cc9..613ae511 100644 --- a/frontend_svr.h +++ b/frontend_svr.h @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend_svr.h,v 1.31 2012-03-13 07:58:15 phintuka Exp $ + * $Id: frontend_svr.h,v 1.32 2012-03-17 20:19:27 phintuka Exp $ * */ @@ -24,6 +24,7 @@ class cUdpScheduler; class cStcFuture; class cCmdFutures; class cConnState; +class cXinelibDevice; #include "tools/cxsocket.h" @@ -31,7 +32,7 @@ class cXinelibServer : public cXinelibThread { public: - cXinelibServer(int listen_port); + cXinelibServer(cXinelibDevice *Dev, int listen_port); virtual ~cXinelibServer(); protected: |