move options to gtk-app.h, so new implementations can share them
[sparrow.git] / gtk-app.h
blob982d74f6709acbfa1a621eab9f0af6c3bbf30cd0
1 #define WIDTH 800
2 #define HEIGHT 600
3 //#define FPS 20
5 #define QUOTE_(x) #x
6 #define QUOTE(x) QUOTE_(x)
8 static gboolean option_fake = FALSE;
9 static gboolean option_fullscreen = FALSE;
10 static gint option_debug = -1;
11 static gint option_timer = -1;
12 static gint option_screens = 1;
13 static gint option_fps = 20;
14 static guint option_first_screen = 0;
15 static guint option_serial = 0;
16 static char **option_reload = NULL;
17 static char **option_save = NULL;
18 static char *option_avi = NULL;
20 //static gboolean option_overlay = FALSE;
22 #define MAX_SCREENS 2
24 static GOptionEntry entries[] =
26 { "fake-source", 0, 0, G_OPTION_ARG_NONE, &option_fake,
27 "use videotestsrc, not v4l2src (mostly won't work)", NULL },
28 { "full-screen", 'f', 0, G_OPTION_ARG_NONE, &option_fullscreen, "run full screen", NULL },
29 { "fps", 'p', 0, G_OPTION_ARG_INT, &option_fps,
30 "speed (Frames per second, multiple of 5 <= 30)", "FPS" },
31 { "screens", 's', 0, G_OPTION_ARG_INT, &option_screens, "Use this many screens, (max "
32 QUOTE(MAX_SCREENS) ")", "S" },
33 { "first-screen", 0, 0, G_OPTION_ARG_INT, &option_first_screen, "Start with this screen", "S" },
34 { "debug", 'd', 0, G_OPTION_ARG_INT, &option_debug, "Save screen's debug images in /tmp", "SCREEN" },
35 { "timer", 't', 0, G_OPTION_ARG_INT, &option_timer, "Log frame times in /tmp/timer.log", "SCREEN" },
36 { "serial-calibration", 'c', 0, G_OPTION_ARG_NONE, &option_serial,
37 "calibrate projections one at a time, not together", NULL },
38 { "reload", 'r', 0, G_OPTION_ARG_FILENAME_ARRAY, &option_reload,
39 "load calibration data from FILE (one per screen)", "FILE" },
40 { "save", 'S', 0, G_OPTION_ARG_FILENAME_ARRAY, &option_save,
41 "save calibration data to FILE (one per screen)", "FILE" },
42 { "avi", 'a', 0, G_OPTION_ARG_FILENAME, &option_avi,
43 "save mjpeg video to FILE", "FILE" },
44 // { "overlay", 'o', 0, G_OPTION_ARG_NONE, &option_overlay, "Use some kind of overlay", NULL },
45 { NULL, 0, 0, 0, NULL, NULL, NULL }
49 typedef struct windows_s {
50 int realised;
51 int requested;
52 GstElement *sinks[MAX_SCREENS];
53 XID xwindows[MAX_SCREENS];
54 GtkWidget *gtk_windows[MAX_SCREENS];
55 } windows_t;
58 #define COMMON_CAPS \
59 "framerate", GST_TYPE_FRACTION, option_fps, 1, \
60 "width", G_TYPE_INT, WIDTH, \
61 "height", G_TYPE_INT, HEIGHT, \
62 NULL