diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2020-05-10 18:28:59 +0200 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2020-05-10 18:28:59 +0200 |
commit | 07504bd196447c0999df93497dc2996aeb7e22a1 (patch) | |
tree | 18a4ce039ebe3a5bd741cafc2e7eb1e429a459c8 /camlibs/ptp2/library.c | |
parent | e4b6c0e73f6f40d2a9f0bb9c9e780ec07a7ec98c (diff) | |
download | libgphoto2-07504bd196447c0999df93497dc2996aeb7e22a1.tar.gz |
move it even lower, to avoid calling it too often
Diffstat (limited to 'camlibs/ptp2/library.c')
-rw-r--r-- | camlibs/ptp2/library.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index 023b685c0..957940b84 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -3157,30 +3157,30 @@ camera_capture_preview (Camera *camera, CameraFile *file, GPContext *context) value.u8 = 0; enable_liveview: - if (have_prop(camera, params->deviceinfo.VendorExtensionID, PTP_DPC_NIKON_LiveViewProhibitCondition)) { - PTPPropertyValue cond; - C_PTP (ptp_getdevicepropvalue (params, PTP_DPC_NIKON_LiveViewProhibitCondition, &cond, PTP_DTC_UINT32)); - - if (cond.u32) { - /* we could have multiple reasons, but just report the first one. by decreasing order of possibility */ - if (cond.u32 & (1<<8)) { gp_context_error (context, _("Liveview cannot start: Battery exhausted")); return GP_ERROR; } - if (cond.u32 & (1<<17)){ gp_context_error (context, _("Liveview cannot start: Temperature too high")); return GP_ERROR; } - if (cond.u32 & (1<<9)) { gp_context_error (context, _("Liveview cannot start: TTL error")); return GP_ERROR; } - if (cond.u32 & (1<<22)){ gp_context_error (context, _("Liveview cannot start: In Mirror-up operation")); return GP_ERROR; } - if (cond.u32 & (1<<24)){ gp_context_error (context, _("Liveview cannot start: Lens is retracting")); return GP_ERROR; } - if (cond.u32 & (1<<5)) { gp_context_error (context, _("Liveview cannot start: Minimum aperture warning")); return GP_ERROR; } - if (cond.u32 & (1<<15)){ gp_context_error (context, _("Liveview cannot start: Processing of shooting operation")); return GP_ERROR; } - if (cond.u32 & (1<<2)) { gp_context_error (context, _("Liveview cannot start: Sequence error")); return GP_ERROR; } - gp_context_error (context, _("Liveview cannot start: code 0x%08x"), cond.u32); - return GP_ERROR; - } - } - if (!value.u8) { value.u8 = 1; if (have_prop(camera, params->deviceinfo.VendorExtensionID, PTP_DPC_NIKON_RecordingMedia)) LOG_ON_PTP_E (ptp_setdevicepropvalue (params, PTP_DPC_NIKON_RecordingMedia, &value, PTP_DTC_UINT8)); + if (have_prop(camera, params->deviceinfo.VendorExtensionID, PTP_DPC_NIKON_LiveViewProhibitCondition)) { + PTPPropertyValue cond; + C_PTP (ptp_getdevicepropvalue (params, PTP_DPC_NIKON_LiveViewProhibitCondition, &cond, PTP_DTC_UINT32)); + + if (cond.u32) { + /* we could have multiple reasons, but just report the first one. by decreasing order of possibility */ + if (cond.u32 & (1<<8)) { gp_context_error (context, _("Liveview cannot start: Battery exhausted")); return GP_ERROR; } + if (cond.u32 & (1<<17)){ gp_context_error (context, _("Liveview cannot start: Temperature too high")); return GP_ERROR; } + if (cond.u32 & (1<<9)) { gp_context_error (context, _("Liveview cannot start: TTL error")); return GP_ERROR; } + if (cond.u32 & (1<<22)){ gp_context_error (context, _("Liveview cannot start: In Mirror-up operation")); return GP_ERROR; } + if (cond.u32 & (1<<24)){ gp_context_error (context, _("Liveview cannot start: Lens is retracting")); return GP_ERROR; } + if (cond.u32 & (1<<5)) { gp_context_error (context, _("Liveview cannot start: Minimum aperture warning")); return GP_ERROR; } + if (cond.u32 & (1<<15)){ gp_context_error (context, _("Liveview cannot start: Processing of shooting operation")); return GP_ERROR; } + if (cond.u32 & (1<<2)) { gp_context_error (context, _("Liveview cannot start: Sequence error")); return GP_ERROR; } + gp_context_error (context, _("Liveview cannot start: code 0x%08x"), cond.u32); + return GP_ERROR; + } + } + ret = ptp_nikon_start_liveview (params); if ((ret != PTP_RC_OK) && (ret != PTP_RC_DeviceBusy)) C_PTP_REP_MSG (ret, _("Nikon enable liveview failed")); |