moved eos bulb fixes from 2.4 branch to here
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12726 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
@@ -3627,9 +3627,9 @@ _put_Canon_EOS_Bulb(CONFIG_PUT_ARGS)
|
||||
if (ret != GP_OK)
|
||||
return ret;
|
||||
if (val)
|
||||
ret = ptp_canon_eos_bulbstart (params);
|
||||
ret = ptp_canon_eos_bulbstart (params, 1);
|
||||
else
|
||||
ret = ptp_canon_eos_bulbend (params);
|
||||
ret = ptp_canon_eos_bulbend (params, 1);
|
||||
if (ret == PTP_RC_OK)
|
||||
return (GP_OK);
|
||||
if (val && (ret == PTP_RC_GeneralError))
|
||||
|
||||
@@ -711,6 +711,56 @@ ptp_getnumobjects (PTPParams* params, uint32_t storage,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* ptp_eos_bulbstart:
|
||||
* params: PTPParams*
|
||||
* val - uint16_t unknown argument (1)
|
||||
*
|
||||
* Starts EOS Bulb capture.
|
||||
*
|
||||
* Return values: Some PTP_RC_* code.
|
||||
**/
|
||||
uint16_t
|
||||
ptp_canon_eos_bulbstart (PTPParams* params, uint16_t val)
|
||||
{
|
||||
uint16_t ret;
|
||||
PTPContainer ptp;
|
||||
|
||||
PTP_CNT_INIT(ptp);
|
||||
ptp.Code = PTP_OC_CANON_EOS_BulbStart;
|
||||
ptp.Nparam = 1;
|
||||
ptp.Param1 = val;
|
||||
ret = ptp_transaction(params, &ptp, PTP_DP_NODATA, 0, NULL, NULL);
|
||||
if ((ret == PTP_RC_OK) && (ptp.Nparam >= 1) && ((ptp.Param1 & 0x7000) == 0x2000))
|
||||
ret = ptp.Param1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* ptp_canon_eos_bulbend:
|
||||
* params: PTPParams*
|
||||
* val - uint16_t unknown argument (1)
|
||||
*
|
||||
* Starts EOS Bulb capture.
|
||||
*
|
||||
* Return values: Some PTP_RC_* code.
|
||||
**/
|
||||
uint16_t
|
||||
ptp_canon_eos_bulbend (PTPParams* params, uint16_t val)
|
||||
{
|
||||
uint16_t ret;
|
||||
PTPContainer ptp;
|
||||
|
||||
PTP_CNT_INIT(ptp);
|
||||
ptp.Code = PTP_OC_CANON_EOS_BulbEnd;
|
||||
ptp.Nparam = 1;
|
||||
ptp.Param1 = val;
|
||||
ret = ptp_transaction(params, &ptp, PTP_DP_NODATA, 0, NULL, NULL);
|
||||
if ((ret == PTP_RC_OK) && (ptp.Nparam >= 1) && ((ptp.Param1 & 0x7000) == 0x2000))
|
||||
ret = ptp.Param1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* ptp_getobjectinfo:
|
||||
* params: PTPParams*
|
||||
|
||||
@@ -2417,8 +2417,8 @@ uint16_t ptp_canon_eos_setdevicepropvalueex (PTPParams* params, unsigned char* d
|
||||
#define ptp_canon_eos_transfercomplete(params,oid) ptp_generic_no_data(params,PTP_OC_CANON_EOS_TransferComplete,1,oid)
|
||||
/* inHDD = %d, inLength =%d, inReset = %d */
|
||||
#define ptp_canon_eos_pchddcapacity(params,p1,p2,p3) ptp_generic_no_data(params,PTP_OC_CANON_EOS_PCHDDCapacity,3,p1,p2,p3)
|
||||
#define ptp_canon_eos_bulbstart(params) ptp_generic_no_data(params,PTP_OC_CANON_EOS_BulbStart,1)
|
||||
#define ptp_canon_eos_bulbend(params) ptp_generic_no_data(params,PTP_OC_CANON_EOS_BulbEnd,1)
|
||||
uint16_t ptp_canon_eos_bulbstart (PTPParams* params, uint16_t val);
|
||||
uint16_t ptp_canon_eos_bulbend (PTPParams* params, uint16_t val);
|
||||
uint16_t ptp_canon_eos_getdevicepropdesc (PTPParams* params, uint16_t propcode,
|
||||
PTPDevicePropDesc *devicepropertydesc);
|
||||
uint16_t ptp_canon_eos_setdevicepropvalue (PTPParams* params, uint16_t propcode,
|
||||
|
||||
Reference in New Issue
Block a user