From 244c6856e95c755fe2e30b2da3dc09d3240f2fa6 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Wed, 3 Oct 2012 18:06:16 +0000 Subject: [PATCH] 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 --- camlibs/ptp2/library.c | 15 +++++++++++++++ camlibs/ptp2/ptp.h | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index 573ac91f6..c769e8e17 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -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; } diff --git a/camlibs/ptp2/ptp.h b/camlibs/ptp2/ptp.h index d7f4e1561..fbd793e42 100644 --- a/camlibs/ptp2/ptp.h +++ b/camlibs/ptp2/ptp.h @@ -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