[Phission-cvs] phission/examples/cpp/AvcodecTest/src AvcodecTest.cpp, 1.11, 1.12
Brought to you by:
pthoren
From: Philip T. <pt...@us...> - 2006-12-02 22:09:49
|
Update of /cvsroot/phission/phission/examples/cpp/AvcodecTest/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3753/AvcodecTest/src Modified Files: AvcodecTest.cpp Log Message: Set up the examples so they can be run automatically with a test script setting the channel/device parameters; Also made all the examples used for testing use the phArgTable and allocate it on the heap Changed the usage statements a bit and also the command line switches to them Index: AvcodecTest.cpp =================================================================== RCS file: /cvsroot/phission/phission/examples/cpp/AvcodecTest/src/AvcodecTest.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** AvcodecTest.cpp 13 Jun 2006 18:12:18 -0000 1.11 --- AvcodecTest.cpp 2 Dec 2006 22:09:47 -0000 1.12 *************** *** 24,35 **** int usage() { ! printf("\n\n\tUsage:\n"); ! printf("\t\t\t--delay <delay value in microseconds>\tdelay between frame updates\n"); ! printf("\t\t\t--fps <fps>\t\tframes per second speed for the displaying of the video.\n"); ! printf("\t\t\t--loop <value>\tloop the video <value> times; -1 for infinity\n"); ! printf("\t\t\t--help\t\t\tdisplay usage\n"); ! printf("\t\t\t--nodisplay\tdisable the allocation, opening or any use of a display.\n"); ! printf("\t\t\t--test <value>\tload 'value' number of frames/files/images\n"); ! printf("\t\t\t--file <avi_data_file>\t\t\tavi source (required)\n"); printf("\n\n"); exit(1); --- 24,35 ---- int usage() { ! printf("\n\nUsage:\n"); ! printf("\t--delay <value:us> Delay between frame updates\n"); ! printf("\t--fps <fps> Frames per second speed for the displaying of the video.\n"); ! printf("\t--loop <value> Loop the video <value> times; -1 for infinity\n"); ! printf("\t--help Display usage\n"); ! printf("\t--nodisplay Disable the allocation, opening or any use of a display.\n"); ! printf("\t--test <value> Load 'value' number of frames/files/images\n"); ! printf("\t--file <avi_data_file> avi source (required)\n"); printf("\n\n"); exit(1); *************** *** 144,149 **** int test = 0; - phArgTable arg_parser; - /* Stuff added to support avi decoding using avicodec */ AVFormatContext *pFormatCtx = NULL; --- 144,147 ---- *************** *** 177,198 **** int height = 0; /* Setup and parse all the arguments */ ! rc = arg_parser.add("--delay", &delay, phARG_INT); ! phCHECK_RC(rc, NULL, "arg_parser.add"); ! rc = arg_parser.add("--fps", &fps, phARG_INT); ! phCHECK_RC(rc, NULL, "arg_parser.add"); ! rc = arg_parser.add("--file", &filename, phARG_CHAR); ! phCHECK_RC(rc, NULL, "arg_parser.add"); ! rc = arg_parser.add("--test", &test, phARG_INT); ! phCHECK_RC(rc,NULL,"arg_parser.add"); ! rc = arg_parser.add("--nodisplay", (void *)&glbl_disable_displays, phARG_BOOL); ! phCHECK_RC(rc,NULL,"arg_parser.add"); ! rc = arg_parser.add("--loop",&loop, phARG_INT); ! phCHECK_RC(rc,NULL,"arg_parser.add"); ! rc = arg_parser.add("--help",(void *)&usage, phARG_FUNC); ! phCHECK_RC(rc,NULL,"arg_parser.add"); ! rc = arg_parser.parse(argc,argv); ! phCHECK_RC(rc,NULL,"arg_parser.parse"); if (filename == NULL) --- 175,198 ---- int height = 0; + phArgTable *arg_parser = new phArgTable(); + /* Setup and parse all the arguments */ ! rc = arg_parser->add("--delay", &delay, phARG_INT); ! phCHECK_RC(rc, NULL, "arg_parser->add"); ! rc = arg_parser->add("--fps", &fps, phARG_INT); ! phCHECK_RC(rc, NULL, "arg_parser->add"); ! rc = arg_parser->add("--file", &filename, phARG_CHAR); ! phCHECK_RC(rc, NULL, "arg_parser->add"); ! rc = arg_parser->add("--test", &test, phARG_INT); ! phCHECK_RC(rc,NULL,"arg_parser->add"); ! rc = arg_parser->add("--nodisplay", (void *)&glbl_disable_displays, phARG_BOOL); ! phCHECK_RC(rc,NULL,"arg_parser->add"); ! rc = arg_parser->add("--loop",&loop, phARG_INT); ! phCHECK_RC(rc,NULL,"arg_parser->add"); ! rc = arg_parser->add("--help",(void *)&usage, phARG_FUNC); ! phCHECK_RC(rc,NULL,"arg_parser->add"); ! rc = arg_parser->parse(argc,argv); ! phCHECK_RC(rc,NULL,"arg_parser->parse"); if (filename == NULL) *************** *** 390,393 **** --- 390,395 ---- phFree(filename); + phDelete(arg_parser); + // free up the image buffer allocation phDeleteArray(buffer); |