canon powershot wait_for_event ... initiate capture on shutterbutton

press


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14121 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
Marcus Meissner
2012-10-03 18:06:16 +00:00
parent dc950d7936
commit 244c6856e9
2 changed files with 17 additions and 1 deletions

View File

@@ -3090,6 +3090,21 @@ camera_wait_for_event (Camera *camera, int timeout,
*eventtype = GP_EVENT_FILE_ADDED;
return GP_OK;
}
case PTP_EC_CANON_ShutterButtonPressed0:
case PTP_EC_CANON_ShutterButtonPressed1:
{
CameraFilePath *path;
path = malloc(sizeof(CameraFilePath));
ret = camera_canon_capture (camera, GP_FILE_TYPE_NORMAL, path, context);
if (ret != GP_OK) {
free (path);
break;
}
*eventdata = path;
*eventtype = GP_EVENT_FILE_ADDED;
return GP_OK;
}
default:
break;
}

View File

@@ -675,8 +675,9 @@ typedef struct _PTPIPHeader PTPIPHeader;
#define PTP_EC_CANON_ExtendedErrorcode 0xC005 /* ? */
#define PTP_EC_CANON_ObjectInfoChanged 0xC008
#define PTP_EC_CANON_RequestObjectTransfer 0xC009
#define PTP_EC_CANON_ShutterButtonPressed0 0xC00B
#define PTP_EC_CANON_CameraModeChanged 0xC00C
#define PTP_EC_CANON_ShutterButtonPressed 0xC00E
#define PTP_EC_CANON_ShutterButtonPressed1 0xC00E
#define PTP_EC_CANON_StartDirectTransfer 0xC011
#define PTP_EC_CANON_StopDirectTransfer 0xC013