14 // Long options that have no corresponding short option.
17 OPTION_SLOW_DOWN_INPUT = 1001
22 fprintf(stderr, "Usage: futatabi [OPTION]... SOURCE_URL\n");
23 fprintf(stderr, "\n");
24 fprintf(stderr, " --help print usage information\n");
25 fprintf(stderr, " --slow-down-input slow down input to realtime (default on if no\n");
26 fprintf(stderr, " source URL given)");
27 fprintf(stderr, " -q, --interpolation-quality N 1 = fastest\n");
28 fprintf(stderr, " 2 = default (realtime 720p on fast embedded GPUs)\n");
29 fprintf(stderr, " 3 = good (realtime 720p on GTX 970 or so)\n");
30 fprintf(stderr, " 4 = best (not realtime on any current GPU)\n");
31 fprintf(stderr, " -d, --working-directory DIR where to store frames and database\n");
34 void parse_flags(int argc, char * const argv[])
36 static const option long_options[] = {
37 { "help", no_argument, 0, OPTION_HELP },
38 { "slow-down-input", no_argument, 0, OPTION_SLOW_DOWN_INPUT },
39 { "interpolation-quality", required_argument, 0, 'q' },
40 { "working-directory", required_argument, 0, 'd' },
45 int c = getopt_long(argc, argv, "q:d:", long_options, &option_index);
51 case OPTION_SLOW_DOWN_INPUT:
52 global_flags.slow_down_input = true;
55 global_flags.interpolation_quality = atoi(optarg);
58 global_flags.working_directory = optarg;
64 fprintf(stderr, "Unknown option '%s'\n", argv[option_index]);
65 fprintf(stderr, "\n");
71 if (global_flags.interpolation_quality < 1 || global_flags.interpolation_quality > 4) {
72 fprintf(stderr, "Interpolation quality must be 1, 2, 3 or 4.\n");