00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
#ifndef MN_CONFIG_H
00025
#define MN_CONFIG_H
00026
00027
#include <config.h>
00028
#include "mnstream.h"
00029
#include <MNString.h>
00030
#include "sdp/PayloadTypes.h"
00031
#include <string>
00032
00055 class Config
00056 {
00057
class Private;
00058
00063
static Private* _values;
00064
00068
void usage(
const char* progname );
00069
00083
void configure(
const char* type,
00084
const char* config_file_name,
00085
const char* overwrite_vs_type );
00086
public:
00087 enum Mode
00088 {
00089
Client,
00090
Proxy,
00091
Server,
00092
TestCachingProxy
00093 };
00094
00095 struct Gui
00096 {
00097 bool autostart;
00098 bool qt;
00099 bool decoder;
00100 bool mplayer;
00101 bool gstreamermpeg;
00102 };
00103
00104 enum DataPumpType
00105 {
00106
DataPumpUndefined = -1,
00107
MNStreamer = 1,
00108
VCStreamer,
00109
NopStreamer,
00110
MNDummyStreamer,
00111
SlaveDataPump
00112 };
00113
00114 struct DataPump
00115 {
00116 DataPumpType type;
00117 bool sendblock;
00118 };
00119
00120 enum ServerEmulationPopularity
00121 {
00122
ServerEmulationPopularityUndefined = -1,
00123
Cyclic,
00124
Zipf,
00125
Unified
00126 };
00127
00128 struct ServerEmulation
00129 {
00130 int movies;
00131 ServerEmulationPopularity
popularity;
00132 };
00133 enum ClientEmulationIPattern
00134 {
00135
ClientEmulationIPatternUndefined = -1,
00136
Constant,
00137
Poisson
00138 };
00139
00140 struct ClientEmulation
00141 {
00142 ClientEmulationIPattern
pattern;
00143 int delay;
00144 };
00145
00146
public :
00153
Config(
int argc,
char* argv[] );
00154
00159
Config(
const char* type );
00160
00161
Config();
00162
~Config();
00163
00164
bool GetPRINT_INFO(
const char* filename );
00165
bool GetPRINT_WARN(
const char* filename );
00166
bool GetPRINT_ERROR(
const char* filename );
00167
00168
const MNString&
GetCONTENTROOT();
00169
const MNString&
GetMCAST_IF();
00170
const MNString&
GetCACHE_DIR() const;
00171 const
MNString& GetCACHE_STRATEGY();
00172 const
MNString& GetRTSP_EOL() const;
00173 const
MNString& GetSDP_EOL() const;
00174
bool GetUSE_RTSP_PROXY( ) const;
00175 const
MNString& GetRTSP_PROXY_NAME() const;
00176
int GetRTSP_PROXY_PORT() const;
00177
int GetRTSP_SERVER_PORT() const;
00178
int GetCLIENT_BANDWIDTH() const;
00179
00185
bool GetCLIENT_DESTINATION() const;
00186
00191 const
DataPump& GetVS( ) const;
00192
00193 const
ServerEmulation& GetServerEmulation( ) const;
00194
00195 const
ClientEmulation& GetClientEmulation( ) const;
00196
00200
int GetCACHE_SPACE() const;
00201
00208 Mode GetMODE() const;
00209
bool GetPATCHING_MODE() const;
00210
bool GetCACHING_MODE() const;
00211
00212
bool GetREFLECTION_MODE() const;
00213
00218 const
Gui& GetGUI( ) const;
00219
00220
bool GetTFRC_REPLY() const;
00221
bool GetRTP_TCP() const;
00222
00223
bool GetHasClientLoopbackPort( ) const;
00224
int GetClientLoopbackPort( ) const;
00225
bool GetHasClientUrl( ) const;
00226 const
char* GetClientUrl( ) const;
00227
bool GetHasLogfile( ) const;
00228 const
char* GetLogfile( ) const;
00229
00230
void ExitWithUsage( const
char* comment );
00231
00239 static DataPumpType translateDataPumpType( const
char* e );
00240
00241 static ClientEmulationIPattern translateCEP( const
char* e );
00242 static ServerEmulationPopularity translateSEP( const
char* e );
00243
00246 friend ostream& operator<<( ostream& ostr, DataPumpType t );
00247
00252 const
bool getUseTranscoding(const string clientName="") const;
00253
00254 const string getTransLib(const string clientName, const SDP::PayloadTypes pt) const;
00255 const
int getScreenWidth(const string clientName) const;
00256 const
int getScreenHeight(const string clientName) const;
00257
00258
bool getUseDynReflection();
00259 const
char* getDynReflectionRepositioningMode();
00260
int getTimeThreshold();
00261 };
00262
00263 #endif