00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "pfspd_usr.h"
00012 #include "parse_options.h"
00013
00014 pfspdUsr::pfspdUsr
00015 (
00016 const Id& n,
00017 Out<pfspd_args_t>& arguments,
00018 char* filename
00019 )
00020 :
00021 Process(n),
00022 argumentsP(id("argumentsP"), arguments),
00023 cfg_filename(filename)
00024 {
00025 }
00026
00027 void pfspdUsr::main()
00028 {
00029 pfspd_args_t arguments;
00030
00031 option_t options[] =
00032 {
00033 { "-path", "str", "srcdir", &arguments.path, "env. variable containing path of filename"},
00034 { "file", "str", NULL, &arguments.filename, "input filename"},
00035 { "-frames", "int", "1", &arguments.num_frames, "#frames to process"},
00036 { "-hsize", "int", "720", &arguments.h_size, "width of output stream"},
00037 { "-vsize", "int", "480", &arguments.v_size, "height of output stream"},
00038 { "{-P_NO_COLOR,-P_COLOR_422,-P_COLOR_420,-P_COLOR_444_PL,-P_COLOR_422_PL,-P_COLOR_420_PL,-P_COLOR_RGB,-P_STREAM,-P_UNKNOWN_COLOR}",
00039 "enum", "-P_COLOR_420_PL", &arguments.color_format, "color format (see cpfspd.h)"},
00040 { "-scan", "int", "0", &arguments.scan, "scan mode: 0 if interlace, 1 if progressive"},
00041 { NULL, NULL, NULL, NULL, NULL}
00042 };
00043
00044 #ifdef VERBOSE
00045 printf("%s: parsing cfg-file %s\n",
00046 fullName(),
00047 cfg_filename
00048 );
00049 #endif
00050 char *myArgs[] = {"", "-ini", cfg_filename};
00051 if (parse_options((char*)fullName(), 3, myArgs, options))
00052 {
00053 exit(1);
00054 }
00055
00056 #ifdef VERBOSE
00057 print_option_values(cfg_filename, options);
00058 #endif
00059
00060 write(argumentsP, arguments);
00061 }