"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "camlibs/ptp2/ptp.c" between
libgphoto2-2.5.26.tar.bz2 and libgphoto2-2.5.27.tar.bz2

About: libgphoto2 is a library that can be used by applications to access various digital cameras.

ptp.c  (libgphoto2-2.5.26.tar.bz2):ptp.c  (libgphoto2-2.5.27.tar.bz2)
skipping to change at line 504 skipping to change at line 504
} }
uint16_t uint16_t
ptp_getstreaminfo (PTPParams *params, uint32_t streamid, PTPStreamInfo *si) ptp_getstreaminfo (PTPParams *params, uint32_t streamid, PTPStreamInfo *si)
{ {
PTPContainer ptp; PTPContainer ptp;
unsigned char *data = NULL; unsigned char *data = NULL;
unsigned int size; unsigned int size;
int ret; int ret;
PTP_CNT_INIT(ptp, PTP_OC_GetStreamInfo); PTP_CNT_INIT(ptp, PTP_OC_GetStreamInfo, streamid);
CHECK_PTP_RC(ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &data, &siz e)); CHECK_PTP_RC(ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &data, &siz e));
ret = ptp_unpack_StreamInfo(params, data, si, size); ret = ptp_unpack_StreamInfo(params, data, si, size);
free (data); free (data);
if (ret) if (ret)
return PTP_RC_OK; return PTP_RC_OK;
else else
return PTP_ERROR_IO; return PTP_ERROR_IO;
} }
uint16_t uint16_t
skipping to change at line 588 skipping to change at line 588
xmlNodePtr next; xmlNodePtr next;
int cnt; int cnt;
cnt = 0; cnt = 0;
next = xmlFirstElementChild (node); next = xmlFirstElementChild (node);
while (next) { while (next) {
cnt++; cnt++;
next = xmlNextElementSibling (next); next = xmlNextElementSibling (next);
} }
di->OperationsSupported_len = cnt; di->OperationsSupported_len = cnt;
di->OperationsSupported = malloc (cnt*sizeof(di->OperationsSupported[0])) ; di->OperationsSupported = calloc (cnt,sizeof(di->OperationsSupported[0])) ;
cnt = 0; cnt = 0;
next = xmlFirstElementChild (node); next = xmlFirstElementChild (node);
while (next) { while (next) {
unsigned int p; unsigned int p;
sscanf((char*)next->name, "c%04x", &p); sscanf((char*)next->name, "c%04x", &p);
ptp_debug( params, "cmd %s / 0x%04x", next->name, p); ptp_debug( params, "cmd %s / 0x%04x", next->name, p);
di->OperationsSupported[cnt++] = p; di->OperationsSupported[cnt++] = p;
next = xmlNextElementSibling (next); next = xmlNextElementSibling (next);
} }
skipping to change at line 757 skipping to change at line 757
ptp_debug( params, "enum"); ptp_debug( params, "enum");
dpd->FormFlag = PTP_DPFF_Enumeration; dpd->FormFlag = PTP_DPFF_Enumeration;
s = (char*)xmlNodeGetContent (next); s = (char*)xmlNodeGetContent (next);
n = 0; n = 0;
do { do {
s = strchr(s,' '); s = strchr(s,' ');
if (s) s++; if (s) s++;
n++; n++;
} while (s); } while (s);
dpd->FORM.Enum.NumberOfValues = n; dpd->FORM.Enum.NumberOfValues = n;
dpd->FORM.Enum.SupportedValue = malloc (n * sizeof(PTPPro pertyValue)); dpd->FORM.Enum.SupportedValue = calloc (n , sizeof(PTPPro pertyValue));
s = (char*)xmlNodeGetContent (next); s = (char*)xmlNodeGetContent (next);
i = 0; i = 0;
do { do {
parse_9301_value (params, s, type, &dpd->FORM.Enu m.SupportedValue[i]); /* should turn ' ' into \0? */ parse_9301_value (params, s, type, &dpd->FORM.Enu m.SupportedValue[i]); /* should turn ' ' into \0? */
i++; i++;
s = strchr(s,' '); s = strchr(s,' ');
if (s) s++; if (s) s++;
} while (s && (i<n)); } while (s && (i<n));
continue; continue;
} }
skipping to change at line 805 skipping to change at line 805
unsigned int i; unsigned int i;
cnt = 0; cnt = 0;
next = xmlFirstElementChild (node); next = xmlFirstElementChild (node);
while (next) { while (next) {
cnt++; cnt++;
next = xmlNextElementSibling (next); next = xmlNextElementSibling (next);
} }
di->DevicePropertiesSupported_len = cnt; di->DevicePropertiesSupported_len = cnt;
di->DevicePropertiesSupported = malloc (cnt*sizeof(di->DevicePropertiesSu pported[0])); di->DevicePropertiesSupported = calloc (cnt,sizeof(di->DevicePropertiesSu pported[0]));
cnt = 0; cnt = 0;
next = xmlFirstElementChild (node); next = xmlFirstElementChild (node);
while (next) { while (next) {
unsigned int p; unsigned int p;
PTPDevicePropDesc dpd; PTPDevicePropDesc dpd;
sscanf((char*)next->name, "p%04x", &p); sscanf((char*)next->name, "p%04x", &p);
ptp_debug( params, "prop %s / 0x%04x", next->name, p); ptp_debug( params, "prop %s / 0x%04x", next->name, p);
parse_9301_propdesc (params, xmlFirstElementChild (next), &dpd); parse_9301_propdesc (params, xmlFirstElementChild (next), &dpd);
dpd.DevicePropertyCode = p; dpd.DevicePropertyCode = p;
skipping to change at line 852 skipping to change at line 852
xmlNodePtr next; xmlNodePtr next;
int cnt; int cnt;
cnt = 0; cnt = 0;
next = xmlFirstElementChild (node); next = xmlFirstElementChild (node);
while (next) { while (next) {
cnt++; cnt++;
next = xmlNextElementSibling (next); next = xmlNextElementSibling (next);
} }
di->EventsSupported_len = cnt; di->EventsSupported_len = cnt;
di->EventsSupported = malloc (cnt*sizeof(di->EventsSupported[0])); di->EventsSupported = calloc (cnt,sizeof(di->EventsSupported[0]));
cnt = 0; cnt = 0;
next = xmlFirstElementChild (node); next = xmlFirstElementChild (node);
while (next) { while (next) {
unsigned int p; unsigned int p;
sscanf((char*)next->name, "e%04x", &p); sscanf((char*)next->name, "e%04x", &p);
ptp_debug( params, "event %s / 0x%04x", next->name, p); ptp_debug( params, "event %s / 0x%04x", next->name, p);
di->EventsSupported[cnt++] = p; di->EventsSupported[cnt++] = p;
next = xmlNextElementSibling (next); next = xmlNextElementSibling (next);
} }
skipping to change at line 1045 skipping to change at line 1045
uint16_t ret; uint16_t ret;
unsigned int *size = 0; unsigned int *size = 0;
unsigned char *data = NULL; unsigned char *data = NULL;
PTP_CNT_INIT(ptp, PTP_OC_PANASONIC_9401, param1); PTP_CNT_INIT(ptp, PTP_OC_PANASONIC_9401, param1);
ret = ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &data, size); ret = ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &data, size);
free(data); free(data);
return ret; return ret;
} }
/* liveview format query
* 0d800012 - get imageformats
* 0d800011 - get current imageformat ?
*/
uint16_t
ptp_panasonic_9414_0d800012 (PTPParams* params, PanasonicLiveViewSize **liveview
sizes, unsigned int *nrofliveviewsizes)
{
PTPContainer ptp;
unsigned int i;
unsigned int size = 0;
unsigned char *data = NULL;
uint32_t blobsize;
uint16_t count;
uint16_t structsize;
*nrofliveviewsizes = 0;
*liveviewsizes = NULL;
PTP_CNT_INIT(ptp, PTP_OC_PANASONIC_GetLiveViewParameters, 0x0d800012);
CHECK_PTP_RC (ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &data, &si
ze));
/* return data with the GC9 is:
12 00 80 0d
1c 00 00 00
03 00 count
08 00 structsize
e0 01 80 02 20 00 1e 00
d0 02 c0 03 5e 01 1e 00
c0 03 00 05 bc 02 1e 00
*/
if (size < 8) return PTP_RC_GeneralError;
blobsize = dtoh32a(data+4);
if (size - 8 < blobsize) {
ptp_debug (params, "blobsize expected %d, but size is only %d", b
lobsize, size - 8);
return PTP_RC_GeneralError;
}
if (blobsize < 4) {
ptp_debug (params, "blobsize expected at least 4, but is only %d"
, blobsize);
return PTP_RC_GeneralError;
}
count = dtoh16a (data+8);
structsize = dtoh16a (data+10);
if (structsize != 8) {
ptp_debug (params, "structsize expected 8, but is %d", structsize
);
return PTP_RC_GeneralError;
}
if (count * structsize > blobsize) {
ptp_debug (params, "%d * %d = %d is larger than %d", count, struc
tsize, count * structsize, blobsize);
return PTP_RC_GeneralError;
}
*liveviewsizes = calloc (sizeof(PanasonicLiveViewSize),count);
for (i = 0;i < count; i++) {
(*liveviewsizes)[i].height = dtoh16a (data + 12 + i*structsi
ze);
(*liveviewsizes)[i].width = dtoh16a (data + 12 + 2 + i*stru
ctsize);
(*liveviewsizes)[i].x = dtoh16a (data + 12 + 4 + i*stru
ctsize);
(*liveviewsizes)[i].freq = dtoh16a (data + 12 + 6 + i*stru
ctsize);
}
*nrofliveviewsizes = count;
free(data);
return PTP_RC_OK;
}
uint16_t
ptp_panasonic_9414_0d800011 (PTPParams* params, PanasonicLiveViewSize *liveviews
ize)
{
PTPContainer ptp;
unsigned int size = 0;
unsigned char *data = NULL;
uint32_t blobsize;
PTP_CNT_INIT(ptp, PTP_OC_PANASONIC_GetLiveViewParameters, 0x0d800011);
CHECK_PTP_RC (ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &data, &si
ze));
/* data is:
11 00 80 0d
08 00 00 00
e0 01 80 02
00 00
1e 00
*/
if (size < 8) return PTP_RC_GeneralError;
blobsize = dtoh32a(data+4);
if (size - 8 < blobsize) {
ptp_debug (params, "blobsize expected %d, but size is only %d", b
lobsize, size - 8);
return PTP_RC_GeneralError;
}
if (blobsize < 8) {
ptp_debug (params, "blobsize expected at least 8, but is only %d"
, blobsize);
return PTP_RC_GeneralError;
}
liveviewsize->height = dtoh16a (data + 8 + 0);
liveviewsize->width = dtoh16a (data + 8 + 2);
liveviewsize->x = dtoh16a (data + 8 + 4);
liveviewsize->freq = dtoh16a (data + 8 + 6);
free(data);
return PTP_RC_OK;
}
uint16_t
ptp_panasonic_9415 (PTPParams* params, PanasonicLiveViewSize *liveviewsize)
{
PTPContainer ptp;
unsigned char *data;
uint16_t ret;
PTP_CNT_INIT(ptp, PTP_OC_PANASONIC_SetLiveViewParameters, 0x0d800011);
data = malloc(16);
htod32a(data+0 , 0x0d800011);
htod32a(data+4 , 8);
htod16a(data+8 , liveviewsize->height);
htod16a(data+10, liveviewsize->width);
htod16a(data+12, liveviewsize->x);
htod16a(data+14, liveviewsize->freq);
ret = ptp_transaction(params, &ptp, PTP_DP_SENDDATA, 16, (unsigned char**
)&data, 0);
free (data);
return ret;
}
uint16_t uint16_t
ptp_panasonic_setdeviceproperty (PTPParams* params, uint32_t propcode, ptp_panasonic_setdeviceproperty (PTPParams* params, uint32_t propcode,
unsigned char *value, uint16_t valuesize) unsigned char *value, uint16_t valuesize)
{ {
PTPContainer ptp; PTPContainer ptp;
uint16_t ret; uint16_t ret;
unsigned char *data; unsigned char *data;
uint32_t size = 4 + 4 + valuesize; uint32_t size = 4 + 4 + valuesize;
data = calloc(size, sizeof(unsigned char)); data = calloc(size, sizeof(unsigned char));
skipping to change at line 1107 skipping to change at line 1233
htod32a(data, propcode); /* memcpy(data, &propcode, 4); */ htod32a(data, propcode); /* memcpy(data, &propcode, 4); */
htod32a(&data[4], type); /* memcpy(&data[4], &type, 4); */ htod32a(&data[4], type); /* memcpy(&data[4], &type, 4); */
htod16a(&data[8], mode); /* memcpy(&data[8], &mode, 2); */ htod16a(&data[8], mode); /* memcpy(&data[8], &mode, 2); */
PTP_CNT_INIT(ptp, PTP_OC_PANASONIC_ManualFocusDrive, propcode); PTP_CNT_INIT(ptp, PTP_OC_PANASONIC_ManualFocusDrive, propcode);
return ptp_transaction(params, &ptp, PTP_DP_SENDDATA, sizeof(data), &xdat a, NULL); return ptp_transaction(params, &ptp, PTP_DP_SENDDATA, sizeof(data), &xdat a, NULL);
} }
uint16_t uint16_t
ptp_panasonic_setcapturetarget (PTPParams* params, uint16_t mode) // mode == 1 = ptp_panasonic_getcapturetarget (PTPParams* params, uint16_t *target)
= RAM, mode == 0 == SD {
PTPContainer ptp;
unsigned char *data;
unsigned int size;
*target = 0;
PTP_CNT_INIT(ptp, PTP_OC_PANASONIC_GetCaptureTarget, 0x08000090);
CHECK_PTP_RC(ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &data, &siz
e));
if (!data) return PTP_RC_GeneralError;
if (size < 10) return PTP_RC_GeneralError;
if (dtoh32a(data) != 0x08000091) return PTP_RC_GeneralError;
if (dtoh32a(data+4) != 2) return PTP_RC_GeneralError;
*target = dtoh16a(data+8);
free (data);
return PTP_RC_OK;
}
uint16_t
ptp_panasonic_setcapturetarget (PTPParams* params, uint16_t mode) // mode == 1 =
= RAM, mode == 0 == SD, 2 = BOTH
{ {
PTPContainer ptp; PTPContainer ptp;
unsigned char data[10]; unsigned char data[10];
uint32_t propcode = 0x00000000;
uint32_t propcodedata = 0x08000091;
uint32_t type = 2;
unsigned char *xdata = (unsigned char*)data; unsigned char *xdata = (unsigned char*)data;
htod32a(data, propcodedata); /* memcpy(data, &propcodedata, 4); */ htod32a(data, 0x08000091); /* capturetarget */
htod32a(&data[4], type); /* memcpy(&data[4], &type, 4); */ htod32a(&data[4], 2); /* size */
htod16a(&data[8], mode); /* memcpy(&data[8], &mode, 2); */ 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), &xdat a, NULL); return ptp_transaction(params, &ptp, PTP_DP_SENDDATA, sizeof(data), &xdat a, NULL);
} }
uint16_t uint16_t
ptp_panasonic_getdevicepropertydesc (PTPParams *params, uint32_t propcode, uint1 6_t valuesize, uint32_t *currentValue, uint32_t **propertyValueList, uint32_t *p ropertyValueListLength) ptp_panasonic_getdevicepropertydesc (PTPParams *params, uint32_t propcode, uint1 6_t valuesize, uint32_t *currentValue, uint32_t **propertyValueList, uint32_t *p ropertyValueListLength)
{ {
PTPContainer ptp; PTPContainer ptp;
unsigned char *data = NULL; unsigned char *data = NULL;
unsigned int size = 0; unsigned int size = 0;
uint16_t ret = 0; 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); PTP_CNT_INIT(ptp, PTP_OC_PANASONIC_ListProperty, propcode, 0, 0);
CHECK_PTP_RC(ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &data, &siz e)); CHECK_PTP_RC(ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &data, &siz e));
if (!data) return PTP_RC_GeneralError; if (!data) return PTP_RC_GeneralError;
if (size < 8)
return PTP_RC_GeneralError;
if (size < 4) return PTP_RC_GeneralError; ptp_debug (params, "ptp_panasonic_getdevicepropertydesc 0x%08x", propcode
uint32_t headerLength = dtoh32a( (data) + 4 ); );
if (size < 4 + 6 * 4) return PTP_RC_GeneralError; while (off < size) {
uint32_t propertyCode = dtoh32a( (data) + 4 + 6 * 4 ); if (off >= size-8) break;
if (size < headerLength * 4 + 2 * 4) return PTP_RC_GeneralError; ptp_debug (params, "propcode 0x%08lx, size %d", dtoh32a(data+off)
, dtoh32a(data+off+4));
off += dtoh32a(data+off+4)+8;
}
headerLength = dtoh32a( (data) + 4 );
if (size < 4 + 6 * 4)
return PTP_RC_GeneralError;
propertyCode = dtoh32a( (data) + 4 + 6 * 4 );
if (size < headerLength * 4 + 2 * 4)
return PTP_RC_GeneralError;
if(valuesize == 2) { if(valuesize == 2) {
*currentValue = (uint32_t) dtoh16a( (data) + headerLeng th * 4 + 2 * 4 ); *currentValue = (uint32_t) dtoh16a( (data) + headerLeng th * 4 + 2 * 4 );
} else if(valuesize == 4) { } else if(valuesize == 4) {
*currentValue = dtoh32a( (data) + headerLength * 4 + 2 * 4 ); *currentValue = dtoh32a( (data) + headerLength * 4 + 2 * 4 );
} else { } else {
ptp_debug (params, "unexpected valuesize %d", valuesize);
return PTP_RC_GeneralError; return PTP_RC_GeneralError;
} }
/* Marcus: where is 4*headerLenght coming from ? */
if (size < headerLength * 4 + 2 * 4 + valuesize) return PTP_RC_GeneralErr or; if (size < headerLength * 4 + 2 * 4 + valuesize) return PTP_RC_GeneralErr or;
*propertyValueListLength = dtoh32a( (data) + headerLength * 4 + 2 * 4 + valuesize); *propertyValueListLength = dtoh32a( (data) + headerLength * 4 + 2 * 4 + valuesize);
ptp_debug(params, "header: %lu, code: 0x%lx, value: %lu, count: %lu", hea derLength, propertyCode, *currentValue, *propertyValueListLength); ptp_debug(params, "header: %lu, code: 0x%lx, value: %lu, count: %lu", hea derLength, propertyCode, *currentValue, *propertyValueListLength);
if (size < headerLength * 4 + 3 * 4 + valuesize + (*propertyValueListLeng if (size < headerLength * 4 + 3 * 4 + valuesize + (*propertyValueListLeng
th) * valuesize) return PTP_RC_GeneralError; th) * valuesize) {
ptp_debug (params, "size %d vs expected size %d", size, headerLen
gth * 4 + 3 * 4 + valuesize + (*propertyValueListLength) * valuesize);
return PTP_RC_GeneralError;
}
*propertyValueList = calloc(*propertyValueListLength, sizeof(uint32_t)); *propertyValueList = calloc(*propertyValueListLength, sizeof(uint32_t));
uint16_t i; uint16_t i;
for(i = 0; i < *propertyValueListLength; i++) { for(i = 0; i < *propertyValueListLength; i++) {
if(valuesize == 2) { if(valuesize == 2) {
(*propertyValueList)[i] = (uint32_t) dtoh16a( (data) + he aderLength * 4 + 3 * 4 + valuesize + i * valuesize); (*propertyValueList)[i] = (uint32_t) dtoh16a( (data) + he aderLength * 4 + 3 * 4 + valuesize + i * valuesize);
} else if(valuesize == 4) { } else if(valuesize == 4) {
(*propertyValueList)[i] = dtoh32a( (data) + headerLength * 4 + 3 * 4 + valuesize + i * valuesize); (*propertyValueList)[i] = dtoh32a( (data) + headerLength * 4 + 3 * 4 + valuesize + i * valuesize);
} }
skipping to change at line 1454 skipping to change at line 1616
ptp_free_devicepropvalue (opd->DataType, &opd->FORM.Range.StepSiz e); ptp_free_devicepropvalue (opd->DataType, &opd->FORM.Range.StepSiz e);
break; break;
case PTP_OPFF_Enumeration: case PTP_OPFF_Enumeration:
if (opd->FORM.Enum.SupportedValue) { if (opd->FORM.Enum.SupportedValue) {
for (i=0;i<opd->FORM.Enum.NumberOfValues;i++) for (i=0;i<opd->FORM.Enum.NumberOfValues;i++)
ptp_free_devicepropvalue (opd->DataType, opd->FOR M.Enum.SupportedValue+i); ptp_free_devicepropvalue (opd->DataType, opd->FOR M.Enum.SupportedValue+i);
free (opd->FORM.Enum.SupportedValue); free (opd->FORM.Enum.SupportedValue);
} }
break; break;
case PTP_OPFF_DateTime: case PTP_OPFF_DateTime:
case PTP_OPFF_FixedLengthArray: free(opd->FORM.DateTime.String);
break;
case PTP_OPFF_RegularExpression: case PTP_OPFF_RegularExpression:
case PTP_OPFF_ByteArray: free(opd->FORM.RegularExpression.String);
break;
case PTP_OPFF_FixedLengthArray: /* nothing to free */ /* fallthrough */
case PTP_OPFF_ByteArray: /* nothing to free */ /* fallthrough */
case PTP_OPFF_LongString: case PTP_OPFF_LongString:
/* Ignore these presently, we cannot unpack them, so there is not hing to be freed. */ /* Ignore these presently, we cannot unpack them, so there is not hing to be freed. */
break; break;
default: default:
fprintf (stderr, "Unknown OPFF type %d\n", opd->FormFlag); fprintf (stderr, "Unknown OPFF type %d\n", opd->FormFlag);
break; break;
} }
} }
/** /**
skipping to change at line 1872 skipping to change at line 2038
ptp_getpartialobject_to_handler (PTPParams* params, uint32_t handle, uint32_t of fset, ptp_getpartialobject_to_handler (PTPParams* params, uint32_t handle, uint32_t of fset,
uint32_t maxbytes, PTPDataHandler *handler) uint32_t maxbytes, PTPDataHandler *handler)
{ {
PTPContainer ptp; PTPContainer ptp;
PTP_CNT_INIT(ptp, PTP_OC_GetPartialObject, handle, offset, maxbytes); PTP_CNT_INIT(ptp, PTP_OC_GetPartialObject, handle, offset, maxbytes);
return ptp_transaction_new(params, &ptp, PTP_DP_GETDATA, 0, handler); return ptp_transaction_new(params, &ptp, PTP_DP_GETDATA, 0, handler);
} }
/** /**
* ptp_nikon_getpartialobjectex:
* params: PTPParams*
* handle - Object handle
* offset - 64bit offset into object
* maxbytes - 64bit maximum of bytes to read
* handler - a ptp pata handler
*
* Get object 'handle' from device and send the data to the
* data handler. Start from offset and read at most maxbytes.
*
* Return values: Some PTP_RC_* code.
**/
uint16_t
ptp_nikon_getpartialobjectex (PTPParams* params, uint32_t handle, uint64_t offse
t,
uint64_t maxbytes, unsigned char** object,
uint32_t *len)
{
PTPContainer ptp;
/* casts due to varargs otherwise pushing 64bit values on the stack */
PTP_CNT_INIT(ptp, PTP_OC_NIKON_GetPartialObjectEx, handle, ((uint32_t)off
set & 0xFFFFFFFF), (uint32_t)(offset >> 32), ((uint32_t)maxbytes & 0xFFFFFFFF),
(uint32_t)(maxbytes >> 32));
return ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, object, len);
}
/**
* ptp_getthumb: * ptp_getthumb:
* params: PTPParams* * params: PTPParams*
* handle - Object handle * handle - Object handle
* object - pointer to data area * object - pointer to data area
* *
* Get thumb for object 'handle' from device and store the data in newly * Get thumb for object 'handle' from device and store the data in newly
* allocated 'object'. * allocated 'object'.
* *
* Return values: Some PTP_RC_* code. * Return values: Some PTP_RC_* code.
**/ **/
skipping to change at line 1912 skipping to change at line 2103
uint16_t uint16_t
ptp_nikon_getlargethumb (PTPParams* params, uint32_t handle, unsigned char** obj ect, unsigned int *len) ptp_nikon_getlargethumb (PTPParams* params, uint32_t handle, unsigned char** obj ect, unsigned int *len)
{ {
PTPContainer ptp; PTPContainer ptp;
PTP_CNT_INIT(ptp, PTP_OC_NIKON_GetLargeThumb, handle); PTP_CNT_INIT(ptp, PTP_OC_NIKON_GetLargeThumb, handle);
return ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, object, len); return ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, object, len);
} }
/** /**
* ptp_nikon_getobjectsize:
* params: PTPParams*
* handle - Object handle
* objectsize - size of object
*
* Get the 64bit objectsize for object 'handle' from device and store the size i
n objectsize
* allocated 'object'. This function is Nikon specific.
*
* Return values: Some PTP_RC_* code.
**/
uint16_t
ptp_nikon_getobjectsize (PTPParams* params, uint32_t handle, uint64_t *objectsiz
e)
{
PTPContainer ptp;
unsigned char *data = NULL;
unsigned int size = 0;
*objectsize = 0;
PTP_CNT_INIT(ptp, PTP_OC_NIKON_GetObjectSize, handle);
CHECK_PTP_RC (ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &data, &si
ze));
if (size < 8) {
free (data);
return PTP_RC_GeneralError;
}
*objectsize = dtoh64ap(params, data);
free (data);
return PTP_RC_OK;
}
/**
* ptp_deleteobject: * ptp_deleteobject:
* params: PTPParams* * params: PTPParams*
* handle - object handle * handle - object handle
* ofc - object format code (optional) * ofc - object format code (optional)
* *
* Deletes desired objects. * Deletes desired objects.
* *
* Return values: Some PTP_RC_* code. * Return values: Some PTP_RC_* code.
**/ **/
uint16_t uint16_t
skipping to change at line 2504 skipping to change at line 2728
PTPCanon_directtransfer_entry **entries, unsigned int *cnt) PTPCanon_directtransfer_entry **entries, unsigned int *cnt)
{ {
PTPContainer ptp; PTPContainer ptp;
uint16_t ret = PTP_RC_OK; uint16_t ret = PTP_RC_OK;
unsigned char *data = NULL, *cur; unsigned char *data = NULL, *cur;
unsigned int size, i; unsigned int size, i;
PTP_CNT_INIT(ptp, PTP_OC_CANON_GetTreeSize); PTP_CNT_INIT(ptp, PTP_OC_CANON_GetTreeSize);
CHECK_PTP_RC(ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &data, &siz e)); CHECK_PTP_RC(ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &data, &siz e));
*cnt = dtoh32a(data); *cnt = dtoh32a(data);
*entries = malloc(sizeof(PTPCanon_directtransfer_entry)*(*cnt)); *entries = calloc(sizeof(PTPCanon_directtransfer_entry),(*cnt));
if (!*entries) { if (!*entries) {
ret = PTP_RC_GeneralError; ret = PTP_RC_GeneralError;
goto exit; goto exit;
} }
cur = data+4; cur = data+4;
for (i=0;i<*cnt;i++) { for (i=0;i<*cnt;i++) {
unsigned char len; unsigned char len;
(*entries)[i].oid = dtoh32a(cur); (*entries)[i].oid = dtoh32a(cur);
if (!ptp_unpack_string(params, cur, 4, size-(cur-data-4), &len, & (*entries)[i].str)) if (!ptp_unpack_string(params, cur, 4, size-(cur-data-4), &len, & (*entries)[i].str))
break; break;
skipping to change at line 2954 skipping to change at line 3178
ret = PTP_RC_OK; ret = PTP_RC_OK;
return ret; return ret;
} }
uint16_t uint16_t
ptp_check_event (PTPParams *params) ptp_check_event (PTPParams *params)
{ {
PTPContainer event; PTPContainer event;
uint16_t ret; uint16_t ret;
/* Method offered by Nikon DSLR, Nikon 1, and some older Nikon Coolpix P* if (params->deviceinfo.VendorExtensionID == PTP_VENDOR_NIKON) {
* The Nikon Coolpix P2 however does not return anything. So if we never if (ptp_operation_issupported(params, PTP_OC_NIKON_GetEventEx)) {
get unsigned int evtcnt = 0, i;
* events from here, use the ptp "interrupt" method */ PTPContainer *xevent = NULL;
if ( (params->deviceinfo.VendorExtensionID == PTP_VENDOR_NIKON) &&
ptp_operation_issupported(params, PTP_OC_NIKON_GetEvent) ret = ptp_nikon_check_eventex(params, &xevent, &evtcnt);
) { if (ret != PTP_RC_OperationNotSupported)
unsigned int evtcnt = 0, i; CHECK_PTP_RC(ret);
PTPContainer *xevent = NULL;
if (evtcnt) {
ret = ptp_nikon_check_event(params, &xevent, &evtcnt); for (i = 0; i < evtcnt; i++)
if (ret != PTP_RC_OperationNotSupported) handle_event_internal (params, &xevent[i]
CHECK_PTP_RC(ret); );
params->events = realloc(params->events, sizeof(P
if (evtcnt) { TPContainer)*(evtcnt+params->nrofevents));
for (i = 0; i < evtcnt; i++) memcpy (&params->events[params->nrofevents],xeven
handle_event_internal (params, &xevent[i]); t,evtcnt*sizeof(PTPContainer));
params->events = realloc(params->events, sizeof(PTPContai params->nrofevents += evtcnt;
ner)*(evtcnt+params->nrofevents)); params->event90c7works = 1;
memcpy (&params->events[params->nrofevents],xevent,evtcnt }
*sizeof(PTPContainer)); free (xevent);
params->nrofevents += evtcnt; if (params->event90c7works)
params->event90c7works = 1; return PTP_RC_OK;
/* fall through to generic event handling */
} else {
/* Method offered by Nikon DSLR, Nikon 1, and some older
Nikon Coolpix P*
* The Nikon Coolpix P2 however does not return anything.
So if we never get
* events from here, use the ptp "interrupt" method */
if (ptp_operation_issupported(params, PTP_OC_NIKON_GetEve
nt)) {
unsigned int evtcnt = 0, i;
PTPContainer *xevent = NULL;
ret = ptp_nikon_check_event(params, &xevent, &evt
cnt);
if (ret != PTP_RC_OperationNotSupported)
CHECK_PTP_RC(ret);
if (evtcnt) {
for (i = 0; i < evtcnt; i++)
handle_event_internal (params, &x
event[i]);
params->events = realloc(params->events,
sizeof(PTPContainer)*(evtcnt+params->nrofevents));
memcpy (&params->events[params->nrofevent
s],xevent,evtcnt*sizeof(PTPContainer));
params->nrofevents += evtcnt;
params->event90c7works = 1;
}
free (xevent);
if (params->event90c7works)
return PTP_RC_OK;
/* fall through to generic event handling */
}
} }
free (xevent);
if (params->event90c7works)
return PTP_RC_OK;
/* fall through to generic event handling */
} }
/* should not get here ... EOS has no normal PTP events and another queue handling. */ /* should not get here ... EOS has no normal PTP events and another queue handling. */
if ( (params->deviceinfo.VendorExtensionID == PTP_VENDOR_CANON) && if ( (params->deviceinfo.VendorExtensionID == PTP_VENDOR_CANON) &&
ptp_operation_issupported(params, PTP_OC_CANON_EOS_GetEvent) ptp_operation_issupported(params, PTP_OC_CANON_EOS_GetEvent)
) { ) {
return PTP_RC_OK; return PTP_RC_OK;
} }
if ( (params->deviceinfo.VendorExtensionID == PTP_VENDOR_CANON) && if ( (params->deviceinfo.VendorExtensionID == PTP_VENDOR_CANON) &&
ptp_operation_issupported(params, PTP_OC_CANON_CheckEvent) ptp_operation_issupported(params, PTP_OC_CANON_CheckEvent)
skipping to change at line 3061 skipping to change at line 3307
/* do not realloc on shrink. */ /* do not realloc on shrink. */
params->nrofevents--; params->nrofevents--;
if (!params->nrofevents) { if (!params->nrofevents) {
free (params->events); free (params->events);
params->events = NULL; params->events = NULL;
} }
return 1; return 1;
} }
/** /**
* ptp_get_one_event_by_type:
*
* Check if one specific event has appeared in the queue, and return it back to
us, and remove it from the queue.
* params: PTPParams* in: params
* code in: event code
* event out: event container
*
* Return values: 1 if removed, 0 if not.
*/
int
ptp_get_one_event_by_type(PTPParams *params, uint16_t code, PTPContainer *event)
{
unsigned int i;
if (!params->nrofevents)
return 0;
for (i=0;i<params->nrofevents;i++) {
if (params->events[i].Code == code) {
memcpy (event, params->events+i, sizeof(PTPContainer));
memmove (params->events+i, params->events+i+1, sizeof(PTP
Container)*(params->nrofevents-i-1));
/* do not realloc on shrink. */
params->nrofevents--;
if (!params->nrofevents) {
free (params->events);
params->events = NULL;
}
return 1;
}
}
return 0;
}
/**
* ptp_have_event:
*
* Check if one specific event has appeared in the queue, without draining it.
*
* params: PTPParams* in: params
* code in: event code
*
* Return values: 1 if removed, 0 if not.
*/
int
ptp_have_event(PTPParams *params, uint16_t code)
{
unsigned int i;
if (!params->nrofevents)
return 0;
for (i=0;i<params->nrofevents;i++)
if (params->events[i].Code == code)
return 1;
return 0;
}
/**
* ptp_canon_eos_getevent: * ptp_canon_eos_getevent:
* *
* This retrieves configuration status/updates/changes * This retrieves configuration status/updates/changes
* on EOS cameras. It reads a datablock which has a list of variable * on EOS cameras. It reads a datablock which has a list of variable
* sized structures. * sized structures.
* *
* params: PTPParams* * params: PTPParams*
* *
* Return values: Some PTP_RC_* code. * Return values: Some PTP_RC_* code.
* *
skipping to change at line 3146 skipping to change at line 3449
unsigned int i; unsigned int i;
for (i=0;i<params->nrofcanon_props;i++) for (i=0;i<params->nrofcanon_props;i++)
if (params->canon_props[i].proptype == propcode) if (params->canon_props[i].proptype == propcode)
break; break;
if (params->nrofcanon_props == i) if (params->nrofcanon_props == i)
return PTP_RC_Undefined; return PTP_RC_Undefined;
memcpy (dpd, &params->canon_props[i].dpd, sizeof (*dpd)); memcpy (dpd, &params->canon_props[i].dpd, sizeof (*dpd));
if (dpd->FormFlag == PTP_DPFF_Enumeration) { if (dpd->FormFlag == PTP_DPFF_Enumeration) {
/* need to duplicate the Enumeration alloc */ /* need to duplicate the Enumeration alloc */
dpd->FORM.Enum.SupportedValue = malloc (sizeof (PTPPropertyValue) *dpd->FORM.Enum.NumberOfValues); dpd->FORM.Enum.SupportedValue = calloc (sizeof (PTPPropertyValue) ,dpd->FORM.Enum.NumberOfValues);
memcpy (dpd->FORM.Enum.SupportedValue, memcpy (dpd->FORM.Enum.SupportedValue,
params->canon_props[i].dpd.FORM.Enum.SupportedValue, params->canon_props[i].dpd.FORM.Enum.SupportedValue,
sizeof (PTPPropertyValue)*dpd->FORM.Enum.NumberOfValues sizeof (PTPPropertyValue)*dpd->FORM.Enum.NumberOfValues
); );
} }
if (dpd->DataType == PTP_DTC_STR) { if (dpd->DataType == PTP_DTC_STR) {
dpd->FactoryDefaultValue.str = strdup( params->canon_props[i].dpd .FactoryDefaultValue.str ); dpd->FactoryDefaultValue.str = strdup( params->canon_props[i].dpd .FactoryDefaultValue.str );
dpd->CurrentValue.str = strdup( params->canon_props[i].dpd.Curren tValue.str ); dpd->CurrentValue.str = strdup( params->canon_props[i].dpd.Curren tValue.str );
} }
skipping to change at line 3212 skipping to change at line 3515
ret = PTP_RC_GeneralError; ret = PTP_RC_GeneralError;
goto exit; goto exit;
} }
/* check for integer overflow */ /* check for integer overflow */
if (dtoh32a(data) >= INT_MAX/sizeof(PTPCANONFolderEntry)) { if (dtoh32a(data) >= INT_MAX/sizeof(PTPCANONFolderEntry)) {
ret = PTP_RC_GeneralError; ret = PTP_RC_GeneralError;
goto exit; goto exit;
} }
*nrofentries = dtoh32a(data); *nrofentries = dtoh32a(data);
*entries = malloc(*nrofentries * sizeof(PTPCANONFolderEntry)); *entries = calloc(*nrofentries , sizeof(PTPCANONFolderEntry));
if (!*entries) { if (!*entries) {
ret = PTP_RC_GeneralError; ret = PTP_RC_GeneralError;
goto exit; goto exit;
} }
xdata = data+sizeof(uint32_t); xdata = data+sizeof(uint32_t);
for (i=0;i<*nrofentries;i++) { for (i=0;i<*nrofentries;i++) {
unsigned int entrysize; unsigned int entrysize;
if (4 + (xdata - data) > size) { if (4 + (xdata - data) > size) {
skipping to change at line 3618 skipping to change at line 3921
**/ **/
uint16_t uint16_t
ptp_canon_get_objecthandle_by_name (PTPParams* params, char* name, uint32_t* obj ectid) ptp_canon_get_objecthandle_by_name (PTPParams* params, char* name, uint32_t* obj ectid)
{ {
PTPContainer ptp; PTPContainer ptp;
uint16_t ret; uint16_t ret;
unsigned char *data; unsigned char *data;
uint8_t len = 0; uint8_t len = 0;
PTP_CNT_INIT(ptp, PTP_OC_CANON_GetObjectHandleByName); PTP_CNT_INIT(ptp, PTP_OC_CANON_GetObjectHandleByName);
data = malloc (2*(strlen(name)+1)+2); data = calloc (2,(strlen(name)+2));
if (!data) return PTP_RC_GeneralError; if (!data) return PTP_RC_GeneralError;
memset (data, 0, 2*(strlen(name)+1)+2);
ptp_pack_string (params, name, data, 0, &len); ptp_pack_string (params, name, data, 0, &len);
ret=ptp_transaction (params, &ptp, PTP_DP_SENDDATA, (len+1)*2+1, &data, N ULL); ret=ptp_transaction (params, &ptp, PTP_DP_SENDDATA, (len+1)*2+1, &data, N ULL);
free (data); free (data);
*objectid = ptp.Param1; *objectid = ptp.Param1;
return ret; return ret;
} }
/** /**
* ptp_canon_get_customize_data: * ptp_canon_get_customize_data:
* *
skipping to change at line 4296 skipping to change at line 4598
* params: PTPParams* * params: PTPParams*
* *
* Return values: Some PTP_RC_* code. * Return values: Some PTP_RC_* code.
* *
**/ **/
uint16_t uint16_t
ptp_canon_eos_get_viewfinder_image (PTPParams* params, unsigned char **data, uns igned int *size) ptp_canon_eos_get_viewfinder_image (PTPParams* params, unsigned char **data, uns igned int *size)
{ {
PTPContainer ptp; PTPContainer ptp;
PTP_CNT_INIT(ptp, PTP_OC_CANON_EOS_GetViewFinderData, 0x00100000 /* from /* Saw 3 arguments ... 0x00200000 for EOS1000D, also used 0x00100000 */
trace */); PTP_CNT_INIT(ptp, PTP_OC_CANON_EOS_GetViewFinderData, 0x00200000 /* from
trace */, 0, 0);
return ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, data, size); return ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, data, size);
} }
uint16_t uint16_t
ptp_canon_eos_get_viewfinder_image_handler (PTPParams* params, PTPDataHandler*ha ndler) ptp_canon_eos_get_viewfinder_image_handler (PTPParams* params, PTPDataHandler*ha ndler)
{ {
PTPContainer ptp; PTPContainer ptp;
PTP_CNT_INIT(ptp, PTP_OC_CANON_EOS_GetViewFinderData, 0x00100000 /* from /* Saw 3 arguments ... 0x00200000 for EOS1000D, also used 0x00100000 */
trace */); PTP_CNT_INIT(ptp, PTP_OC_CANON_EOS_GetViewFinderData, 0x00200000 /* from
trace */, 0, 0);
return ptp_transaction_new(params, &ptp, PTP_DP_GETDATA, 0, handler); return ptp_transaction_new(params, &ptp, PTP_DP_GETDATA, 0, handler);
} }
/** /**
* ptp_nikon_check_event: * ptp_nikon_check_event:
* *
* This command checks the event queue on the Nikon. * This command checks the event queue on the Nikon.
* *
* params: PTPParams* * params: PTPParams*
* PTPUSBEventContainer **event - list of usb events. * PTPUSBEventContainer **event - list of usb events.
skipping to change at line 4337 skipping to change at line 4641
PTP_CNT_INIT(ptp, PTP_OC_NIKON_GetEvent); PTP_CNT_INIT(ptp, PTP_OC_NIKON_GetEvent);
*evtcnt = 0; *evtcnt = 0;
CHECK_PTP_RC(ptp_transaction (params, &ptp, PTP_DP_GETDATA, 0, &data, &si ze)); CHECK_PTP_RC(ptp_transaction (params, &ptp, PTP_DP_GETDATA, 0, &data, &si ze));
ptp_unpack_Nikon_EC (params, data, size, event, evtcnt); ptp_unpack_Nikon_EC (params, data, size, event, evtcnt);
free (data); free (data);
return PTP_RC_OK; return PTP_RC_OK;
} }
/** /**
* ptp_nikon_check_eventex:
*
* This command checks the event queue on the Nikon.
*
* params: PTPParams*
* PTPUSBEventContainer **event - list of usb events.
* int *evtcnt - number of usb events in event structure.
*
* Return values: Some PTP_RC_* code.
*
**/
uint16_t
ptp_nikon_check_eventex (PTPParams* params, PTPContainer** event, unsigned int*
evtcnt)
{
PTPContainer ptp;
unsigned char *data = NULL;
unsigned int size;
PTP_CNT_INIT(ptp, PTP_OC_NIKON_GetEventEx);
*evtcnt = 0;
CHECK_PTP_RC(ptp_transaction (params, &ptp, PTP_DP_GETDATA, 0, &data, &si
ze));
ptp_unpack_Nikon_EC_EX (params, data, size, event, evtcnt);
free (data);
return PTP_RC_OK;
}
/**
* ptp_nikon_getptpipinfo: * ptp_nikon_getptpipinfo:
* *
* This command gets the ptpip info data. * This command gets the ptpip info data.
* *
* params: PTPParams* * params: PTPParams*
* unsigned char *data - data * unsigned char *data - data
* unsigned int size - size of returned data * unsigned int size - size of returned data
* *
* Return values: Some PTP_RC_* code. * Return values: Some PTP_RC_* code.
* *
skipping to change at line 4389 skipping to change at line 4720
ret = PTP_RC_Undefined; /* FIXME: Add more precise error code */ ret = PTP_RC_Undefined; /* FIXME: Add more precise error code */
if (size < 2) if (size < 2)
goto exit; goto exit;
params->wifi_profiles_version = data[0]; params->wifi_profiles_version = data[0];
params->wifi_profiles_number = data[1]; params->wifi_profiles_number = data[1];
free(params->wifi_profiles); free(params->wifi_profiles);
params->wifi_profiles = malloc(params->wifi_profiles_number*sizeof(PTPNIK params->wifi_profiles = calloc(params->wifi_profiles_number,sizeof(PTPNIK
ONWifiProfile)); ONWifiProfile));
memset(params->wifi_profiles, 0, params->wifi_profiles_number*sizeof(PTPN
IKONWifiProfile));
pos = 2; pos = 2;
profn = 0; profn = 0;
while (profn < params->wifi_profiles_number && pos < size) { while (profn < params->wifi_profiles_number && pos < size) {
if (pos+6 >= size) if (pos+6 >= size)
goto exit; goto exit;
params->wifi_profiles[profn].id = data[pos++]; params->wifi_profiles[profn].id = data[pos++];
params->wifi_profiles[profn].valid = data[pos++]; params->wifi_profiles[profn].valid = data[pos++];
n = dtoh32a(&data[pos]); n = dtoh32a(&data[pos]);
skipping to change at line 5518 skipping to change at line 5848
{PTP_DPC_CANON_PhotoEffect, N_("Photo Effect")}, {PTP_DPC_CANON_PhotoEffect, N_("Photo Effect")},
{PTP_DPC_CANON_AssistLight, N_("Assist Light")}, {PTP_DPC_CANON_AssistLight, N_("Assist Light")},
{PTP_DPC_CANON_FlashQuantityCount, N_("Flash Quantity Count" )}, {PTP_DPC_CANON_FlashQuantityCount, N_("Flash Quantity Count" )},
{PTP_DPC_CANON_RotationAngle, N_("Rotation Angle")}, {PTP_DPC_CANON_RotationAngle, N_("Rotation Angle")},
{PTP_DPC_CANON_RotationScene, N_("Rotation Scene")}, {PTP_DPC_CANON_RotationScene, N_("Rotation Scene")},
{PTP_DPC_CANON_EventEmulateMode,N_("Event Emulate Mode")}, {PTP_DPC_CANON_EventEmulateMode,N_("Event Emulate Mode")},
{PTP_DPC_CANON_DPOFVersion, N_("DPOF Version")}, {PTP_DPC_CANON_DPOFVersion, N_("DPOF Version")},
{PTP_DPC_CANON_TypeOfSupportedSlideShow, N_("Type of Slide show")}, {PTP_DPC_CANON_TypeOfSupportedSlideShow, N_("Type of Slide show")},
{PTP_DPC_CANON_AverageFilesizes,N_("Average Filesizes")}, {PTP_DPC_CANON_AverageFilesizes,N_("Average Filesizes")},
{PTP_DPC_CANON_ModelID, N_("Model ID")}, {PTP_DPC_CANON_ModelID, N_("Model ID")},
{PTP_DPC_CANON_EOS_FixedMovie, N_("EOS Fixed Movie Switch")},
{PTP_DPC_CANON_EOS_PowerZoomPosition,"EOS_PowerZoomPosition"},
{PTP_DPC_CANON_EOS_StrobeSettingSimple,"EOS_StrobeSettingSimple"}
,
{PTP_DPC_CANON_EOS_ConnectTrigger,"EOS_ConnectTrigger"},
{PTP_DPC_CANON_EOS_ChangeCameraMode,"EOS_ChangeCameraMode"},
{PTP_DPC_CANON_EOS_Aperture,"EOS_Aperture"},
{PTP_DPC_CANON_EOS_ShutterSpeed,"EOS_ShutterSpeed"},
{PTP_DPC_CANON_EOS_ISOSpeed,"EOS_ISOSpeed"},
{PTP_DPC_CANON_EOS_ExpCompensation,"EOS_ExpCompensation"},
{PTP_DPC_CANON_EOS_AutoExposureMode,"EOS_AutoExposureMode"},
{PTP_DPC_CANON_EOS_DriveMode,"EOS_DriveMode"},
{PTP_DPC_CANON_EOS_MeteringMode,"EOS_MeteringMode"},
{PTP_DPC_CANON_EOS_FocusMode,"EOS_FocusMode"},
{PTP_DPC_CANON_EOS_WhiteBalance,"EOS_WhiteBalance"},
{PTP_DPC_CANON_EOS_ColorTemperature,"EOS_ColorTemperature"},
{PTP_DPC_CANON_EOS_WhiteBalanceAdjustA,"EOS_WhiteBalanceAdjustA"}
,
{PTP_DPC_CANON_EOS_WhiteBalanceAdjustB,"EOS_WhiteBalanceAdjustB"}
,
{PTP_DPC_CANON_EOS_WhiteBalanceXA,"EOS_WhiteBalanceXA"},
{PTP_DPC_CANON_EOS_WhiteBalanceXB,"EOS_WhiteBalanceXB"},
{PTP_DPC_CANON_EOS_ColorSpace,"EOS_ColorSpace"},
{PTP_DPC_CANON_EOS_PictureStyle,"EOS_PictureStyle"},
{PTP_DPC_CANON_EOS_BatteryPower,"EOS_BatteryPower"},
{PTP_DPC_CANON_EOS_BatterySelect,"EOS_BatterySelect"},
{PTP_DPC_CANON_EOS_CameraTime,"EOS_CameraTime"},
{PTP_DPC_CANON_EOS_AutoPowerOff,"EOS_AutoPowerOff"},
{PTP_DPC_CANON_EOS_Owner,"EOS_Owner"},
{PTP_DPC_CANON_EOS_ModelID,"EOS_ModelID"},
{PTP_DPC_CANON_EOS_PTPExtensionVersion,"EOS_PTPExtensionVersion"}
,
{PTP_DPC_CANON_EOS_DPOFVersion,"EOS_DPOFVersion"},
{PTP_DPC_CANON_EOS_AvailableShots,"EOS_AvailableShots"},
{PTP_DPC_CANON_EOS_CaptureDestination,"EOS_CaptureDestination"},
{PTP_DPC_CANON_EOS_BracketMode,"EOS_BracketMode"},
{PTP_DPC_CANON_EOS_CurrentStorage,"EOS_CurrentStorage"},
{PTP_DPC_CANON_EOS_CurrentFolder,"EOS_CurrentFolder"},
{PTP_DPC_CANON_EOS_ImageFormat,"EOS_ImageFormat"},
{PTP_DPC_CANON_EOS_ImageFormatCF,"EOS_ImageFormatCF"},
{PTP_DPC_CANON_EOS_ImageFormatSD,"EOS_ImageFormatSD"},
{PTP_DPC_CANON_EOS_ImageFormatExtHD,"EOS_ImageFormatExtHD"},
{PTP_DPC_CANON_EOS_RefocusState,"EOS_RefocusState"},
{PTP_DPC_CANON_EOS_CameraNickname,"EOS_CameraNickname"},
{PTP_DPC_CANON_EOS_StroboSettingExpCompositionControl,"EOS_Strobo
SettingExpCompositionControl"},
{PTP_DPC_CANON_EOS_ConnectStatus,"EOS_ConnectStatus"},
{PTP_DPC_CANON_EOS_LensBarrelStatus,"EOS_LensBarrelStatus"},
{PTP_DPC_CANON_EOS_SilentShutterSetting,"EOS_SilentShutterSetting
"},
{PTP_DPC_CANON_EOS_LV_AF_EyeDetect,"EOS_LV_AF_EyeDetect"},
{PTP_DPC_CANON_EOS_AutoTransMobile,"EOS_AutoTransMobile"},
{PTP_DPC_CANON_EOS_URLSupportFormat,"EOS_URLSupportFormat"},
{PTP_DPC_CANON_EOS_SpecialAcc,"EOS_SpecialAcc"},
{PTP_DPC_CANON_EOS_CompressionS,"EOS_CompressionS"},
{PTP_DPC_CANON_EOS_CompressionM1,"EOS_CompressionM1"},
{PTP_DPC_CANON_EOS_CompressionM2,"EOS_CompressionM2"},
{PTP_DPC_CANON_EOS_CompressionL,"EOS_CompressionL"},
{PTP_DPC_CANON_EOS_IntervalShootSetting,"EOS_IntervalShootSetting
"},
{PTP_DPC_CANON_EOS_IntervalShootState,"EOS_IntervalShootState"},
{PTP_DPC_CANON_EOS_PushMode,"EOS_PushMode"},
{PTP_DPC_CANON_EOS_LvCFilterKind,"EOS_LvCFilterKind"},
{PTP_DPC_CANON_EOS_AEModeDial,"EOS_AEModeDial"},
{PTP_DPC_CANON_EOS_AEModeCustom,"EOS_AEModeCustom"},
{PTP_DPC_CANON_EOS_MirrorUpSetting,"EOS_MirrorUpSetting"},
{PTP_DPC_CANON_EOS_HighlightTonePriority,"EOS_HighlightTonePriori
ty"},
{PTP_DPC_CANON_EOS_AFSelectFocusArea,"EOS_AFSelectFocusArea"},
{PTP_DPC_CANON_EOS_HDRSetting,"EOS_HDRSetting"},
{PTP_DPC_CANON_EOS_TimeShootSetting,"EOS_TimeShootSetting"},
{PTP_DPC_CANON_EOS_NFCApplicationInfo,"EOS_NFCApplicationInfo"},
{PTP_DPC_CANON_EOS_PCWhiteBalance1,"EOS_PCWhiteBalance1"},
{PTP_DPC_CANON_EOS_PCWhiteBalance2,"EOS_PCWhiteBalance2"},
{PTP_DPC_CANON_EOS_PCWhiteBalance3,"EOS_PCWhiteBalance3"},
{PTP_DPC_CANON_EOS_PCWhiteBalance4,"EOS_PCWhiteBalance4"},
{PTP_DPC_CANON_EOS_PCWhiteBalance5,"EOS_PCWhiteBalance5"},
{PTP_DPC_CANON_EOS_MWhiteBalance,"EOS_MWhiteBalance"},
{PTP_DPC_CANON_EOS_MWhiteBalanceEx,"EOS_MWhiteBalanceEx"},
{PTP_DPC_CANON_EOS_PowerZoomSpeed,"EOS_PowerZoomSpeed"},
{PTP_DPC_CANON_EOS_NetworkServerRegion,"EOS_NetworkServerRegion"}
,
{PTP_DPC_CANON_EOS_GPSLogCtrl,"EOS_GPSLogCtrl"},
{PTP_DPC_CANON_EOS_GPSLogListNum,"EOS_GPSLogListNum"},
{PTP_DPC_CANON_EOS_UnknownPropD14D,"EOS_UnknownPropD14D"},
{PTP_DPC_CANON_EOS_PictureStyleStandard,"EOS_PictureStyleStandard
"},
{PTP_DPC_CANON_EOS_PictureStylePortrait,"EOS_PictureStylePortrait
"},
{PTP_DPC_CANON_EOS_PictureStyleLandscape,"EOS_PictureStyleLandsca
pe"},
{PTP_DPC_CANON_EOS_PictureStyleNeutral,"EOS_PictureStyleNeutral"}
,
{PTP_DPC_CANON_EOS_PictureStyleFaithful,"EOS_PictureStyleFaithful
"},
{PTP_DPC_CANON_EOS_PictureStyleBlackWhite,"EOS_PictureStyleBlackW
hite"},
{PTP_DPC_CANON_EOS_PictureStyleAuto,"EOS_PictureStyleAuto"},
{PTP_DPC_CANON_EOS_PictureStyleExStandard,"EOS_PictureStyleExStan
dard"},
{PTP_DPC_CANON_EOS_PictureStyleExPortrait,"EOS_PictureStyleExPort
rait"},
{PTP_DPC_CANON_EOS_PictureStyleExLandscape,"EOS_PictureStyleExLan
dscape"},
{PTP_DPC_CANON_EOS_PictureStyleExNeutral,"EOS_PictureStyleExNeutr
al"},
{PTP_DPC_CANON_EOS_PictureStyleExFaithful,"EOS_PictureStyleExFait
hful"},
{PTP_DPC_CANON_EOS_PictureStyleExBlackWhite,"EOS_PictureStyleExBl
ackWhite"},
{PTP_DPC_CANON_EOS_PictureStyleExAuto,"EOS_PictureStyleExAuto"},
{PTP_DPC_CANON_EOS_PictureStyleExFineDetail,"EOS_PictureStyleExFi
neDetail"},
{PTP_DPC_CANON_EOS_PictureStyleUserSet1,"EOS_PictureStyleUserSet1
"},
{PTP_DPC_CANON_EOS_PictureStyleUserSet2,"EOS_PictureStyleUserSet2
"},
{PTP_DPC_CANON_EOS_PictureStyleUserSet3,"EOS_PictureStyleUserSet3
"},
{PTP_DPC_CANON_EOS_PictureStyleExUserSet1,"EOS_PictureStyleExUser
Set1"},
{PTP_DPC_CANON_EOS_PictureStyleExUserSet2,"EOS_PictureStyleExUser
Set2"},
{PTP_DPC_CANON_EOS_PictureStyleExUserSet3,"EOS_PictureStyleExUser
Set3"},
{PTP_DPC_CANON_EOS_MovieAVModeFine,"EOS_MovieAVModeFine"},
{PTP_DPC_CANON_EOS_ShutterReleaseCounter,"EOS_ShutterReleaseCount
er"},
{PTP_DPC_CANON_EOS_AvailableImageSize,"EOS_AvailableImageSize"},
{PTP_DPC_CANON_EOS_ErrorHistory,"EOS_ErrorHistory"},
{PTP_DPC_CANON_EOS_LensExchangeHistory,"EOS_LensExchangeHistory"}
,
{PTP_DPC_CANON_EOS_StroboExchangeHistory,"EOS_StroboExchangeHisto
ry"},
{PTP_DPC_CANON_EOS_PictureStyleParam1,"EOS_PictureStyleParam1"},
{PTP_DPC_CANON_EOS_PictureStyleParam2,"EOS_PictureStyleParam2"},
{PTP_DPC_CANON_EOS_PictureStyleParam3,"EOS_PictureStyleParam3"},
{PTP_DPC_CANON_EOS_MovieRecordVolumeLine,"EOS_MovieRecordVolumeLi
ne"},
{PTP_DPC_CANON_EOS_NetworkCommunicationMode,"EOS_NetworkCommunica
tionMode"},
{PTP_DPC_CANON_EOS_CanonLogGamma,"EOS_CanonLogGamma"},
{PTP_DPC_CANON_EOS_SmartphoneShowImageConfig,"EOS_SmartphoneShowI
mageConfig"},
{PTP_DPC_CANON_EOS_HighISOSettingNoiseReduction,"EOS_HighISOSetti
ngNoiseReduction"},
{PTP_DPC_CANON_EOS_MovieServoAF,"EOS_MovieServoAF"},
{PTP_DPC_CANON_EOS_ContinuousAFValid,"EOS_ContinuousAFValid"},
{PTP_DPC_CANON_EOS_Attenuator,"EOS_Attenuator"},
{PTP_DPC_CANON_EOS_UTCTime,"EOS_UTCTime"},
{PTP_DPC_CANON_EOS_Timezone,"EOS_Timezone"},
{PTP_DPC_CANON_EOS_Summertime,"EOS_Summertime"},
{PTP_DPC_CANON_EOS_FlavorLUTParams,"EOS_FlavorLUTParams"},
{PTP_DPC_CANON_EOS_CustomFunc1,"EOS_CustomFunc1"},
{PTP_DPC_CANON_EOS_CustomFunc2,"EOS_CustomFunc2"},
{PTP_DPC_CANON_EOS_CustomFunc3,"EOS_CustomFunc3"},
{PTP_DPC_CANON_EOS_CustomFunc4,"EOS_CustomFunc4"},
{PTP_DPC_CANON_EOS_CustomFunc5,"EOS_CustomFunc5"},
{PTP_DPC_CANON_EOS_CustomFunc6,"EOS_CustomFunc6"},
{PTP_DPC_CANON_EOS_CustomFunc7,"EOS_CustomFunc7"},
{PTP_DPC_CANON_EOS_CustomFunc8,"EOS_CustomFunc8"},
{PTP_DPC_CANON_EOS_CustomFunc9,"EOS_CustomFunc9"},
{PTP_DPC_CANON_EOS_CustomFunc10,"EOS_CustomFunc10"},
{PTP_DPC_CANON_EOS_CustomFunc11,"EOS_CustomFunc11"},
{PTP_DPC_CANON_EOS_CustomFunc12,"EOS_CustomFunc12"},
{PTP_DPC_CANON_EOS_CustomFunc13,"EOS_CustomFunc13"},
{PTP_DPC_CANON_EOS_CustomFunc14,"EOS_CustomFunc14"},
{PTP_DPC_CANON_EOS_CustomFunc15,"EOS_CustomFunc15"},
{PTP_DPC_CANON_EOS_CustomFunc16,"EOS_CustomFunc16"},
{PTP_DPC_CANON_EOS_CustomFunc17,"EOS_CustomFunc17"},
{PTP_DPC_CANON_EOS_CustomFunc18,"EOS_CustomFunc18"},
{PTP_DPC_CANON_EOS_CustomFunc19,"EOS_CustomFunc19"},
{PTP_DPC_CANON_EOS_CustomFunc19,"EOS_CustomFunc19"},
{PTP_DPC_CANON_EOS_InnerDevelop,"EOS_InnerDevelop"},
{PTP_DPC_CANON_EOS_MultiAspect,"EOS_MultiAspect"},
{PTP_DPC_CANON_EOS_MovieSoundRecord,"EOS_MovieSoundRecord"},
{PTP_DPC_CANON_EOS_MovieRecordVolume,"EOS_MovieRecordVolume"},
{PTP_DPC_CANON_EOS_WindCut,"EOS_WindCut"},
{PTP_DPC_CANON_EOS_ExtenderType,"EOS_ExtenderType"},
{PTP_DPC_CANON_EOS_OLCInfoVersion,"EOS_OLCInfoVersion"},
{PTP_DPC_CANON_EOS_UnknownPropD19A,"EOS_UnknownPropD19A"},
{PTP_DPC_CANON_EOS_UnknownPropD19C,"EOS_UnknownPropD19C"},
{PTP_DPC_CANON_EOS_UnknownPropD19D,"EOS_UnknownPropD19D"},
{PTP_DPC_CANON_EOS_GPSDeviceActive,"EOS_GPSDeviceActive"},
{PTP_DPC_CANON_EOS_CustomFuncEx,"EOS_CustomFuncEx"},
{PTP_DPC_CANON_EOS_MyMenu,"EOS_MyMenu"},
{PTP_DPC_CANON_EOS_MyMenuList,"EOS_MyMenuList"},
{PTP_DPC_CANON_EOS_WftStatus,"EOS_WftStatus"},
{PTP_DPC_CANON_EOS_WftInputTransmission,"EOS_WftInputTransmission
"},
{PTP_DPC_CANON_EOS_HDDirectoryStructure,"EOS_HDDirectoryStructure
"},
{PTP_DPC_CANON_EOS_BatteryInfo,"EOS_BatteryInfo"},
{PTP_DPC_CANON_EOS_AdapterInfo,"EOS_AdapterInfo"},
{PTP_DPC_CANON_EOS_LensStatus,"EOS_LensStatus"},
{PTP_DPC_CANON_EOS_QuickReviewTime,"EOS_QuickReviewTime"},
{PTP_DPC_CANON_EOS_CardExtension,"EOS_CardExtension"},
{PTP_DPC_CANON_EOS_TempStatus,"EOS_TempStatus"},
{PTP_DPC_CANON_EOS_ShutterCounter,"EOS_ShutterCounter"},
{PTP_DPC_CANON_EOS_SpecialOption,"EOS_SpecialOption"},
{PTP_DPC_CANON_EOS_PhotoStudioMode,"EOS_PhotoStudioMode"},
{PTP_DPC_CANON_EOS_SerialNumber,"EOS_SerialNumber"},
{PTP_DPC_CANON_EOS_EVFOutputDevice,"EOS_EVFOutputDevice"},
{PTP_DPC_CANON_EOS_EVFMode,"EOS_EVFMode"},
{PTP_DPC_CANON_EOS_DepthOfFieldPreview,"EOS_DepthOfFieldPreview"}
,
{PTP_DPC_CANON_EOS_EVFSharpness,"EOS_EVFSharpness"},
{PTP_DPC_CANON_EOS_EVFWBMode,"EOS_EVFWBMode"},
{PTP_DPC_CANON_EOS_EVFClickWBCoeffs,"EOS_EVFClickWBCoeffs"},
{PTP_DPC_CANON_EOS_EVFColorTemp,"EOS_EVFColorTemp"},
{PTP_DPC_CANON_EOS_ExposureSimMode,"EOS_ExposureSimMode"},
{PTP_DPC_CANON_EOS_EVFRecordStatus,"EOS_EVFRecordStatus"},
{PTP_DPC_CANON_EOS_LvAfSystem,"EOS_LvAfSystem"},
{PTP_DPC_CANON_EOS_MovSize,"EOS_MovSize"},
{PTP_DPC_CANON_EOS_LvViewTypeSelect,"EOS_LvViewTypeSelect"},
{PTP_DPC_CANON_EOS_MirrorDownStatus,"EOS_MirrorDownStatus"},
{PTP_DPC_CANON_EOS_MovieParam,"EOS_MovieParam"},
{PTP_DPC_CANON_EOS_MirrorLockupState,"EOS_MirrorLockupState"},
{PTP_DPC_CANON_EOS_FlashChargingState,"EOS_FlashChargingState"},
{PTP_DPC_CANON_EOS_AloMode,"EOS_AloMode"},
{PTP_DPC_CANON_EOS_OneShotRawOn,"EOS_OneShotRawOn"},
{PTP_DPC_CANON_EOS_ErrorForDisplay,"EOS_ErrorForDisplay"},
{PTP_DPC_CANON_EOS_AEModeMovie,"EOS_AEModeMovie"},
{PTP_DPC_CANON_EOS_BuiltinStroboMode,"EOS_BuiltinStroboMode"},
{PTP_DPC_CANON_EOS_StroboDispState,"EOS_StroboDispState"},
{PTP_DPC_CANON_EOS_StroboETTL2Metering,"EOS_StroboETTL2Metering"}
,
{PTP_DPC_CANON_EOS_ContinousAFMode,"EOS_ContinousAFMode"},
{PTP_DPC_CANON_EOS_MovieParam2,"EOS_MovieParam2"},
{PTP_DPC_CANON_EOS_StroboSettingExpComposition,"EOS_StroboSetting
ExpComposition"},
{PTP_DPC_CANON_EOS_MovieParam3,"EOS_MovieParam3"},
{PTP_DPC_CANON_EOS_MovieParam4,"EOS_MovieParam4"},
{PTP_DPC_CANON_EOS_LVMedicalRotate,"EOS_LVMedicalRotate"},
{PTP_DPC_CANON_EOS_Artist,"EOS_Artist"},
{PTP_DPC_CANON_EOS_Copyright,"EOS_Copyright"},
{PTP_DPC_CANON_EOS_BracketValue,"EOS_BracketValue"},
{PTP_DPC_CANON_EOS_FocusInfoEx,"EOS_FocusInfoEx"},
{PTP_DPC_CANON_EOS_DepthOfField,"EOS_DepthOfField"},
{PTP_DPC_CANON_EOS_Brightness,"EOS_Brightness"},
{PTP_DPC_CANON_EOS_LensAdjustParams,"EOS_LensAdjustParams"},
{PTP_DPC_CANON_EOS_EFComp,"EOS_EFComp"},
{PTP_DPC_CANON_EOS_LensName,"EOS_LensName"},
{PTP_DPC_CANON_EOS_AEB,"EOS_AEB"},
{PTP_DPC_CANON_EOS_StroboSetting,"EOS_StroboSetting"},
{PTP_DPC_CANON_EOS_StroboWirelessSetting,"EOS_StroboWirelessSetti
ng"},
{PTP_DPC_CANON_EOS_StroboFiring,"EOS_StroboFiring"},
{PTP_DPC_CANON_EOS_LensID,"EOS_LensID"},
{PTP_DPC_CANON_EOS_LCDBrightness,"EOS_LCDBrightness"},
{PTP_DPC_CANON_EOS_CADarkBright,"EOS_CADarkBright"},
{PTP_DPC_CANON_EOS_CAssistPreset,"EOS_CAssistPreset"},
{PTP_DPC_CANON_EOS_CAssistBrightness,"EOS_CAssistBrightness"},
{PTP_DPC_CANON_EOS_CAssistContrast,"EOS_CAssistContrast"},
{PTP_DPC_CANON_EOS_CAssistSaturation,"EOS_CAssistSaturation"},
{PTP_DPC_CANON_EOS_CAssistColorBA,"EOS_CAssistColorBA"},
{PTP_DPC_CANON_EOS_CAssistColorMG,"EOS_CAssistColorMG"},
{PTP_DPC_CANON_EOS_CAssistMonochrome,"EOS_CAssistMonochrome"},
{PTP_DPC_CANON_EOS_FocusShiftSetting,"EOS_FocusShiftSetting"},
{PTP_DPC_CANON_EOS_MovieSelfTimer,"EOS_MovieSelfTimer"},
{PTP_DPC_CANON_EOS_Clarity,"EOS_Clarity"},
{PTP_DPC_CANON_EOS_2GHDRSetting,"EOS_2GHDRSetting"},
{PTP_DPC_CANON_EOS_MovieParam5,"EOS_MovieParam5"},
{PTP_DPC_CANON_EOS_HDRViewAssistModeRec,"EOS_HDRViewAssistModeRec
"},
{PTP_DPC_CANON_EOS_PropFinderAFFrame,"EOS_PropFinderAFFrame"},
{PTP_DPC_CANON_EOS_VariableMovieRecSetting,"EOS_VariableMovieRecS
etting"},
{PTP_DPC_CANON_EOS_PropAutoRotate,"EOS_PropAutoRotate"},
{PTP_DPC_CANON_EOS_MFPeakingSetting,"EOS_MFPeakingSetting"},
{PTP_DPC_CANON_EOS_MovieSpatialOversampling,"EOS_MovieSpatialOver
sampling"},
{PTP_DPC_CANON_EOS_MovieCropMode,"EOS_MovieCropMode"},
{PTP_DPC_CANON_EOS_ShutterType,"EOS_ShutterType"},
{PTP_DPC_CANON_EOS_WFTBatteryPower,"EOS_WFTBatteryPower"},
{PTP_DPC_CANON_EOS_BatteryInfoEx,"EOS_BatteryInfoEx"},
{0,NULL} {0,NULL}
}; };
struct { struct {
uint16_t dpc; uint16_t dpc;
const char *txt; const char *txt;
} ptp_device_properties_Nikon[] = { } ptp_device_properties_Nikon[] = {
{PTP_DPC_NIKON_ShootingBank, /* 0xD010 */ {PTP_DPC_NIKON_ShootingBank, /* 0xD010 */
N_("Shooting Bank")}, N_("Shooting Bank")},
{PTP_DPC_NIKON_ShootingBankNameA, /* 0xD011 */ {PTP_DPC_NIKON_ShootingBankNameA, /* 0xD011 */
skipping to change at line 7714 skipping to change at line 8277
{PTP_OC_NIKON_GetObjectSize,"GetObjectSize"}, {PTP_OC_NIKON_GetObjectSize,"GetObjectSize"},
{PTP_OC_NIKON_GetLiveViewCompressedSize,"GetLiveViewCompressedSize"}, {PTP_OC_NIKON_GetLiveViewCompressedSize,"GetLiveViewCompressedSize"},
{PTP_OC_NIKON_StartTracking,"StartTracking"}, {PTP_OC_NIKON_StartTracking,"StartTracking"},
{PTP_OC_NIKON_EndTracking,"EndTracking"}, {PTP_OC_NIKON_EndTracking,"EndTracking"},
{PTP_OC_NIKON_ChangeAELock,"ChangeAELock"}, {PTP_OC_NIKON_ChangeAELock,"ChangeAELock"},
{PTP_OC_NIKON_GetLiveViewImageEx,"GetLiveViewImageEx"}, {PTP_OC_NIKON_GetLiveViewImageEx,"GetLiveViewImageEx"},
{PTP_OC_NIKON_GetPartialObjectEx,"GetPartialObjectEx"}, {PTP_OC_NIKON_GetPartialObjectEx,"GetPartialObjectEx"},
{PTP_OC_NIKON_GetManualSettingLensData,"GetManualSettingLensData"}, {PTP_OC_NIKON_GetManualSettingLensData,"GetManualSettingLensData"},
{PTP_OC_NIKON_PowerZoomByFocalLength,"PowerZoomByFocalLength"}, {PTP_OC_NIKON_PowerZoomByFocalLength,"PowerZoomByFocalLength"},
{PTP_OC_NIKON_ActiveSelectionControl,"ActiveSelectionControl"}, {PTP_OC_NIKON_ActiveSelectionControl,"ActiveSelectionControl"},
{PTP_OC_NIKON_ChangeMonitorOff,"ChangeMonitorOff"},
{PTP_OC_NIKON_InitiatePixelMapping,"InitiatePixelMapping"},
{PTP_OC_NIKON_GetObjectsMetaData,"GetObjectsMetaData"},
{PTP_OC_NIKON_ChangeApplicationMode,"ChangeApplicationMode"},
{PTP_OC_NIKON_ResetMenu,"ResetMenu"},
}; };
ptp_opcode_trans_t ptp_opcode_canon_trans[] = { ptp_opcode_trans_t ptp_opcode_canon_trans[] = {
{PTP_OC_CANON_GetPartialObjectInfo,"GetPartialObjectInfo"}, {PTP_OC_CANON_GetPartialObjectInfo,"GetPartialObjectInfo"},
{PTP_OC_CANON_SetObjectArchive,"SetObjectArchive"}, {PTP_OC_CANON_SetObjectArchive,"SetObjectArchive"},
{PTP_OC_CANON_KeepDeviceOn,"KeepDeviceOn"}, {PTP_OC_CANON_KeepDeviceOn,"KeepDeviceOn"},
{PTP_OC_CANON_LockDeviceUI,"LockDeviceUI"}, {PTP_OC_CANON_LockDeviceUI,"LockDeviceUI"},
{PTP_OC_CANON_UnlockDeviceUI,"UnlockDeviceUI"}, {PTP_OC_CANON_UnlockDeviceUI,"UnlockDeviceUI"},
{PTP_OC_CANON_GetObjectHandleByName,"GetObjectHandleByName"}, {PTP_OC_CANON_GetObjectHandleByName,"GetObjectHandleByName"},
{PTP_OC_CANON_InitiateReleaseControl,"InitiateReleaseControl"}, {PTP_OC_CANON_InitiateReleaseControl,"InitiateReleaseControl"},
skipping to change at line 8073 skipping to change at line 8641
{PTP_EC_Nikon_MovieRecordComplete, PTP_VENDOR_NIKON, "Nikon_ MovieRecordComplete"}, {PTP_EC_Nikon_MovieRecordComplete, PTP_VENDOR_NIKON, "Nikon_ MovieRecordComplete"},
{PTP_EC_Nikon_MovieRecordStarted, PTP_VENDOR_NIKON, "Nikon_ MovieRecordStarted"}, {PTP_EC_Nikon_MovieRecordStarted, PTP_VENDOR_NIKON, "Nikon_ MovieRecordStarted"},
{PTP_EC_Nikon_PictureControlAdjustChanged, PTP_VENDOR_NIKON, "Nikon_ PictureControlAdjustChanged"}, {PTP_EC_Nikon_PictureControlAdjustChanged, PTP_VENDOR_NIKON, "Nikon_ PictureControlAdjustChanged"},
{PTP_EC_Nikon_LiveViewStateChanged, PTP_VENDOR_NIKON, "Nikon_ LiveViewStateChanged"}, {PTP_EC_Nikon_LiveViewStateChanged, PTP_VENDOR_NIKON, "Nikon_ LiveViewStateChanged"},
{PTP_EC_Nikon_ManualSettingsLensDataChanged, PTP_VENDOR_NIKON, "Nikon_ ManualSettingsLensDataChanged"}, {PTP_EC_Nikon_ManualSettingsLensDataChanged, PTP_VENDOR_NIKON, "Nikon_ ManualSettingsLensDataChanged"},
{PTP_EC_Nikon_ActiveSelectionInterrupted, PTP_VENDOR_NIKON, "Nikon_ ActiveSelectionInterrupted"}, {PTP_EC_Nikon_ActiveSelectionInterrupted, PTP_VENDOR_NIKON, "Nikon_ ActiveSelectionInterrupted"},
{PTP_EC_Nikon_SBAdded, PTP_VENDOR_NIKON, "Nikon_ SBAdded"}, {PTP_EC_Nikon_SBAdded, PTP_VENDOR_NIKON, "Nikon_ SBAdded"},
{PTP_EC_Nikon_SBRemoved, PTP_VENDOR_NIKON, "Nikon_ SBRemoved"}, {PTP_EC_Nikon_SBRemoved, PTP_VENDOR_NIKON, "Nikon_ SBRemoved"},
{PTP_EC_Nikon_SBAttrChanged, PTP_VENDOR_NIKON, "Nikon_ SBAttrChanged"}, {PTP_EC_Nikon_SBAttrChanged, PTP_VENDOR_NIKON, "Nikon_ SBAttrChanged"},
{PTP_EC_Nikon_SBGroupAttrChanged, PTP_VENDOR_NIKON, "Nikon_ SBGroupAttrChanged"}, {PTP_EC_Nikon_SBGroupAttrChanged, PTP_VENDOR_NIKON, "Nikon_ SBGroupAttrChanged"},
{PTP_EC_Nikon_1stCaptureComplete, PTP_VENDOR_NIKON, "Nikon_
1stCaptureComplete"},
{PTP_EC_Nikon_MirrorUpCancelComplete, PTP_VENDOR_NIKON, "Nikon_
MirrorUpCancelComplete"},
{PTP_EC_Sony_ObjectAdded, PTP_VENDOR_SONY, "Sony_O bjectAdded"}, {PTP_EC_Sony_ObjectAdded, PTP_VENDOR_SONY, "Sony_O bjectAdded"},
{PTP_EC_Sony_ObjectRemoved, PTP_VENDOR_SONY, "Sony_O bjectRemoved"}, {PTP_EC_Sony_ObjectRemoved, PTP_VENDOR_SONY, "Sony_O bjectRemoved"},
{PTP_EC_Sony_PropertyChanged, PTP_VENDOR_SONY, "Sony_P ropertyChanged"}, {PTP_EC_Sony_PropertyChanged, PTP_VENDOR_SONY, "Sony_P ropertyChanged"},
{PTP_EC_Olympus_CreateRecView, PTP_VENDOR_GP_OLYMPUS, "O lympus_CreateRecView"}, {PTP_EC_Olympus_CreateRecView, PTP_VENDOR_GP_OLYMPUS, "O lympus_CreateRecView"},
{PTP_EC_Olympus_CreateRecView_New, PTP_VENDOR_GP_OLYMPUS, "O lympus_CreateRecView_New"}, {PTP_EC_Olympus_CreateRecView_New, PTP_VENDOR_GP_OLYMPUS, "O lympus_CreateRecView_New"},
{PTP_EC_Olympus_ObjectAdded, PTP_VENDOR_GP_OLYMPUS, "O lympus_ObjectAdded"}, {PTP_EC_Olympus_ObjectAdded, PTP_VENDOR_GP_OLYMPUS, "O lympus_ObjectAdded"},
{PTP_EC_Olympus_ObjectAdded_New, PTP_VENDOR_GP_OLYMPUS, "O lympus_ObjectAdded_New"}, {PTP_EC_Olympus_ObjectAdded_New, PTP_VENDOR_GP_OLYMPUS, "O lympus_ObjectAdded_New"},
{PTP_EC_Olympus_AF_Frame, PTP_VENDOR_GP_OLYMPUS, "O lympus_AF_Frame"}, {PTP_EC_Olympus_AF_Frame, PTP_VENDOR_GP_OLYMPUS, "O lympus_AF_Frame"},
skipping to change at line 8542 skipping to change at line 9112
if (ob->flags & PTPOBJECT_PARENTOBJECT_LOADED) { if (ob->flags & PTPOBJECT_PARENTOBJECT_LOADED) {
if (ob->oi.ParentObject != saveparent) if (ob->oi.ParentObject != saveparent)
ptp_debug (params, "saved parent %08x is not the same as read via getobjectinfo %08x", ob->oi.ParentObject, saveparent); ptp_debug (params, "saved parent %08x is not the same as read via getobjectinfo %08x", ob->oi.ParentObject, saveparent);
ob->oi.ParentObject = saveparent; ob->oi.ParentObject = saveparent;
} }
/* Second EOS issue, 0x20000000 has 0x20000000 as parent */ /* Second EOS issue, 0x20000000 has 0x20000000 as parent */
if (ob->oi.ParentObject == handle) if (ob->oi.ParentObject == handle)
ob->oi.ParentObject = 0; ob->oi.ParentObject = 0;
/* Detect if the file is larger than 4GB ... indicator is size 0x
ffffffff ...
* In that case explicitly request the MTP object proplist to get
the right size */
if (ob->oi.ObjectCompressedSize == 0xffffffffUL) {
uint64_t newsize;
if ( (params->deviceinfo.VendorExtensionID == PTP_VEND
OR_NIKON) &&
ptp_operation_issupported(params,PTP_OC_NIKON_Get
ObjectSize) &&
(PTP_RC_OK == ptp_nikon_getobjectsize(params, han
dle, &newsize))
) {
ob->oi.ObjectCompressedSize = newsize;
goto read64bit;
}
/* more methods like e.g. for Canon */
/* if not try MTP method */
want |= PTPOBJECT_MTPPROPLIST_LOADED;
params->device_flags |= DEVICE_FLAG_PROPLIST_OVERRIDES_OI
; /* FIXME: wild hack so below code works, needs review. */
read64bit: ;
}
/* Apple iOS X does that for the root folder. */ /* Apple iOS X does that for the root folder. */
if ((ob->oi.ParentObject == ob->oi.StorageID)) { if ((ob->oi.ParentObject == ob->oi.StorageID)) {
PTPObject *parentob; PTPObject *parentob;
if (ptp_object_find (params, ob->oi.ParentObject, &parent ob) != PTP_RC_OK) { if (ptp_object_find (params, ob->oi.ParentObject, &parent ob) != PTP_RC_OK) {
ptp_debug (params, "parent %08x of %s has same id as storage id. and no object found ... rewriting to 0.", ob->oi.ParentObject, o b->oi.Filename); ptp_debug (params, "parent %08x of %s has same id as storage id. and no object found ... rewriting to 0.", ob->oi.ParentObject, o b->oi.Filename);
ob->oi.ParentObject = 0; ob->oi.ParentObject = 0;
} }
} }
 End of changes. 36 change blocks. 
64 lines changed or deleted 739 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)