Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

mainVideoJobManager.cpp

Go to the documentation of this file.
00001 #include "Basis/CmdOptions.h"
00002 #include "Core/VideoJob/Manager.h"
00003 
00004 // since we are not using libraries:
00005 #include "Link/ImpalaLib.cpp"
00006 
00007 namespace Impala
00008 {
00009 namespace Application
00010 {
00011 
00012 
00013 int
00014 mainVideoJobManager(int argc, char* argv[])
00015 {
00016     CmdOptions& options = CmdOptions::GetInstance();
00017     options.Initialise(false, false, true);
00018     String usageStr = "videoSet processDefinition jobServerAddress \n\n";
00019     options.AddOption(0, "maskFile", "file", "mask.txt");
00020     options.AddOption(0, "videoUpdate", "", "0");
00021     options.AddOption(0, "imageWidth", "iWidth", "320");
00022     if (! options.ParseArgs(argc, argv, usageStr, 3))
00023         return 1;
00024 
00025     ILOG_VAR(Impala.Application.mainVideoJobManager);
00026 
00027     String videoSetName = options.GetArg(0);
00028     String processDefinitionFile = options.GetArg(1);
00029     String serverAddr = options.GetArg(2);
00030     int colonPos = serverAddr.find(":");
00031     if (colonPos <= 0)
00032     {
00033         ILOG_ERROR("Not a valid server address (port number is missing): " <<
00034                    serverAddr);
00035         return 2;
00036     }
00037     int port = atol(serverAddr.substr(colonPos + 1));
00038     serverAddr = serverAddr.substr(0, colonPos);
00039 
00040     String passwordFile = options.GetString("passwordFile");
00041     String maskFileName = options.GetString("maskFile", "mask.txt");
00042     int serverRequestIntervalSec = options.GetInt("requestIntervalSec", 10);
00043 
00044     Core::VideoJob::Manager manager(videoSetName, processDefinitionFile,
00045                                     serverAddr, port, passwordFile, options);
00046     manager.SetMaskFileName(maskFileName);
00047     return manager.Start(serverRequestIntervalSec,options);
00048 }
00049 
00050 } // namespace 
00051 } // namespace 
00052 
00053 int
00054 main(int argc, char* argv[])
00055 {
00056 
00057 #ifdef NO_DIALOGONCRASH
00058 #ifdef WIN32
00059     DWORD oldMode = ::SetErrorMode(SEM_NOGPFAULTERRORBOX);
00060     ::SetErrorMode(oldMode | SEM_NOGPFAULTERRORBOX);
00061 #endif
00062 #endif
00063 
00064     return Impala::Application::mainVideoJobManager(argc, argv);
00065 }

Generated on Fri Mar 19 09:30:31 2010 for ImpalaSrc by  doxygen 1.5.1