also allow partial data sent to handler for libmtp

git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15185 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
Marcus Meissner
2014-09-17 14:40:07 +00:00
parent fba1cf0455
commit ce815ef2a2
2 changed files with 26 additions and 0 deletions

View File

@@ -1446,6 +1446,29 @@ ptp_getpartialobject (PTPParams* params, uint32_t handle, uint32_t offset,
return ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, object, len);
}
/**
* ptp_getpartialobject_to_handler:
* params: PTPParams*
* handle - Object handle
* offset - Offset into object
* maxbytes - Maximum of bytes to read
* handler - a ptp data 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_getpartialobject_to_handler (PTPParams* params, uint32_t handle, uint32_t offset,
uint32_t maxbytes, PTPDataHandler *handler)
{
PTPContainer ptp;
PTP_CNT_INIT(ptp, PTP_OC_GetPartialObject, handle, offset, maxbytes);
return ptp_transaction_new(params, &ptp, PTP_DP_GETDATA, 0, handler);
}
/**
* ptp_getthumb:
* params: PTPParams*

View File

@@ -2523,6 +2523,9 @@ uint16_t ptp_getobject_to_handler (PTPParams* params, uint32_t handle, PTPDataHa
uint16_t ptp_getpartialobject (PTPParams* params, uint32_t handle, uint32_t offset,
uint32_t maxbytes, unsigned char** object,
uint32_t *len);
uint16_t ptp_getpartialobject_to_handler (PTPParams* params, uint32_t handle, uint32_t offset,
uint32_t maxbytes, PTPDataHandler *handler);
uint16_t ptp_getthumb (PTPParams *params, uint32_t handle,
unsigned char** object, unsigned int *len);