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
This commit is contained in:
Marcus Meissner
2011-12-04 15:26:34 +00:00
parent c636ce30d5
commit b5062edafd

View File

@@ -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"))