Skip to content

Commit

Permalink
fuji: add unprepare capture
Browse files Browse the repository at this point in the history
fuji: disable event handling as the reporters says this is not working

gphoto#133
  • Loading branch information
msmeissn committed May 17, 2017
1 parent ea9f47d commit c04bac0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
13 changes: 12 additions & 1 deletion camlibs/ptp2/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,8 @@ camera_prepare_capture (Camera *camera, GPContext *context)
PTPPropertyValue propval;

propval.u16 = 0x0002;
return ptp_setdevicepropvalue (params, 0xd207, &propval, PTP_DTC_UINT16);
C_PTP (ptp_setdevicepropvalue (params, 0xd207, &propval, PTP_DTC_UINT16));
return GP_OK;
}
break;
case PTP_VENDOR_CANON:
Expand Down Expand Up @@ -572,6 +573,16 @@ camera_unprepare_capture (Camera *camera, GPContext *context)
gp_context_error(context,
_("Sorry, your Canon camera does not support Canon capture"));
return GP_ERROR_NOT_SUPPORTED;
case PTP_VENDOR_FUJI:
{
PTPPropertyValue propval;
PTPParams *params = &camera->pl->params;

propval.u16 = 0x0001;
C_PTP (ptp_setdevicepropvalue (params, 0xd207, &propval, PTP_DTC_UINT16));
return GP_OK;
}
break;
default:
/* generic capture does not need unpreparation */
return GP_OK;
Expand Down
9 changes: 8 additions & 1 deletion camlibs/ptp2/library.c
Original file line number Diff line number Diff line change
Expand Up @@ -2463,6 +2463,9 @@ camera_exit (Camera *camera, GPContext *context)
C_PTP (ptp_sony_9280(params, 0x4,0,5,0,0,0,0));
}
break;
case PTP_VENDOR_FUJI:
CR (camera_unprepare_capture (camera, context));
break;
}

if (camera->pl->checkevents)
Expand Down Expand Up @@ -3966,6 +3969,9 @@ camera_fuji_capture (Camera *camera, CameraCaptureType type, CameraFilePath *pat
C_PTP_REP (ptp_check_event (params));
}

#if 0
/* FIXME: Marcus ... I need to review this when I get hands on a camera ... the objecthandles loop needs to go */
/* Reporter in https://github.com/gphoto/libgphoto2/issues/133 says only 1 event ever is sent, so this does not work */
/* there is a ObjectAdded event being sent */
do {
C_PTP_REP (ptp_check_event (params));
Expand All @@ -3982,7 +3988,8 @@ camera_fuji_capture (Camera *camera, CameraCaptureType type, CameraFilePath *pat
}
} while (waiting_for_timeout (&back_off_wait, event_start, 500)); /* wait for 0.5 seconds after busy is no longer signaled */

/* If we got no event in 2 seconds duplicate the nikon broken capture, as we do not know how to get events yet */
/* If we got no event seconds duplicate the nikon broken capture, as we do not know how to get events yet */
#endif

tries = 5;
GP_LOG_D ("XXXX missing fuji objectadded events workaround");
Expand Down

0 comments on commit c04bac0

Please sign in to comment.