--- mintv/mintv.cpp 2003/03/01 15:23:26 1.3 +++ mintv/mintv.cpp 2003/03/07 18:17:09 1.4 @@ -31,10 +31,10 @@ static bool ntsc = false; const int PAL_WIDTH = 384; const int PAL_HEIGHT = 288; -const int NTSC_WIDTH = 320; +const int NTSC_WIDTH = 360; const int NTSC_HEIGHT = 240; -static int grab_width, grab_height; +static int grab_width = -1, grab_height; static int image_width, image_height; static int win_width, win_height; @@ -321,6 +321,7 @@ int main(int argc, char **argv) {"help", 0, 0, 'h'}, {"ntsc", 0, 0, 'n'}, {"port", 1, 0, 'p'}, + {"width", 1, 0, 'w'}, {NULL, 0, 0, 0} }; @@ -331,7 +332,7 @@ int main(int argc, char **argv) // Parse options for (;;) { int c; - if ((c = getopt_long(argc, argv, "hnp:", long_opts,NULL)) == -1) + if ((c = getopt_long(argc, argv, "hnp:w:", long_opts,NULL)) == -1) break; switch (c) { @@ -343,14 +344,18 @@ int main(int argc, char **argv) case 'p': port = atoi(optarg); break; + case 'w': + grab_width = atoi(optarg); + break; case 'h': default: fprintf(stderr, "50/60Hz video display application\n\n" "Options:\n" - " -h | --help this text\n" - " -n | --ntsc NTSC mode\n" - " -p | --port n Xv output port\n\n" + " -h | --help this text\n" + " -n | --ntsc NTSC mode\n" + " -p | --port n Xv output port\n" + " -w | --width n image width\n\n" "Keyboard commands:\n" " q quit\n" " 1/2 select channel\n" @@ -371,6 +376,7 @@ int main(int argc, char **argv) XtOverrideTranslations(app_shell, XtParseTranslationTable( "WM_PROTOCOLS: quit()\n" "q: quit()\n" + "Escape: quit()\n" "1: select_channel_1()\n" "2: select_channel_2()\n" "KP_7: inc_brightness()\n" @@ -431,11 +437,13 @@ port_found: // Set grab and window dimensions if (ntsc) { - grab_width = NTSC_WIDTH; + if (grab_width == -1) + grab_width = NTSC_WIDTH; grab_height = NTSC_HEIGHT; fps = NTSC_FPS; } else { - grab_width = PAL_WIDTH; + if (grab_width == -1) + grab_width = PAL_WIDTH; grab_height = PAL_HEIGHT; fps = PAL_FPS; }