00001
00002
00003
00004 #include "videomux_usr.h"
00005 #include "parse_options.h"
00006
00007 VideoMuxUsr::VideoMuxUsr
00008 (
00009 const Id& n,
00010 Out<videomux_args_t>& arguments,
00011 char* filename
00012 )
00013 :
00014 Process(n),
00015 argumentsP(id("argumentsP"),arguments),
00016 cfg_filename(filename)
00017 {
00018 }
00019
00020 void VideoMuxUsr::main()
00021 {
00022 videomux_args_t arguments;
00023
00024 option_t options[] =
00025 {
00026 { "-NSTRM", "int", "2", &arguments.NSTRM, "number of video streams"},
00027 { "-hpos0", "int", "0", &arguments.hpos[0], "horizontal position of stream 0"},
00028 { "-vpos0", "int", "0", &arguments.vpos[0], "vertical position of stream 0"},
00029 { "-depth0", "int", "0", &arguments.depth[0], "depth of stream 0"},
00030 { "-hpos1", "int", "0", &arguments.hpos[1], "horizontal position of stream 1"},
00031 { "-vpos1", "int", "0", &arguments.vpos[1], "vertical position of stream 1"},
00032 { "-depth1", "int", "0", &arguments.depth[1], "depth of stream 1"},
00033 { "-hpos2", "int", "0", &arguments.hpos[2], "horizontal position of stream 2"},
00034 { "-vpos2", "int", "0", &arguments.vpos[2], "vertical position of stream 2"},
00035 { "-depth2", "int", "0", &arguments.depth[2], "depth of stream 2"},
00036 { "-hpos3", "int", "0", &arguments.hpos[3], "horizontal position of stream 3"},
00037 { "-vpos3", "int", "0", &arguments.vpos[3], "vertical position of stream 3"},
00038 { "-depth3", "int", "0", &arguments.depth[3], "depth of stream 3"},
00039 { NULL, NULL, NULL, NULL, NULL}
00040 };
00041
00042 #ifdef VERBOSE
00043 printf("%s: parsing cfg-file %s\n",
00044 fullName(),
00045 cfg_filename
00046 );
00047 #endif
00048 char *muxArgs[] = {"", "-ini", cfg_filename};
00049 if (parse_options((char*)fullName(), 3, muxArgs, options))
00050 {
00051 exit(1);
00052 }
00053
00054 #ifdef VERBOSE
00055 print_option_values(cfg_filename, options);
00056 printf("\n");
00057 #endif
00058
00059 write(argumentsP, arguments);
00060 }