summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2021-02-14 11:47:41 +0100
committerMarcus Meissner <marcus@jet.franken.de>2021-02-14 11:47:41 +0100
commit580c4fa07b7f512213dc5b2b64d80d02d6f1647b (patch)
treed398469f57c745100bfb1e98ffe2faac0bf81953
parenta0bbc060312885accded1cc48a6bd65da121a41c (diff)
downloadlibgphoto2-580c4fa07b7f512213dc5b2b64d80d02d6f1647b.tar.gz
added more info on panasonic things
enhanced setcapturetarget, started getcapturetarget
-rw-r--r--camlibs/ptp2/config.c3
-rw-r--r--camlibs/ptp2/ptp.c40
-rw-r--r--camlibs/ptp2/ptp.h20
3 files changed, 49 insertions, 14 deletions
diff --git a/camlibs/ptp2/config.c b/camlibs/ptp2/config.c
index a4879caf3..1979a5038 100644
--- a/camlibs/ptp2/config.c
+++ b/camlibs/ptp2/config.c
@@ -8934,6 +8934,9 @@ _put_CaptureTarget(CONFIG_PUT_ARGS) {
CR (camera_canon_eos_update_capture_target( camera, context, -1 ));
if (params->deviceinfo.VendorExtensionID == PTP_VENDOR_PANASONIC) {
+ uint16_t target;
+
+ C_PTP (ptp_panasonic_getcapturetarget(params, &target));
if ((GP_OK != gp_setting_get("ptp2","capturetarget",buf)) || !strcmp(buf,"sdram"))
C_PTP (ptp_panasonic_setcapturetarget(params, 1));
else
diff --git a/camlibs/ptp2/ptp.c b/camlibs/ptp2/ptp.c
index e2e5a592d..e94d33475 100644
--- a/camlibs/ptp2/ptp.c
+++ b/camlibs/ptp2/ptp.c
@@ -1234,20 +1234,33 @@ ptp_panasonic_manualfocusdrive (PTPParams* params, uint16_t mode)
}
uint16_t
-ptp_panasonic_setcapturetarget (PTPParams* params, uint16_t mode) // mode == 1 == RAM, mode == 0 == SD
+ptp_panasonic_getcapturetarget (PTPParams* params, uint16_t *target)
+{
+ PTPContainer ptp;
+ unsigned char *data;
+ unsigned int size;
+
+ PTP_CNT_INIT(ptp, PTP_OC_PANASONIC_GetCaptureTarget, 0x08000090);
+ CHECK_PTP_RC(ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &data, &size));
+ if (!data) return PTP_RC_GeneralError;
+
+ *target = 0;
+
+ return PTP_RC_OK;
+}
+
+uint16_t
+ptp_panasonic_setcapturetarget (PTPParams* params, uint16_t mode) // mode == 1 == RAM, mode == 0 == SD, 2 = BOTH
{
PTPContainer ptp;
unsigned char data[10];
- uint32_t propcode = 0x00000000;
- uint32_t propcodedata = 0x08000091;
- uint32_t type = 2;
unsigned char *xdata = (unsigned char*)data;
- htod32a(data, propcodedata); /* memcpy(data, &propcodedata, 4); */
- htod32a(&data[4], type); /* memcpy(&data[4], &type, 4); */
- htod16a(&data[8], mode); /* memcpy(&data[8], &mode, 2); */
+ htod32a(data, 0x08000091); /* capturetarget */
+ htod32a(&data[4], 2); /* size */
+ htod16a(&data[8], mode);
- PTP_CNT_INIT(ptp, PTP_OC_PANASONIC_SetCaptureTarget, propcode);
+ PTP_CNT_INIT(ptp, PTP_OC_PANASONIC_SetCaptureTarget, 0);
return ptp_transaction(params, &ptp, PTP_DP_SENDDATA, sizeof(data), &xdata, NULL);
}
@@ -1260,14 +1273,21 @@ ptp_panasonic_getdevicepropertydesc (PTPParams *params, uint32_t propcode, uint1
uint16_t ret = PTP_RC_OK;
uint32_t headerLength;
uint32_t propertyCode;
+ unsigned int off = 0;
PTP_CNT_INIT(ptp, PTP_OC_PANASONIC_ListProperty, propcode, 0, 0);
CHECK_PTP_RC(ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &data, &size));
if (!data) return PTP_RC_GeneralError;
+ if (size < 8)
+ return PTP_RC_GeneralError;
+ ptp_debug (params, "ptp_panasonic_getdevicepropertydesc 0x%08x", propcode);
+ while (off < size) {
+ if (off >= size-8) break;
+ ptp_debug (params, "propcode 0x%08lx, size %d", dtoh32a(data+off), dtoh32a(data+off+4));
+ off += dtoh32a(data+off+4)+8;
+ }
- if (size < 4)
- return PTP_RC_GeneralError;
headerLength = dtoh32a( (data) + 4 );
if (size < 4 + 6 * 4)
return PTP_RC_GeneralError;
diff --git a/camlibs/ptp2/ptp.h b/camlibs/ptp2/ptp.h
index a72462507..4ce72da52 100644
--- a/camlibs/ptp2/ptp.h
+++ b/camlibs/ptp2/ptp.h
@@ -927,7 +927,7 @@ typedef struct _PTPIPHeader PTPIPHeader;
#define PTP_OC_PANASONIC_9406 0x9406 /* Setup Ctrl various functions: Format, Sensor Cleaning, Menu Save, firmware update? */
#define PTP_OC_PANASONIC_9408 0x9408
#define PTP_OC_PANASONIC_9409 0x9409 /* 1 arg */
-#define PTP_OC_PANASONIC_940A 0x940A /* 1 arg, e.g. 0x08000010 */
+#define PTP_OC_PANASONIC_GetCaptureTarget 0x940A /* 1 arg, e.g. 0x08000010 */
#define PTP_OC_PANASONIC_SetCaptureTarget 0x940B /* 1 arg, e.g. 0x08000010 */
#define PTP_OC_PANASONIC_MoveRecControl 0x940C /* 07000011 start, 07000012 stop, 0700013 still capture */
#define PTP_OC_PANASONIC_PowerControl 0x940D /* 1 arg: 0x0A000011 power off, 0x0a00012 device reset, 0x0a00013 device restart */
@@ -3242,7 +3242,7 @@ typedef struct _PTPCanonEOSDeviceInfo {
#define PTP_DPC_PANASONIC_Aperture 0x02000040
#define PTP_DPC_PANASONIC_WhiteBalance 0x02000050
#define PTP_DPC_PANASONIC_Exposure 0x02000060
-#define PTP_DPC_PANASONIC_AFArea 0x02000070
+#define PTP_DPC_PANASONIC_AFArea 0x02000070 /* AFCONFIG */
#define PTP_DPC_PANASONIC_CameraMode 0x02000080
#define PTP_DPC_PANASONIC_ImageFormat 0x020000A2
#define PTP_DPC_PANASONIC_MeteringInfo 0x020000B0
@@ -3253,7 +3253,18 @@ typedef struct _PTPCanonEOSDeviceInfo {
#define PTP_DPC_PANASONIC_RecPreviewConfig 0x02000170
#define PTP_DPC_PANASONIC_RecInfoSelfTimer 0x020001A0
#define PTP_DPC_PANASONIC_RecInfoFlash2 0x020001B0
-#define PTP_DPC_PANASONIC_MovConfig 0x06000010
+#define PTP_DPC_PANASONIC_RecCtrlRelease 0x03000010
+
+#define PTP_DPC_PANASONIC_RecCtrlAFAE 0x03000020 /* cmd base for afae */
+#define PTP_DPC_PANASONIC_RecCtrlAFAE_LockAE 0x03000021
+#define PTP_DPC_PANASONIC_RecCtrlAFAE_LockAF 0x03000022
+#define PTP_DPC_PANASONIC_RecCtrlAFAE_LockAFAE 0x03000023
+#define PTP_DPC_PANASONIC_RecCtrlAFAE_AF_OneShot 0x03000024
+#define PTP_DPC_PANASONIC_RecCtrlAFAE_Lock_Clear 0x03000025
+
+#define PTP_DPC_PANASONIC_Zoom 0x03000080
+#define PTP_DPC_PANASONIC_RecCtrlLens 0x03010010
+#define PTP_DPC_PANASONIC_MovConfig 0x06000010 /* uses 9408 */
#define PTP_DPC_PANASONIC_08000010 0x08000010
/* various modes of the camera, HDMI, GetDateTimeWorldTime Mode/Area, SetupCfgInfo, SetupConfig_DateTime, GetSystemFreq Mode, GetSetupConfig Info */
/*
@@ -4688,7 +4699,8 @@ uint16_t ptp_panasonic_setdeviceproperty (PTPParams* params, uint32_t propcode,
uint16_t ptp_panasonic_getdeviceproperty (PTPParams *params, uint32_t propcode, uint16_t *valuesize, uint32_t *currentValue);
uint16_t ptp_panasonic_getdevicepropertydesc (PTPParams *params, uint32_t propcode, uint16_t valuesize, uint32_t *currentValue, uint32_t **propertyValueList, uint32_t *propertyValueListLength);
uint16_t ptp_panasonic_getdevicepropertysize (PTPParams *params, uint32_t propcode);
-uint16_t ptp_panasonic_setcapturetarget (PTPParams *params, uint16_t mode);
+uint16_t ptp_panasonic_getcapturetarget (PTPParams *params, uint16_t *target);
+uint16_t ptp_panasonic_setcapturetarget (PTPParams *params, uint16_t target);
uint16_t ptp_panasonic_manualfocusdrive (PTPParams* params, uint16_t mode);
uint16_t ptp_panasonic_9401 (PTPParams* params, uint32_t x);