From 4fd7b94a9967f58c871cd9cb9f5d64e2b2bbf71d Mon Sep 17 00:00:00 2001 From: axxel Date: Wed, 2 Oct 2024 12:47:06 +0200 Subject: [PATCH] ptp2: fix focus info/mask event handling regression This was introduced here: https://github.com/gphoto/libgphoto2/commit/6df6fbb1d8f901a04dfee7c8422a18167e30df35#diff-95f258520332f90be210420cbdb44baad50e8d6b2bcf4c15a4f3dc7293a84838L2790-R2773 --- camlibs/ptp2/ptp-pack.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/camlibs/ptp2/ptp-pack.c b/camlibs/ptp2/ptp-pack.c index 1bcaad405..9e974fd34 100644 --- a/camlibs/ptp2/ptp-pack.c +++ b/camlibs/ptp2/ptp-pack.c @@ -2403,6 +2403,17 @@ static unsigned int olcsizes[0x15][13] = { ); break; } + case 0x0100: /* Focus Info */ + /* mask 0x0100: 6 bytes, 00 00 00 00 00 00 (before focus) and + * 00 00 00 00 01 00 (on focus) observed */ + e[i].type = PTP_EOSEvent_FocusInfo; + PTP_CANON_SET_INFO(e[i], "%s", ptp_bytes2str(curdata + curoff, olcsizes[olcver][j], "%02x")); + break; + case 0x0200: /* Focus Mask */ + /* mask 0x0200: 7 bytes, 00 00 00 00 00 00 00 observed */ + e[i].type = PTP_EOSEvent_FocusMask; + PTP_CANON_SET_INFO(e[i], "%s", ptp_bytes2str(curdata + curoff, olcsizes[olcver][j], "%02x")); + break; case 0x0010: /* mask 0x0010: 4 bytes, 04 00 00 00 observed */ /* a full trigger capture cycle on the 5Ds with storing to card looks like this @@ -2427,11 +2438,6 @@ static unsigned int olcsizes[0x15][13] = { * stand for the number of seconds remaining until the shot */ case 0x0080: /* mask 0x0080: 4 bytes, 00 00 00 00 observed */ - case 0x0100: - /* mask 0x0100: 6 bytes, 00 00 00 00 00 00 (before focus) and - * 00 00 00 00 01 00 (on focus) observed */ - case 0x0200: - /* mask 0x0200: 7 bytes, 00 00 00 00 00 00 00 observed */ case 0x0400: /* mask 0x0400: 7 bytes, 00 00 00 00 00 00 00 observed */ case 0x0800: