
Copyright © 2006-2009 Canon Inc.
Canon EOS Digital SDK
EDSDK2.6 API
Programming Reference
04/22/2009

EDSDK API Programming Reference
ID
Page
i
Copyright © 2006-2009 Canon Inc.
History
Version Date
Revised
page(s)
Reason and content of revision Reviser
1.0 9/14/2006 First release
2.0 5/28/2007
・ Added support for Windows Vista.
・ Added support for the EOS-1D Mark III.
・ Added operations and properties related to PC live
view (only for supported models).
Objects
EdsEvfImageRef
API.
EdsCreateEvfImageRef
EdsDownloadEvfImage
Commands
kEdsCameraCommand_DriveLensEvf
kEdsCameraCommand_DoClickWBEvf
Properties
kEdsPropID_Evf_OutputDevice
kEdsPropID_Evf_Mode
kEdsPropID_Evf_WhiteBalance
kEdsPropID_Evf_ColorTemperature
kEdsPropID_Evf_DepthOfFieldPreview
kEdsPropID_Evf_Sharpness
kEdsPropID_Evf_ClickWBCoeffs
kEdsPropID_Evf_Zoom
kEdsPropID_Evf_ZoomPosition
kEdsPropID_Evf_Histogram
kEdsPropID_Evf_ImagePosition
kEdsPropID_Evf_HistogramStatus
・ Added commands and events for bulb shooting
(only for supported models).
Commands
kEdsCameraCommand_BulbStart
kEdsCameraCommand_BulbEnd
Events
kEdsStateEvent_BulbExposureTime
・ Changed shooting error codes.
・ Changed the data type of KPropID_ImageQuality.
・ Added properties for getting GPS information from
image files.
kEdsPropID_GPSVersionID
kEdsPropID_GPSLatitudeRef
kEdsPropID_GPSLatitude
kEdsPropID_GPSLongitudeRef
kEdsPropID_GPSLongitude
kEdsPropID_GPSAltitudeRef
kEdsPropID_GPSAltitude
kEdsPropID_GPSTimeStamp
kEdsPropID_GPSSatellites
kEdsPropID_GPSMapDatum
kEdsPropID_GPSDateStamp
2.1 8/30/2007
・ Added support for the EOS 40D.
・ Changed the target object supporting ImageQuality
property to be a camera object only.
・
2.2 11/12/2007
・ Added support for the EOS-1Ds Mark III.
・ Added sample code for bulb shooting.
2.3 1/8/2008
・ Added support for the EOS DIGITAL REBEL Xsi/
EOS 450D/ EOS Kiss X2.

EDSDK API Programming Reference
ページ
ii
Revision History/Date Corrections Reviser Remarks
Copyright © 2006-2009 Canon Inc.
2.4 5/20/2008
・ Added support for the EOS DIGITAL REBEL XS/
EOS 1000D/ EOS Kiss F.
・ Added support for Mac OSX 10.5.
2.5 10/01/2008
・ Added support for the EOS 50D / EOS 5D Mark II
・ Added properties for getting GPS information from
image files.
kEdsPropID_GPSStatus
・ Added commands and properties related to PC live
view (only for supported models).
Commands
kEdsCameraCommand_ShutterButton
kEdsCameraCommand_DoAfEvf
Properties
kEdsPropID_Evf_AFMode
・ Added properties.
kEdsPropID_LensStatus
kEdsPropID_Artist
kEdsPropID_Copyright
・ Stopping support API and properties
API
EdsReflectImageProperty
Properties
kEdsPropID_Evf_ClickWBCoeffs
kEdsPropID_Evf_Sharpness
kEdsPropID_BracketValue
kEdsPropID_UserWhiteBalanceData
kEdsPropID_UserToneCurveData
kEdsPropID_UserPictureStyleData
kEdsPropID_UserManualWhiteBalanceData
kEdsPropID_PFn
2.5.1 12/9/2008
・ Revised the following properties.
kEdsPropID_Sharpness
kEdsPropID_ColorMatrix
kEdsPropID_ColorSaturation
kEdsPropID_Contrast
kEdsPropID_ColorTone
kEdsPropID_PhotoEffect
kEdsPropID_FilterEffect
kEdsPropID_ToningEffect
・
Revised table at Section 5.3(Support Status
for RAW Properties).
2.5.2 01/23/2009
Supports EOS 5D Mark II firmware Version 1.0.7 (for
the vertical banding noise phenomenon)
2.6 04/22/2009
・ Added support for the EOS Kiss X3/EOS REBEL
T1i /EOS 500D .
・
Remove the limit of the file size of ICC in
EdsSaveImage.

EDSDK API Programming Reference
ID
Page
iii
Revision History/Date Corrections Reviser Remarks
Copyright © 2006-2009 Canon Inc.
Table of Contents
1. INTRODUCTION ................................................................................................................................................7
1.1 Basic Topics............................................................................................................................................................. 7
1.2 Supported Environments .......................................................................................................................................... 8
1.2.1 Target Environment .......................................................................................................................................... 8
1.3 Supported Cameras .................................................................................................................................................. 8
1.4 Installing EDSDK .................................................................................................................................................... 8
1.4.1 Including Header Files ...................................................................................................................................... 8
1.4.2 Linking the Library ........................................................................................................................................... 9
1.4.3 Executing the EDSDK Client Application...................................................................................................... 10
2. OVERVIEW .......................................................................................................................................................11
2.1 Protocol for Remote Connection............................................................................................................................ 11
2.1.1 Type 1 (Legacy Protocol)................................................................................................................................ 11
2.1.2 Type 2 (PTP)................................................................................................................................................... 11
2.1.3 Support by Model............................................................................................................................................ 12
2.2 System Architecture ............................................................................................................................................... 13
2.3 Library Modules..................................................................................................................................................... 14
2.4 EDSDK Objects ..................................................................................................................................................... 15
2.5 Object Management ............................................................................................................................................... 17
2.5.1 Object Management Using a Reference Counter ............................................................................................ 17
2.5.2 Releasing Resources when Exiting the Library............................................................................................... 17
2.6 Properties................................................................................................................................................................ 18
2.7 Camera Status......................................................................................................................................................... 19
2.8 Asynchronous Events............................................................................................................................................. 21
2.9 Initializing and Terminating the Library ................................................................................................................ 23
2.10 Accessing a Camera ............................................................................................................................................. 24
2.11 Transferring Files in the Camera.......................................................................................................................... 26
2.12 Transferring Captured Images.............................................................................................................................. 27
2.13 Handling Image Objects....................................................................................................................................... 28
2.13.1 Overview....................................................................................................................................................... 28
2.13.2 Getting and Setting Properties....................................................................................................................... 28
2.14 Basic Data Type Definitions ................................................................................................................................ 30
2.15 EDSDK Errors...................................................................................................................................................... 30
3. API REFERENCE..............................................................................................................................................31
3.1 API Details ............................................................................................................................................................. 31
3.1.1 EdsInitializeSDK............................................................................................................................................. 32
3.1.2 EdsTerminateSDK .......................................................................................................................................... 32
3.1.3 EdsRetain ........................................................................................................................................................ 32
3.1.4 EdsRelease ...................................................................................................................................................... 33
3.1.5 EdsGetChildCount .......................................................................................................................................... 34
3.1.6 EdsGetChildAtIndex....................................................................................................................................... 34
3.1.7 EdsGetParent................................................................................................................................................... 35
3.1.8 EdsGetCameraList .......................................................................................................................................... 35
3.1.9 EdsGetDeviceInfo........................................................................................................................................... 36
3.1.10 EdsGetVolumeInfo ....................................................................................................................................... 37
3.1.11 EdsGetDirectoryItemInfo.............................................................................................................................. 38
3.1.12 EdsOpenSession............................................................................................................................................ 39
3.1.13 EdsCloseSession ........................................................................................................................................... 39
3.1.14 EdsSendCommand ........................................................................................................................................ 40
3.1.15 EdsSendStatusCommand .............................................................................................................................. 42
3.1.16 EdsSetCapacity ............................................................................................................................................. 43

EDSDK API Programming Reference
ID
Page
iv
Revision History/Date Corrections Reviser Remarks
Copyright © 2006-2009 Canon Inc.
3.1.17 EdsGetPropertySize ...................................................................................................................................... 43
3.1.18 EdsGetPropertyData...................................................................................................................................... 44
3.1.19 EdsSetPropertyData ...................................................................................................................................... 47
3.1.20 EdsGetPropertyDesc ..................................................................................................................................... 48
3.1.21 EdsDeleteDirectoryItem................................................................................................................................ 49
3.1.22 EdsFormatVolume ........................................................................................................................................ 50
3.1.23 EdsGetAttribute............................................................................................................................................. 50
3.1.24 EdsSetAttribute ............................................................................................................................................. 51
3.1.25 EdsDownload ................................................................................................................................................ 52
3.1.26 EdsDownloadComplete................................................................................................................................. 53
3.1.27 EdsDownloadCancel..................................................................................................................................... 53
3.1.28 EdsDownloadThumbnail............................................................................................................................... 54
3.1.29 EdsCreateEvfImageRef................................................................................................................................. 54
3.1.30 EdsDownloadEvfImage ................................................................................................................................ 55
3.1.31 EdsCreateFileStream..................................................................................................................................... 55
3.1.32 EdsCreateFileStreamEx ................................................................................................................................ 56
3.1.33 EdsCreateMemoryStream ............................................................................................................................. 57
3.1.34 EdsCreateMemoryStreamFromPointer ......................................................................................................... 58
3.1.35 EdsGetPointer ............................................................................................................................................... 58
3.1.36 EdsRead ........................................................................................................................................................ 59
3.1.37 EdsWrite........................................................................................................................................................ 60
3.1.38 EdsSeek......................................................................................................................................................... 60
3.1.39 EdsGetPosition.............................................................................................................................................. 61
3.1.40 EdsGetLength................................................................................................................................................ 62
3.1.41 EdsCopyData ................................................................................................................................................ 62
3.1.42 EdsCreateImageRef....................................................................................................................................... 63
3.1.43 EdsGetImageInfo .......................................................................................................................................... 63
3.1.44 EdsGetImage................................................................................................................................................. 64
3.1.45 EdsSaveImage............................................................................................................................................... 65
3.1.46 EdsCacheImage............................................................................................................................................. 66
3.1.47 EdsSetCameraAddedHandler........................................................................................................................ 67
3.1.48 EdsSetObjectEventHandler........................................................................................................................... 68
3.1.49 EdsSetPropertyEventHandler........................................................................................................................ 69
3.1.50 EdsSetCameraStateEventHandler ................................................................................................................. 71
3.1.51 EdsSetProgressCallback................................................................................................................................ 72
3.2 EDS Error Lists ...................................................................................................................................................... 74
3.2.1 General errors.................................................................................................................................................. 74
3.2.2 File access errors............................................................................................................................................. 74
3.2.3 Directory errors............................................................................................................................................... 74
3.2.4 Property errors................................................................................................................................................. 75
3.2.5 Function parameter errors ............................................................................................................................... 75
3.2.6 Device errors................................................................................................................................................... 75
3.2.7 Stream errors................................................................................................................................................... 75
3.2.8 Communication errors..................................................................................................................................... 76
3.2.9 Camera UI lock/unlock errors ......................................................................................................................... 76
3.2.10 STI/WIA errors ............................................................................................................................................. 76
3.2.11 Other general error ........................................................................................................................................ 76
3.2.12 PTP errors ..................................................................................................................................................... 76
3.2.13 TakePicture errors ......................................................................................................................................... 77
4. ASYNCHRONOUS EVENTS ...........................................................................................................................79
4.1 Event Lists.............................................................................................................................................................. 79
4.1.1 Object-related events....................................................................................................................................... 79
4.1.2 Property-related events.................................................................................................................................... 79
4.1.3 State-related events ......................................................................................................................................... 79
4.2 Event Details .......................................................................................................................................................... 80
评论0