diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2020-05-10 17:08:01 +0200 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2020-05-10 17:08:01 +0200 |
commit | 7a5fe3341b2b1aa8acfc507194d59bca411c532b (patch) | |
tree | d3517e502a206dd8f75385ecb8d4ac427cfeca3b | |
parent | 1b47949c1ead9de994970ada7f8109e1b6b94486 (diff) | |
download | libgphoto2-7a5fe3341b2b1aa8acfc507194d59bca411c532b.tar.gz |
also check liveview prohibit condition in the viewfinder setting
-rw-r--r-- | camlibs/ptp2/config.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/camlibs/ptp2/config.c b/camlibs/ptp2/config.c index 96d4dd417..cf9334bae 100644 --- a/camlibs/ptp2/config.c +++ b/camlibs/ptp2/config.c @@ -6679,6 +6679,24 @@ _put_Nikon_ViewFinder(CONFIG_PUT_ARGS) { if (LOG_ON_PTP_E (ptp_getdevicepropvalue (params, PTP_DPC_NIKON_LiveViewStatus, &value, PTP_DTC_UINT8)) != PTP_RC_OK) value.u8 = 0; + if (have_prop(camera, params->deviceinfo.VendorExtensionID, PTP_DPC_NIKON_LiveViewProhibitCondition)) { + C_PTP (ptp_getdevicepropvalue (params, PTP_DPC_NIKON_LiveViewProhibitCondition, &value, PTP_DTC_UINT32)); + + if (value.u32) { + /* we could have multiple reasons, but just report the first one. by decreasing order of possibility */ + if (value.u32 & (1<<8)) { gp_context_error (context, _("Liveview cannot start: Battery exhausted")); return GP_ERROR; } + if (value.u32 & (1<<17)){ gp_context_error (context, _("Liveview cannot start: Temperature too high")); return GP_ERROR; } + if (value.u32 & (1<<9)) { gp_context_error (context, _("Liveview cannot start: TTL error")); return GP_ERROR; } + if (value.u32 & (1<<22)){ gp_context_error (context, _("Liveview cannot start: In Mirror-up operation")); return GP_ERROR; } + if (value.u32 & (1<<24)){ gp_context_error (context, _("Liveview cannot start: Lens is retracting")); return GP_ERROR; } + if (value.u32 & (1<<5)) { gp_context_error (context, _("Liveview cannot start: Minimum aperture warning")); return GP_ERROR; } + if (value.u32 & (1<<15)){ gp_context_error (context, _("Liveview cannot start: Processing of shooting operation")); return GP_ERROR; } + if (value.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"), value.u32); + return GP_ERROR; + } + } + if (!value.u8) { value.u8 = 1; LOG_ON_PTP_E (ptp_setdevicepropvalue (params, PTP_DPC_NIKON_RecordingMedia, &value, PTP_DTC_UINT8)); |