2 Copyright 2004-2008 Chris Tallon
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 The new async protocol design forced the server side change from the mvpclient
23 class to the mess it is now. Maybe in a couple of versions time it will become
24 more apparent how better to design all this.
26 The reason for the class split is that with the current Thread class system,
27 you can only have one thread per object. The vompclient class would have needed
28 two, one for RR stuff and one for the keepalives.
30 So the new design is this: the VompClient class represents one connection from
31 one client as the MVPClient class did before. But because two threads are now
32 needed, a helper class VompClientRRProc contains all the RR processing functions,
33 and the thread needed to process them. All the state data is still kept in the
45 #include <unistd.h> // sleep
47 #ifndef VOMPSTANDALONE
59 #include "vompclientrrproc.h"
62 class ServerMediaFile;
63 class SerializeBuffer;
69 friend class VompClientRRProc;
70 friend class PictureReader;
73 VompClient(Config* baseConfig, char* configDir, char* logoDir,
74 char* resourceDir, char* imageDir, char*cacheDir, int tsocket);
78 // not for external use
80 static int getNrClients();
83 static int nr_clients;
84 static void incClients();
85 static void decClients();
87 static ULLONG ntohll(ULLONG a);
88 static ULLONG htonll(ULLONG a);
90 VompClientRRProc rrproc;
104 //void cleanConfig();
106 #ifndef VOMPSTANDALONE
107 void writeResumeData();
110 RecPlayer* recplayer;
111 static cPlugin * scraper;
112 static time_t lastScrapQuery;
113 static cPlugin* scrapQuery();
114 PictureReader * pict;
122 ServerMediaFile *mediaprovider;
124 void setCharset(int charset);
125 int charcoding; // 1= latin1 2= UTF-8
126 cCharSetConv *charconvutf8;
127 cCharSetConv *charconvsys;