summaryrefslogtreecommitdiff
path: root/camlibs/ptp2/config.c
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2022-08-23 16:56:06 +0200
committerMarcus Meissner <marcus@jet.franken.de>2022-08-23 16:56:06 +0200
commit2811b40d643936163aebd57daf7ec5f6d13eb10a (patch)
tree56125bad307108d4d61de66b9032bc61038f97c2 /camlibs/ptp2/config.c
parent3773ad1988bc80de811d8d4cbaea18efd21518b3 (diff)
downloadlibgphoto2-2811b40d643936163aebd57daf7ec5f6d13eb10a.tar.gz
added a "testolc" option to help with EOS OLC size detection
Diffstat (limited to 'camlibs/ptp2/config.c')
-rw-r--r--camlibs/ptp2/config.c30
1 files changed, 30 insertions, 0 deletions
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
@@ -8030,6 +8030,35 @@ _put_Canon_EOS_ViewFinder(CONFIG_PUT_ARGS) {
}
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<<i)));
+ ptp_check_eos_events (params);
+ }
+ C_PTP (ptp_canon_eos_setrequestolcinfogroup(params, 0x1fff));
+ }
+ return GP_OK;
+}
+
+static int
_get_Panasonic_ViewFinder(CONFIG_GET_ARGS) {
int val;
@@ -10569,6 +10598,7 @@ static struct submenu camera_settings_menu[] = {
{ N_("Capture"), "capture", 0, PTP_VENDOR_CANON, 0, _get_Canon_CaptureMode, _put_Canon_CaptureMode },
{ N_("Remote Mode"), "remotemode", PTP_OC_CANON_EOS_SetRemoteMode, PTP_VENDOR_CANON, 0, _get_Canon_RemoteMode, _put_Canon_RemoteMode },
{ N_("Event Mode"), "eventmode", PTP_OC_CANON_EOS_SetEventMode, PTP_VENDOR_CANON, 0, _get_Canon_EventMode, _put_Canon_EventMode },
+ { N_("Test OLC"), "testolc", PTP_OC_CANON_EOS_SetRequestOLCInfoGroup, PTP_VENDOR_CANON, 0, _get_Canon_EOS_TestOLC, _put_Canon_EOS_TestOLC },
{ 0,0,0,0,0,0,0 },
};