From b5062edafd3d608bf8fc76aa45a00a8b2e64a211 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 4 Dec 2011 15:26:34 +0000 Subject: [PATCH] set event mode if we enter capture again prepare capture on livewview git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@13799 67ed7778-7388-44ab-90cf-0a291f65f57c --- camlibs/ptp2/library.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index b43319ded..a5a104257 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -1644,6 +1644,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) { @@ -2241,6 +2247,11 @@ camera_canon_capture (Camera *camera, CameraCaptureType type, CameraFilePath *pa return GP_ERROR_NOT_SUPPORTED; } } + if (!params->canon_event_mode) { + propval.u16 = 0; + ret = ptp_getdevicepropvalue(params, PTP_DPC_CANON_EventEmulateMode, &propval, PTP_DTC_UINT16); + if (ret == PTP_RC_OK) params->canon_event_mode = propval.u16; + } if (ptp_property_issupported(params, PTP_DPC_CANON_CaptureTransferMode)) { if ((GP_OK == gp_setting_get("ptp2","capturetarget",buf)) && !strcmp(buf,"sdram"))