From bbb9760ed38fcc4fd8c594cdcec83bb7abbfa85f Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Mon, 2 Feb 2026 11:48:39 +0100 Subject: [PATCH] more fixes for https://github.com/gphoto/libgphoto2/issues/1200 --- NEWS | 4 ++++ camlibs/ptp2/library.c | 8 +++++++- camlibs/ptp2/ptp-pack.c | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index f9ec8906a..d2c13faa0 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,8 @@ libgphoto2 2.5.33.1 development + +ptp2: +* new Canon EOS SDRAM capture method added + ------------------------------------------------------------------------------ libgphoto2 2.5.33 release diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index 4e3d62e16..fa1d148cc 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -4495,11 +4495,17 @@ camera_canon_eos_capture (Camera *camera, CameraCaptureType type, CameraFilePath case PTP_EOSEvent_Unknown: GP_LOG_D ("event unknown: %s", event.u.info); continue; /* in loop ... do not poll while draining the queue */ - case PTP_EOSEvent_ObjectTransfer: + case PTP_EOSEvent_ObjectTransfer: { + char buf[20]; GP_LOG_D ("object transfer requested: handle 0x%x, name %s, size %lu", event.u.object.Handle, event.u.object.Filename, event.u.object.ObjectSize); + if (!event.u.object.Filename) { + sprintf (buf, "capt%04d.", params->capcnt++); + event.u.object.Filename = strdup(buf); + } move(oi, event.u.object); break; + } case PTP_EOSEvent_ObjectRemoved: GP_LOG_D ("object removed: handle 0x%x", event.u.object.Handle); ptp_remove_object_from_cache(params, event.u.object.Handle); diff --git a/camlibs/ptp2/ptp-pack.c b/camlibs/ptp2/ptp-pack.c index 9bb73e05a..96dcf0092 100644 --- a/camlibs/ptp2/ptp-pack.c +++ b/camlibs/ptp2/ptp-pack.c @@ -1934,7 +1934,7 @@ ptp_unpack_EOS_events (PTPParams *params, const unsigned char* data, unsigned in 1.434663 ptp (2): 0x000: 40 c0 32 14 08 b1 - - - - - - d4 1c a6 02 1.434664 ptp (2): 0x010: - - - - - c0 32 14 06 - - - - */ - e[i].type = PTP_EOSEvent_ObjectAdded; + e[i].type = PTP_EOSEvent_ObjectTransfer; e[i].u.object.Handle = dtoh32a(curdata + PTP_cee_OA64LFN_Handle); e[i].u.object.ObjectFormat = dtoh16a(curdata + PTP_cee_OA64LFN_OFC); e[i].u.object.StorageID = 0; /* use as marker */