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

int Impala::Application::Video::mainVideo ( int  argc,
char *  argv[] 
)

Definition at line 137 of file mainVideo.cpp.

References Impala::CmdOptions::AddOption(), Impala::Core::Stream::RgbDataDstFactory::Construct(), Impala::Core::Stream::RgbDataSrcFactory::Construct(), DemoVideo(), Impala::Core::Stream::RgbDataDstFactory::DST_AVI, Impala::Core::Stream::RgbDataDstFactory::DST_DX, Impala::Core::Stream::RgbDataDstFactory::DST_OGL, Impala::Core::Stream::RgbDataDstFactory::DST_WIN, Impala::Core::Stream::RgbDataSrc::FrameHeight(), Impala::Core::Stream::RgbDataSrc::FrameWidth(), gDoLoop, gDoRandom, gDst, gDstHeight, gDstWidth, Impala::CmdOptions::GetArg(), Impala::CmdOptions::GetBool(), Impala::CmdOptions::GetInstance(), Impala::CmdOptions::GetInt(), Impala::CmdOptions::GetString(), gGopSize, gNrFrames, gRotateLeft, gRotateRight, gSrc, gStepSize, gVerbose, Impala::CmdOptions::Initialise(), Impala::Core::Stream::RgbDataDstFactory::Instance(), Impala::Core::Stream::RgbDataSrcFactory::Instance(), Impala::Core::Stream::RgbDataSrc::LastFrame(), Impala::CmdOptions::ParseArgs(), Impala::Core::Stream::RgbDataDst::Valid(), Impala::Core::Stream::RgbDataSrc::Valid(), and Impala::Core::Stream::RgbDataDst::WindowManage().

Referenced by main().

00138 {
00139     CmdOptions& options = CmdOptions::GetInstance();
00140     options.Initialise(true);
00141     options.AddOption(0, "rotateLeft", "", "0");
00142     options.AddOption(0, "rotateRight", "", "0");
00143     options.AddOption(0, "gop", "nr", "15");
00144     options.AddOption(0, "random", "", "0");
00145     options.AddOption(0, "dstDX", "", "0");
00146     if (! options.ParseArgs(argc, argv, "camera|filename ogl|win|filename", 2))
00147         return 1;
00148 
00149     gVerbose = options.GetInt("verb");
00150     gStepSize = options.GetInt("stepSize");
00151     gRotateLeft = options.GetBool("rotateLeft");
00152     gRotateRight = options.GetBool("rotateRight");
00153     gGopSize = options.GetInt("gop");
00154     gDoRandom = options.GetBool("random");
00155     gDoLoop = options.GetBool("loop");
00156     gNrFrames = options.GetInt("numberFrames");
00157 
00158     std::string srcName = options.GetArg(0);
00159     RgbDataSrcFactory& factory = RgbDataSrcFactory::Instance();
00160     gSrc = factory.Construct(srcName, options.GetString("src"));
00161     if (! gSrc->Valid())
00162     {
00163         std::cout << "RgbDataSrc failed" << std::endl;
00164         return 0;
00165     }
00166     if (gVerbose)
00167         std::cout << gSrc->LastFrame()+1 << " frames of " << gSrc->FrameWidth() 
00168                   << " x " << gSrc->FrameHeight() << std::endl;
00169 
00170     std::string dstName = options.GetArg(1);
00171     int theDataDst = RgbDataDstFactory::DST_OGL;
00172     if (dstName == "ogl")
00173         theDataDst = RgbDataDstFactory::DST_OGL;
00174     else if (dstName == "win")
00175         theDataDst = RgbDataDstFactory::DST_WIN;
00176     else theDataDst = RgbDataDstFactory::DST_AVI;
00177     if (options.GetBool("dstDX"))
00178         theDataDst = RgbDataDstFactory::DST_DX;
00179 
00180     gDstWidth = gSrc->FrameWidth();
00181     gDstHeight = gSrc->FrameHeight();
00182     if (gRotateLeft || gRotateRight)
00183     {
00184         gDstWidth = gSrc->FrameHeight();
00185         gDstHeight = gSrc->FrameWidth();
00186     }
00187     RgbDataDstFactory& fac = RgbDataDstFactory::Instance();
00188     gDst = fac.Construct(theDataDst, dstName, gDstWidth, gDstHeight);
00189 
00190     if (! gDst->Valid())
00191     {
00192         std::cout << "RgbDataDst failed" << std::endl;
00193         return 0;
00194     }
00195     gDst->WindowManage(0, 0);
00196 
00197     return DemoVideo();
00198 }

Here is the call graph for this function:


Generated on Fri Mar 19 10:52:20 2010 for ImpalaSrc by  doxygen 1.5.1