Contents Transfer¶
GetDateFolderList¶
- Overview
Gets date folder list from the device specified by the deviceHandle.
This function is the first function to call when pulling out the content in the camera.
- Definition
CrError GetDateFolderList(CrDeviceHandle deviceHandle, CrMtpFolderInfo** folders, CrInt32u* numOfFolders);
Input parameters
Type |
Explanation |
|---|---|
CrDeviceHandle |
deviceHandle |
Output parameters
Type |
Explanation |
|---|---|
CrMtpFolderInfo** |
folders
The date folder list pointer. Developers should pass the address of a modifiable CrMtpFolderInfo pointer. The value of this pointer should be initialized to nullptr.
The function will make a copy of the SDK-internal date folder list for the indicated deviceHandle. When function returns successfully, this parameter will point to the copy of date folder list.
The date folder list in the SDK is created by retrieving data from the camera only when the developer calls this function. Therefore, it may take some time to return to the first function call. This can be especially time consuming if you have a large number of date folders.
|
CrInt32u* |
numOfFolders
A pointer to an integer which indicates the number of CrMtpFolderInfo objects in the date folder list.
App developers should pass the address of a modifiable CrInt32 variable. This function will write the size of the returned list to the variable.
|
Return value
Type |
Explanation |
|---|---|
CrError |
CrError_None on Success
However, in the case of blank media, CrError_None is returned but numOfFolders becomes zero, so it is necessary to check numOfFolders at the same time.
CrError_Contents_RejectRequest Returned during the content transfer process. When the content transfer process is completed, re-execute this function.
Other than errors above, see Status code & Error
|
- Related API
- Special note (details)
The date folder information that can be obtained with this API is the handle and folderName in the yellow frame in the figure below.
Fig. If the media has 3 date folders and 4 contents
See Pull out content stored on media in ContentsTransferMode for how to use this API function
GetContentsHandleList¶
- Overview
Gets a handle list of the contents in the date folder specified by folderHandle.
- Definition
CrError GetContentsHandleList(CrDeviceHandle deviceHandle, CrFolderHandle folderHandle, CrContentHandle** contentsHandles, CrInt32u* numOfContents);
Input parameters
Type |
Explanation |
|---|---|
CrDeviceHandle |
deviceHandle |
CrFolderHandle |
folderHandle
Specifies one of the date folder handles obtained by the GetDateFolderList function.
|
Output parameters
Type |
Explanation |
|---|---|
CrContentHandle** |
contentsHandles
The content handle list pointer. Developers should pass the address of a modifiable CrContentHandle pointer. The value of this pointer should be initialized to nullptr.
The function will make a copy of the SDK-internal content handle list for the indicated deviceHandle. When function returns successfully, this parameter will point to the copy of content handle list.
The content handle list in the SDK is created by retrieving data from the camera only when the developer calls this function. Therefore, it may take some time to return to the first function call. This can be especially time consuming if you have a large number of content.
|
CrInt32u* |
numOfContents
A pointer to an integer which indicates the number of content in the date folder.
App developers should pass the address of a modifiable CrInt32 variable. This function will write the size of the returned list to the variable.
|
Return value
Type |
Explanation |
|---|---|
CrError |
CrError_None on Success
CrError_Contents_RejectRequest Returned during the content transfer process. When the content transfer process is completed, re-execute this function.
Other than errors above, see Status code & Error
|
- Related API
- Special note (details)
For the folderHandle of this API, use one of the date folder handles obtained by GetDateFolderList. Specify handle of blue frame for the folderHandle parameter of this API, you can get the two handles in the yellow frame.
Fig. If the media has 3 date folders and 4 contents
See Pull out content stored on media in ContentsTransferMode for how to use this API function
GetContentsDetailInfo¶
- Overview
Gets a content detail information of the contents specified by contentHandle.
- Definition
CrError GetContentsDetailInfo(CrDeviceHandle deviceHandle, CrContentHandle contentHandle, CrMtpContentsInfo* contentsInfo);
Input parameters
Type |
Explanation |
|---|---|
CrDeviceHandle |
deviceHandle |
CrContentHandle |
contentHandle
Specifies one of the content handles obtained by the GetContentsHandleList function.
|
Output parameters
Type |
Explanation |
|---|---|
CrMtpContentsInfo* |
contentsInfo
The content detail information pointer. Developers should pass the address of a modifiable CrMtpContentsInfo pointer. The value of this pointer should be initialized to nullptr.
The function will make a copy of the SDK-internal content detail information for the indicated deviceHandle. When function returns successfully, this parameter will point to the copy of content detail information.
The content detail information in the SDK is created by retrieving data from the camera only when the developer calls this function. Therefore, it may take some time to return to the first function call.
|
Return value
Type |
Explanation |
|---|---|
CrError |
CrError_None on Success
CrError_Contents_InvalidHandle If the content handle specified is invalid
CrError_Contents_RejectRequest Returned during the content transfer process. When the content transfer process is completed, re-execute this function.
Other than errors above, see Status code & Error
|
- Related API
- Special note (details)
For the contentHandle of this API, use one of the content handles obtained by GetContentsHandleList.
You can get the details of the yellow frame by specifying the handle of the blue frame for the contentHandle parameter of this API.
Fig. If the media has 3 date folders and 4 contents
See Pull out content stored on media in ContentsTransferMode for how to use this API function
ReleaseDateFolderList¶
- Overview
This function releases the CrMtpFolderInfo allocated by GetDateFolderList.
It is not necessary to call this API when zero is returned in the number of folders in GetDateFolderList. Use this API when the number of folders is one or more.
- Definition
CrError ReleaseDateFolderList(CrDeviceHandle deviceHandle, CrMtpFolderInfo* folders);
Input parameters
Type |
Explanation |
|---|---|
CrDeviceHandle |
deviceHandle |
CrMtpFolderInfo* |
folders
Date folder list pointer to release.
|
- Output parameters
None
Return value
Type |
Explanation |
|---|---|
CrError |
CrError_None If the date folder list is released successfully
CrError_Init if the SDK is uninitialized
CrError_Generic_InvalidHandle If the deviceHandle is an invalid handle
Other than errors above, see Status code & Error
|
- Related API
- Special note (details)
None in particular
ReleaseContentsHandleList¶
- Overview
This function releases the CrContentHandle array allocated by GetContentsHandleList.
- Definition
CrError ReleaseContentsHandleList(CrDeviceHandle deviceHandle, CrContentHandle* contentsHandles);
Input parameters
Type |
Explanation |
|---|---|
CrDeviceHandle |
deviceHandle |
CrContentHandle* |
contentsHandles
Content handle list pointer to release.
|
- Output parameters
None
Return value
Type |
Explanation |
|---|---|
CrError |
CrError_None If the content handle list is released successfully
CrError_Init if the SDK is uninitialized
CrError_Generic_InvalidHandle If the deviceHandle is an invalid handle
Other than errors above, see Status code & Error
|
- Related API
- Special note (details)
None in particular
PullContentsFile¶
- Overview
Pull contents from the camera. Save a copy of the content file on your host PC.
- Definition
CrError PullContentsFile(CrDeviceHandle deviceHandle, CrContentHandle contentHandle, CrPropertyStillImageTransSize size = CrPropertyStillImageTransSize_Original, CrChar* path = 0, CrChar* fileName = 0);
Input parameters
Type |
Explanation |
|---|---|
CrDeviceHandle |
deviceHandle |
CrContentHandle |
contentHandle
Specifies one of the content handles obtained by the GetContentsHandleList function.
Only content whose details have been obtained using the GetContentsDetailInfo function can be specified.
|
CrPropertyStillImageTransSize |
size
Specify the size of the still image to be acquired.
Specify either
When CrPropertyStillImageTransSize_SmallSize is specified
You can get a small size image according to the type of still image. JPEG format for JPEG content and HEIF format for HEIF content.
If CrDeviceProperty_FileType at the time of shooting is CrFileType_RawJpeg, it will be in JPEG format, and if it is CrFileType_RawHeif, it will be in HEIF format.
If you specify small for the movie, an error is returned.
|
CrChar* |
path
This parameter is optional.
If not specified, the path specified in the second parameter of SetSaveInfo will be used. To do this, use SetSaveInfo to change the save destination path in advance. If a path that does not exist in this parameter is specified, or if this parameter is not specified and SetSaveInfo is not used, normal operation of content transfer cannot be guaranteed.
|
CrChar* |
fileName
This parameter is optional.
If not specified, the content will be saved with the file name.
If the file name conflicts with an existing file, an additional number is appended after the file name like DSC01234(1).JPG.
|
- Output parameters
None
Return value
Type |
Explanation |
|---|---|
CrError |
CrError_None on Success
CrError_Contents_RejectRequest If content cannot be transferred
CrError_Generic_NotSupported
CrPropertyStillImageTransSize_SmallSize specified for movie content
CrError_File_StorageFull Insufficient storage capacity on the host
Other than errors above, see Status code & Error
|
- Related API
- Special note (details)
This API cannot guarantee the transfer of content taken with other cameras.
Large files may not be handled depending on the OS.
GetContentsThumbnailImage¶
- Overview
Get thumbnail image data.
- Definition
CrError GetContentsThumbnailImage(CrDeviceHandle deviceHandle, CrContentHandle contentHandle, CrImageDataBlock* imageData, CrFileType* fileType);
Input parameters
Type |
Explanation |
|---|---|
CrDeviceHandle |
deviceHandle |
CrContentHandle |
contentHandle
Specifies one of the content handles obtained by the GetContentsHandleList function.
Only content whose details have been obtained using the GetContentsDetailInfo function can be specified.
|
Output parameters
Type |
Explanation |
|---|---|
CrImageDataBlock* |
imageData
This parameter points to an CrImageDataBlock object which is a memory buffer for storing the image data.
JPEG image data of 160 x 120 pixels is set in the pointer.
The usage of the CrImageDataBlock class is the same as the GetLiveViewImage function. See LiveView for the size of the buffer to prepare in advance.
|
CrFileType* |
fileType
A type that means the format of a thumbnail image.
Developers should pass the address of a modifiable CrFileType variable.
Thumbnail images of JPEG content, RAW content, and movie content are in JPEG format.
Thumbnail images of HEIF content are in HEIF format.
Caution:
For ILCE-1 and ILCE-7SM3 only, the thumbnail image of the RAW content when CrDeviceProperty_FileType is set to CrFileType_RawHeif will be in HEIF format.
|
Return value
Type |
Explanation |
|---|---|
CrError |
CrError_None on Success
CrError_Contents_RejectRequest When content is being transferred or thumbnail image data cannot be obtained
Other than errors above, see Status code & Error
|
- Related API
- Special note (details)
None in particular