examples: camerabin2: Fix GOptionEntry array

Use no flags instead of passing G_OPTION_ARG_OPTIONAL to options that
must have an argument
This commit is contained in:
Thiago Santos 2011-05-13 09:11:35 -03:00
parent 7ee207b359
commit 0bbbbd22d1

View file

@ -756,41 +756,40 @@ main (int argc, char *argv[])
gchar *fn_option = NULL;
GOptionEntry options[] = {
{"ev-compensation", '\0', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_STRING,
&ev_option,
{"ev-compensation", '\0', 0, G_OPTION_ARG_STRING, &ev_option,
"EV compensation for source element GstPhotography interface", NULL},
{"aperture", '\0', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_INT, &aperture,
{"aperture", '\0', 0, G_OPTION_ARG_INT, &aperture,
"Aperture (size of lens opening) for source element GstPhotography interface",
NULL},
{"flash-mode", '\0', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_INT,
{"flash-mode", '\0', 0, G_OPTION_ARG_INT,
&flash_mode,
"Flash mode for source element GstPhotography interface", NULL},
{"scene-mode", '\0', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_INT,
{"scene-mode", '\0', 0, G_OPTION_ARG_INT,
&scene_mode,
"Scene mode for source element GstPhotography interface", NULL},
{"exposure", '\0', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_INT64,
{"exposure", '\0', 0, G_OPTION_ARG_INT64,
&exposure,
"Exposure time (in ms) for source element GstPhotography interface",
NULL},
{"iso-speed", '\0', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_INT,
{"iso-speed", '\0', 0, G_OPTION_ARG_INT,
&iso_speed,
"ISO speed for source element GstPhotography interface", NULL},
{"white-balance-mode", '\0', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_INT,
{"white-balance-mode", '\0', 0, G_OPTION_ARG_INT,
&wb_mode,
"White balance mode for source element GstPhotography interface", NULL},
{"colour-tone-mode", '\0', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_INT,
{"colour-tone-mode", '\0', 0, G_OPTION_ARG_INT,
&color_mode,
"Colour tone mode for source element GstPhotography interface", NULL},
{"directory", '\0', 0, G_OPTION_ARG_STRING, &fn_option,
"Directory for capture file(s) (default is current directory)", NULL},
{"mode", '\0', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_INT, &mode,
{"mode", '\0', 0, G_OPTION_ARG_INT, &mode,
"Capture mode (default = 1 (image), 2 = video)", NULL},
{"capture-time", '\0', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_INT,
{"capture-time", '\0', 0, G_OPTION_ARG_INT,
&capture_time,
"Time to capture video in seconds (default = 10)", NULL},
{"capture-total", '\0', 0, G_OPTION_ARG_INT, &capture_total,
"Total number of captures to be done (default = 1)", NULL},
{"zoom", '\0', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_INT, &zoom,
{"zoom", '\0', 0, G_OPTION_ARG_INT, &zoom,
"Zoom (100 = 1x (default), 200 = 2x etc.)", NULL},
{"wrapper-source", '\0', 0, G_OPTION_ARG_STRING, &wrappersrc_name,
"Camera source wrapper used for setting the video source (default is wrappercamerabinsrc)",
@ -825,13 +824,13 @@ main (int argc, char *argv[])
"Video encoding profile name", NULL},
{"encoding-profile-filename", '\0', 0, G_OPTION_ARG_STRING, &gep_filename,
"Video encoding profile filename", NULL},
{"image-capture-caps", '\0', G_OPTION_FLAG_OPTIONAL_ARG,
{"image-capture-caps", '\0', 0,
G_OPTION_ARG_STRING, &image_capture_caps_str,
"Image capture caps (e.g. video/x-raw-rgb,width=640,height=480)", NULL},
{"viewfinder-caps", '\0', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_STRING,
{"viewfinder-caps", '\0', 0, G_OPTION_ARG_STRING,
&viewfinder_caps_str,
"Viewfinder caps (e.g. video/x-raw-rgb,width=640,height=480)", NULL},
{"video-capture-caps", '\0', G_OPTION_FLAG_OPTIONAL_ARG,
{"video-capture-caps", '\0', 0,
G_OPTION_ARG_STRING, &video_capture_caps_str,
"Video capture caps (e.g. video/x-raw-rgb,width=640,height=480)", NULL},
{NULL}