diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2015-11-07 15:03:11 +0100 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2015-11-07 15:03:11 +0100 |
commit | b533f41385dfed57f40c8129631f364e290f977f (patch) | |
tree | 6c9bb20f04d881001672b760e17d364c14157c82 | |
parent | f61f13b283765ee7352fdfd2222f2f3a3d29308c (diff) | |
download | libgphoto2-b533f41385dfed57f40c8129631f364e290f977f.tar.gz |
update the capturetarget before doing eosremotelrease
and also after setting capturetarget itself.
spotted by Vladimir Nadvornik <nadvornik@suse.cz>
-rw-r--r-- | camlibs/ptp2/config.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/camlibs/ptp2/config.c b/camlibs/ptp2/config.c index 7348a3cac..b50d6cc70 100644 --- a/camlibs/ptp2/config.c +++ b/camlibs/ptp2/config.c @@ -5160,10 +5160,15 @@ _get_Canon_EOS_RemoteRelease(CONFIG_GET_ARGS) { static int _put_Canon_EOS_RemoteRelease(CONFIG_PUT_ARGS) { const char* val; - PTPParams *params = &(camera->pl->params); + PTPParams *params = &(camera->pl->params); + GPContext *context = ((PTPData *) params->data)->context; if (!ptp_operation_issupported(params, PTP_OC_CANON_EOS_RemoteReleaseOn)) return (GP_ERROR_NOT_SUPPORTED); + + /* If someone has set the capture target inbetween */ + CR (camera_canon_eos_update_capture_target( camera, context, -1 )); + gp_widget_get_value(widget, &val); if (!strcmp (val, _("None"))) { @@ -5894,8 +5899,10 @@ _get_CaptureTarget(CONFIG_GET_ARGS) { static int _put_CaptureTarget(CONFIG_PUT_ARGS) { - int i; - char *val; + int i; + char *val; + PTPParams *params = &(camera->pl->params); + GPContext *context = ((PTPData *) params->data)->context; CR (gp_widget_get_value(widget, &val)); for (i=0;i<sizeof(capturetargets)/sizeof(capturetargets[i]);i++) { @@ -5904,6 +5911,12 @@ _put_CaptureTarget(CONFIG_PUT_ARGS) { break; } } + /* Also update it in the live Canon EOS camera. (Nikon and Canon Powershot just use different opcodes.) */ + if ( (params->deviceinfo.VendorExtensionID == PTP_VENDOR_CANON) && + ptp_operation_issupported(&camera->pl->params, PTP_OC_CANON_EOS_RemoteRelease) + ) + CR (camera_canon_eos_update_capture_target( camera, context, -1 )); + return GP_OK; } |