int
main (int argc, char **argv)
{
  static const GOptionEntry test_goptions[] = {
    {G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &filenames, NULL},
    {NULL, '\0', 0, 0, NULL, NULL, NULL}
  };
  GOptionContext *ctx;
  GError *opt_err = NULL;

  gtk_init (&argc, &argv);

  /* command line option parsing */
  ctx = g_option_context_new (" VIDEOFILE");
  g_option_context_add_group (ctx, gst_init_get_option_group ());
  g_option_context_add_main_entries (ctx, test_goptions, NULL);

  if (!g_option_context_parse (ctx, &argc, &argv, &opt_err)) {
    g_error ("Error parsing command line options: %s", opt_err->message);
    return -1;
  }

  if (filenames == NULL || filenames[0] == NULL || filenames[0][0] == '\0') {
    g_printerr ("Please specify a path to a video file\n\n");
    return -1;
  }

  run_gui (filenames[0]);

  g_free (filenames);
  g_option_context_free (ctx);

  return 0;
}
Ejemplo n.º 2
0
int main(int argc, char **argv)
{
	run_as_emulator(argv[0]);
	init_settings();
	term_fd = open_tty();
	if (term_fd < 0) {
		printf("Unable to open I/O to terminal (/dev/tty), r=%d\n",
			term_fd);
		sleep(1);
		exit(1);
	}
	create_window(&argc, &argv);
	run_gui();
	close_serial_port();
	close(term_fd);
	return 0;
}