Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members
ServerSession.hpp
00001 /*********************************************************************** 00002 * * 00003 * ViTooKi * 00004 * * 00005 * title: ServerSession.hpp * 00006 * * 00007 * * 00008 * * 00009 * ITEC institute of the University of Klagenfurt (Austria) * 00010 * http://www.itec.uni-klu.ac.at * 00011 * * 00012 * * 00013 * For more information visit the ViTooKi homepage: * 00014 * http://ViTooKi.sourceforge.net * 00015 * vitooki-user@lists.sourceforge.net * 00016 * vitooki-devel@lists.sourceforge.net * 00017 * * 00018 * This file is part of ViTooKi, a free video toolkit. * 00019 * ViTooKi is free software; you can redistribute it and/or * 00020 * modify it under the terms of the GNU General Public License * 00021 * as published by the Free Software Foundation; either version 2 * 00022 * of the License, or (at your option) any later version. * 00023 * * 00024 * This program is distributed in the hope that it will be useful, * 00025 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00026 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00027 * GNU General Public License for more details. * 00028 * * 00029 * You should have received a copy of the GNU General Public License * 00030 * along with this program; if not, write to the Free Software * 00031 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, * 00032 * MA 02111-1307, USA. * 00033 * * 00034 ***********************************************************************/ 00035 00036 /*********************************************************************** 00037 * * 00038 * REVISION HISTORY: * 00039 * * 00040 * * 00041 * * 00042 ***********************************************************************/ 00043 00044 #ifndef _PS_SERVER_SESSION 00045 #define _PS_SERVER_SESSION 00046 00047 #include "global.hpp" 00048 00049 #ifdef WIN32 00050 #pragma warning(disable:4786) 00051 #endif 00052 00053 #include "Session.hpp" 00054 #include "Protocol.hpp" 00055 #include "ContainerInfo.hpp" 00056 #include "../cache/CacheManager.hpp" 00057 #include "../SessionCounter.hpp" 00058 #include "Statistics.hpp" 00059 #ifdef ISOMP4 00060 #include "ISOMovies.h" 00061 #endif 00062 00063 struct rtx_group; 00064 class DataChannel; 00065 class DataSink; 00066 class IO; 00067 class Url; 00068 class AdmissionControl; 00069 00070 #include "PortGenerator.hpp" 00071 00072 #include "../metadata/TerminalCapabilities.hpp" 00073 00074 00086 class ServerSession:public Session { 00087 00088 public: 00089 00092 ServerSession(int socket, const struct sockaddr_in *client, CacheManager * cm, 00093 AdmissionControl* am,bool enableRtx,SessionCounter* counter=NULL,TerminalCapabilities* tc=NULL); 00094 00095 ~ServerSession(); 00096 00097 bool options(const Url* fileName, const char* remaining); 00098 bool connect(const Url* fileName, const char* remaining); 00099 bool setup(const Url* fileName, const char* remaining); 00100 bool play(const Url* fileName, const char* remaining); 00101 bool pause(const Url* fileName, const char* remaining); 00102 bool tearDown(int sessionKey, bool immediate=false, const Url* fileName=NULL, const char* remaining=NULL); 00103 bool getOptions(const Url* fileName, const char* remaining); 00104 bool setOptions(const Url* fileName, const char* remaining); 00105 void run(); 00106 00109 void setUrl(const Url *uri, bool makeExactMatch = true); 00110 00111 SessionState getState() const { 00112 return state; 00113 }; 00114 00116 // void setOutput(IO * out); 00117 00118 protected: 00119 char buffer[MSG_BUFFER_SIZE]; 00120 // DataSink * clientObj; 00121 CacheManager *cm; 00122 char* localAddress; 00123 char* playerId; 00124 //std::map<char*, char*, struct stringCompare> params; 00126 std::map<u32,std::map<char*, char*, struct stringCompare>*, struct intCompare> params; 00127 00128 bool startDCs(int sessionId, double startTime, double endTime, 00129 double prefetch, bool backwardsClosestIFrame); 00130 00131 AdmissionControl* admControl; 00132 bool enableRtx; 00133 SessionCounter* counter; 00134 }; 00135 #endif