From: maldworth <mal...@gm...> - 2013-04-20 22:19:30
|
I'm having problems with the Just-Focus.c sample. It compiles fine, however there's two functions. With argc=1, it does an autofocus. On my Nikon D90 this works like a charm. Then with my D90 still plugged in, I try with the argument of 1, and it gives me the error: manual focus 1 -> 128.000000 could not set config tree to autofocus: -1 Error: Unspecified error But focus works in another sample (preview.c). But the one difference is, it only works because it calls the gp_camera_capture_preview (which flips the mirror up, and then it manually focuses). So to test this, I modified sample-justfocus.c to have: ... else if(argc == 2) { CameraFile *file; retval = gp_file_new(&file); if (retval != GP_OK) { fprintf(stderr,"gp_file_new: %d\n", retval); exit(1); } retval = gp_camera_capture_preview(camera, file, context); gp_file_unref(file); else if(argc == 2) { //########### New Code Here CameraFile *file; retval = gp_file_new(&file); if (retval != GP_OK) { fprintf(stderr,"gp_file_new: %d\n", retval); exit(1); } retval = gp_camera_capture_preview(camera, file, context); gp_file_unref(file); //########## End of Inserted Code int value = atoi(argv[1]); retval = camera_manual_focus(camera, value, context); } ... Is there a reason that this must be called prior to being able to set the focus? Is there a way to avoid this? Thanks -- View this message in context: http://gphoto.10949.n7.nabble.com/Just-Focus-sample-tp13129.html Sent from the gphoto-devel mailing list archive at Nabble.com. |