Skip to content

Commit

Permalink
switch on Pc control or tether mode for Fuji on demand.
Browse files Browse the repository at this point in the history
  • Loading branch information
msmeissn committed Nov 9, 2023
1 parent ad610a4 commit a67ddde
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion camlibs/ptp2/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,10 @@ camera_prepare_capture (Camera *camera, GPContext *context)

propval.u16 = 0x0001;
LOG_ON_PTP_E (ptp_setdevicepropvalue (params, 0xd38c, &propval, PTP_DTC_UINT16));
propval.u16 = 0x0002;

propval.u16 = 0x0001;
LOG_ON_PTP_E (ptp_setdevicepropvalue (params, PTP_DPC_FUJI_PriorityMode, &propval, PTP_DTC_UINT16));

return GP_OK;
}
break;
Expand Down
9 changes: 9 additions & 0 deletions camlibs/ptp2/library.c
Original file line number Diff line number Diff line change
Expand Up @@ -5224,6 +5224,9 @@ camera_fuji_capture (Camera *camera, CameraCaptureType type, CameraFilePath *pat
C_PTP (ptp_terminateopencapture (params,params->opencapture_transid));
}

propval.u16 = 0x0002;
LOG_ON_PTP_E (ptp_setdevicepropvalue (params, PTP_DPC_FUJI_PriorityMode, &propval, PTP_DTC_UINT16));

C_PTP (ptp_getobjecthandles (params, PTP_HANDLER_SPECIAL, 0x000000, 0x000000, &beforehandles));

C_PTP_REP (ptp_getdevicepropvalue (params, PTP_DPC_ExposureTime, &propval, PTP_DTC_UINT32));
Expand Down Expand Up @@ -7101,6 +7104,12 @@ camera_wait_for_event (Camera *camera, int timeout,
if ( (params->deviceinfo.VendorExtensionID == PTP_VENDOR_FUJI) &&
ptp_property_issupported(params, PTP_DPC_FUJI_CurrentState)
) {
PTPPropertyValue propval;

/* reenable event wait mode */
propval.u16 = 0x0001;
LOG_ON_PTP_E (ptp_setdevicepropvalue (params, PTP_DPC_FUJI_PriorityMode, &propval, PTP_DTC_UINT16));

/* current strategy ... as the camera (currently) does not send us ObjectAdded events for some reason...
* we just synthesize them for the generic PTP event handler code */
do {
Expand Down

0 comments on commit a67ddde

Please sign in to comment.