From: <enl...@li...> - 2002-02-26 20:02:40
|
Enlightenment CVS committal Author : gilbertt Project : misc Module : camE Dir : misc/camE Modified Files: example.camErc webcam.c Log Message: Patch from David H Muir <dh...@li...> (love that domain name) to add an archive_shot_every to the config file. Set to 1 to archive every shot, 2 to archive every other shot, 3 for every third... etc. Set to 0 to disable archiving. =================================================================== RCS file: /cvsroot/enlightenment/misc/camE/example.camErc,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- example.camErc 7 Sep 2001 20:58:06 -0000 1.18 +++ example.camErc 26 Feb 2002 20:02:06 -0000 1.19 @@ -9,6 +9,8 @@ # camE uploads to a temp file, and moves it across when done # this way people don't view half-uploaded images tmp = uploading.jpg +# keep the connection open (1) or reopen it for each shot (0) +keepalive = 1 # do passive ftp? passive = 1 #an interface to use for non-passive ftp. use "-" to let libcurl choose, or @@ -63,6 +65,9 @@ archive = /opt/images/webcam # extension (determines type) of archived images. archive_ext = jpg +# determines how many shots are taken before a pic is archived +# (1 == every pic, 0 == don't archive) +archive_shot_every = 1 # jpeg quality (you can save as png etc too, but then quality does squat) quality = 80 input = 0 =================================================================== RCS file: /cvsroot/enlightenment/misc/camE/webcam.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -3 -r1.53 -r1.54 --- webcam.c 23 Feb 2002 12:52:35 -0000 1.53 +++ webcam.c 26 Feb 2002 20:02:06 -0000 1.54 @@ -93,6 +93,7 @@ char *ttf_dir = "/usr/X11R6/lib/X11/fonts/TrueType"; char *archive_ext = "jpg"; char *grab_archive = NULL; +int archive_shot_every = 1; /* default to archive every shot */ char *grab_blockfile = NULL; char *upload_blockfile = NULL; char *grab_postprocess = NULL; @@ -610,8 +611,12 @@ time_t t; struct tm *tm; struct stat st; + static int shot_counter = 0; - if (grab_archive) { + shot_counter++; + + if (grab_archive && archive_shot_every + && shot_counter >= archive_shot_every) { time(&t); tm = localtime(&t); strftime(date, 127, "%Y-%m-%d_%H%M%S", tm); @@ -622,6 +627,7 @@ } while (stat(buffer, &st) == 0); save_image(im, buffer); + shot_counter = 0; } } @@ -637,6 +643,7 @@ if (!logfile) { va_start(args, fmt); + fprintf(stderr, "camE: "); vfprintf(stderr, fmt, args); va_end(args); return; @@ -1246,6 +1253,8 @@ scale_width = i; if (-1 != (i = cfg_get_int("grab", "scale_height"))) scale_height = i; + if (-1 != (i = cfg_get_int("grab", "archive_shot_every"))) + archive_shot_every = i; if (cam_framerate > 60) cam_framerate = 60; |