summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2011-12-04 15:25:53 +0000
committerMarcus Meissner <marcus@jet.franken.de>2011-12-04 15:25:53 +0000
commitc381c006a682469ac0bba26edd4ed3d594e389cc (patch)
tree39b3dd2a98c0d2b08b325ae0f2e89b9f5b094d29
parente61b35d1710f3623ed93880b80f84316ad2695bd (diff)
downloadlibgphoto2-c381c006a682469ac0bba26edd4ed3d594e389cc.tar.gz
on preview capture enable the canon capture
git-svn-id: https://svn.code.sf.net/p/gphoto/code/branches/libgphoto2-2_4/libgphoto2@13798 67ed7778-7388-44ab-90cf-0a291f65f57c
-rw-r--r--camlibs/ptp2/TESTPLAN.ptp28
-rw-r--r--camlibs/ptp2/library.c6
2 files changed, 10 insertions, 4 deletions
diff --git a/camlibs/ptp2/TESTPLAN.ptp2 b/camlibs/ptp2/TESTPLAN.ptp2
index fcfd06789..d2abb0b7b 100644
--- a/camlibs/ptp2/TESTPLAN.ptp2
+++ b/camlibs/ptp2/TESTPLAN.ptp2
@@ -8,9 +8,9 @@ Canon Powershot series (currently: Powershot SX100IS)
- Card configured, but not inserted (capturetarget=1) PASS
--capture-image-and-download -F 3 -I 5
- - via SDRAM (capturetarget=0): TODO
- - via Card (capturetarget=1): TODO
- - Card configured, but not inserted (capturetarget=1) TODO
+ - via SDRAM (capturetarget=0): PASS
+ - via Card (capturetarget=1): PASS
+ - Card configured, but not inserted (capturetarget=1) PASS
time gphoto2 --capture-image-and-download -F 5 -I 1
- via SDRAM (capturetarget=0)
@@ -23,7 +23,7 @@ Canon Powershot series (currently: Powershot SX100IS)
--capture-preview
- commandline tool TODO
+ commandline tool PASS
gtkam TODO
mixed with --capture-image-and-download TODO
diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c
index da49189a2..1d12d3ea3 100644
--- a/camlibs/ptp2/library.c
+++ b/camlibs/ptp2/library.c
@@ -1672,6 +1672,12 @@ camera_capture_preview (Camera *camera, CameraFile *file, GPContext *context)
/* Canon PowerShot / IXUS preview mode */
if (ptp_operation_issupported(params, PTP_OC_CANON_ViewfinderOn)) {
SET_CONTEXT_P(params, context);
+ /* check if we need to prepare capture */
+ if (!params->canon_event_mode) {
+ ret = camera_prepare_capture (camera, context);
+ if (ret != GP_OK)
+ return ret;
+ }
if (!params->canon_viewfinder_on) { /* enable on demand, but just once */
ret = ptp_canon_viewfinderon (params);
if (ret != PTP_RC_OK) {