diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2014-10-09 10:24:16 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2014-10-09 10:24:16 +0000 |
commit | 1b9ead06024d55b900053dcd79b627a94f7a9b41 (patch) | |
tree | 534eec642f44327cd670ca1e40bda89c0426a439 /examples/preview.c | |
parent | 489c62cbdef1a6c08c898a9691276085c22a1582 (diff) | |
download | libgphoto2-1b9ead06024d55b900053dcd79b627a94f7a9b41.tar.gz |
pass onoff argument to autofocus
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15209 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'examples/preview.c')
-rw-r--r-- | examples/preview.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/examples/preview.c b/examples/preview.c index 2af5c6002..094df21f7 100644 --- a/examples/preview.c +++ b/examples/preview.c @@ -138,6 +138,11 @@ main(int argc, char **argv) { exit (1); } canon_enable_capture(canon, TRUE, canoncontext); + retval = camera_eosviewfinder(canon,canoncontext,1); + if (retval != GP_OK) { + fprintf(stderr,"camera_eosviewfinder(1): %d\n", retval); + exit(1); + } /*set_capturetarget(canon, canoncontext);*/ printf("Taking 100 previews and saving them to snapshot-XXX.jpg ...\n"); for (i=0;i<100;i++) { @@ -153,7 +158,9 @@ main(int argc, char **argv) { /* autofocus every 10 shots */ if (i%10 == 9) { - camera_auto_focus (canon, canoncontext); + camera_auto_focus (canon, canoncontext, 1); + /* FIXME: wait a bit and/or poll events ? */ + camera_auto_focus (canon, canoncontext, 0); } else { camera_manual_focus (canon, (i/10-5)/2, canoncontext); } @@ -183,6 +190,13 @@ main(int argc, char **argv) { capture_to_file(canon, canoncontext, output_file); */ } + retval = camera_eosviewfinder(canon,canoncontext,0); + if (retval != GP_OK) { + fprintf(stderr,"camera_eosviewfinder(0): %d\n", retval); + exit(1); + } + + sleep(10); gp_camera_exit(canon, canoncontext); return 0; } |