From 2811b40d643936163aebd57daf7ec5f6d13eb10a Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Tue, 23 Aug 2022 16:56:06 +0200 Subject: added a "testolc" option to help with EOS OLC size detection --- camlibs/ptp2/config.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'camlibs/ptp2/config.c') diff --git a/camlibs/ptp2/config.c b/camlibs/ptp2/config.c index 84a4c5f2b..8ab080eec 100644 --- a/camlibs/ptp2/config.c +++ b/camlibs/ptp2/config.c @@ -8029,6 +8029,35 @@ _put_Canon_EOS_ViewFinder(CONFIG_PUT_ARGS) { return GP_OK; } +static int +_get_Canon_EOS_TestOLC(CONFIG_GET_ARGS) { + int val; + + gp_widget_new (GP_WIDGET_TOGGLE, _(menu->label), widget); + gp_widget_set_name (*widget, menu->name); + val = 2; + gp_widget_set_value (*widget, &val); + return GP_OK; +} + +static int +_put_Canon_EOS_TestOLC(CONFIG_PUT_ARGS) { + int val; + PTPParams *params = &(camera->pl->params); + unsigned int i; + + CR (gp_widget_get_value(widget, &val)); + if (val) { + /* idea is to request all OLCs seperately to see the sizes in the logfile */ + for (i=0;i<25;i++) { /* 0x1 -> 0x1000 */ + C_PTP (ptp_canon_eos_setrequestolcinfogroup(params, (1<