DJI Windows SDK Documentation

class MediaTaskManager

sealed class MediaTaskManager
Declaration:DJI.WindowsSDK
Description:

MediaTaskManager provides methods for MediaTask.

Class Members:
enum MediaPhotoType
enum MediaPhotoType
Declaration:DJI.WindowsSDK
Description:

This flag indicate which photo type of this media file. Only valid when file type is JPEG, DNG See MediaFile .

Enum Members:
NORMALSample photo file with default type.
HDRPhoto file taked by camera with High Dynamic Range(HDR) setting.
AEBPhoto file taked by camera with Automatic Exposure Bracketing(AEB) setting.
INTERVALPhoto file taked by camera with time interval setting.
BURSTPhoto file taked by camera with burst setting.
UNKNOWNThis enumerate use for system error, should not use by developer.
enum MediaVideoType
enum MediaVideoType
Declaration:DJI.WindowsSDK
Description:

This flag indicate which video type of this media file. Only valid when file type is MOV, MP4 See MediaFile .

Enum Members:
NORMALSample video file with default type.
SLOW_MOTIONVideo file taked by camera with slow motion setting.
FAST_MOTIONVideo file taked by camera with fast motion setting.
TIME_LAPSEVideo file taked by camera with time lapse setting.
HDRVideo file taked by camera with High Dynamic Range(HDR) setting.
UNKNOWNThis enumerate use for system error, should not use by developer.
enum MediaFileStarTag
enum MediaFileStarTag
Declaration:DJI.WindowsSDK
Description:

This flag indicate whether this media file is tagged star/favorite/like. See MediaFile .

Enum Members:
NONEThis flag indicate this media file is not tagged star/favorite/like.
TAGGEDThis flag indicate this media file is tagged star/favorite/like.
UNKNOWNThis enumerate use for system error, should not use by developer.
enum MediaRequestType
enum MediaRequestType
Declaration:DJI.WindowsSDK
Description:

This flag indicate type of file transfer request. See MediaFileDownloadRequest.

Enum Members:
ORIGINThis flag indicate this request want to get origin file data.
THUMBNAILThis flag indicate this request want to get thumbnail file data. Thumbnail is the smallest size picture of photo or video first frame.
SCREENThis flag indicate this request want to get screen(preview) file data. Screen is the smaller size picture of photo or video first frame.
CLIPThis flag indicate this request want to get partial file data. Only valid when file is video.
STREAMThis flag indicate this request want to transfer with stream.
PANOThis flag indicate this request want to get origin panorama file data. Only valid when file is panorama.
PANOSCREENNAILThis flag indicate this request want to get screen panorama file data. Only valid when file is panorama.
PANOTHUMBNAILThis flag indicate this request want to get thumbnail panorama file data. Only valid when file is panorama.
UNKNOWNThis enumerate use for system error, should not use by developer.
enum MediaFileListLocation
enum MediaFileListLocation
Declaration:DJI.WindowsSDK
Description:

Where the media file locate, some device has multiple storage location.

Enum Members:
SD_CARDThe media file location at default SD Card.
INTERNAL_STORAGEThe media file location at Embedded Multi Media Card(EMMC).
EXTENDED_SD_CARDThe media file location at external SD Card.
UNKNOWNThis enumerate use for system error, should not use by developer.
struct MediaFileListLocationMsg
struct MediaFileListLocationMsg
Declaration:DJI.WindowsSDK
Description:

Object for query stroage location.

Struct Members:
MediaFileListLocation locationEnumerate for query stroage location. See MediaFileListLocation
enum MediaTaskType
enum MediaTaskType
Declaration:DJI.WindowsSDK
Description:

The media task type. using in MediaTaskRequest and MediaTaskResponse

Enum Members:
FILE_DATAIn MediaTaskRequest indicate transfer MediaFileDownloadRequest first. In MediaTaskResponse indicate this response from MediaFileDownloadRequest.
FILE_LISTIn MediaTaskRequest indicate transfer MediaFileListRequest first. In MediaTaskResponse indicate this response from MediaFileListRequest.
UNKNOWNThis enumerate use for system error, should not use by developer.
enum MediaTaskDuplicate
enum MediaTaskDuplicate
Declaration:DJI.WindowsSDK
Description:

The flag for control the effect to duplicate request waiting tasks when PushFront/PushBack and task finished

Enum Members:
NONEWhen this task push in or successed, do nothing with other tasks.
ENQUEUE_WITH_CANCELWhen this task push in, cancel other tasks both executing and waiting.
DEQUEUE_WITH_COMPLETEWhen this task successful complete, complete other tasks in waiting queue. It will make some task complete even not actually begin executing.
UNKNOWNThis enumerate use for system error, should not use by developer.
enum MediaTaskDefer
enum MediaTaskDefer
Declaration:DJI.WindowsSDK
Description:

The flag for control how to deal with this task, when DeferExecuteTask apply on it.

Enum Members:
BACK_TO_QUEUEWhen DeferExecuteTask perform on this task, it will be save context and back to the front of waiting queue. The event you register on it will pause until it execute again, but not invoke any err code, so you will not receive the teardown event.
ABORTWhen DeferExecuteTask perform on this task, it will be abort directly and invoke err code "kErrorMediaTaskAbort" and imediately receive the teardown event.
UNKNOWNThis enumerate use for system error, should not use by developer.
enum MediaTaskPriority
enum MediaTaskPriority
Declaration:DJI.WindowsSDK
Description:

The flag for control execute sequence. Final execute task will be decided by postion in waiting queue and priority. Manager will loop tasks from front to back to pick up the first highest priority tasks. If you want guarantee a task execute next, task should be pushfront with high priority.

Enum Members:
DEFAULTExecute task with default priority, same mean as low.
MIDDLEExecute task with middle priority.
HIGHExecute task with high priority.
UNKNOWNThis enumerate use for system error, should not use by developer.
struct
struct MediaFile
struct MediaFile
Declaration:DJI.WindowsSDK
Description:

MediaFile represent a file storage in SD-Card or EMMC.

Struct Members:
bool validThis flag indicate whether the file is valid.
bool isManualGroupFileThis flag indicate whether the file is grouped by SDK. If flag is ture, you can read sub files in subMediaFile
int fileIndexThis indicates index of this file.
MediaFileType fileTypeThis indicates type of this file.
String fileNameThis indicates name of this file.
Int64 fileSizeThis indicates size of this file.
DateTime dateThis indicates stroage date of this file.
MediaFileStarTag starTagThis indicates whether this file tagged star/favorite/like.
double durationThis indicates video duration of this file.
CameraOrientation orientationThis indicates video orientation of this file.
VideoFrameRate frameRateThis indicates video frame rate of this file.
VideoResolution resolutionThis indicates video resolution of this file.
MediaVideoType videoTypeThis indicates video type of this file.
MediaPhotoType photoTypeThis indicates photo type of this file.
CameraPanoType panoTypeThis indicates panorama type of this file.
int videoSpeedRatioThis indicates video speed ratio of this file.
int panoCountThis indicates panorama include photo count of this file.
int guidThis indicates video global id of this file.
int fileGroupIndexThis indicates file group index of this file. File can be grouped by both camera and SDK. See bool isManualGroupFile
int subIndexThis indicates sub index of this file. Sub index will use in panorama file.
int segSubIndexThis indicates sub segment index of this file. Sub segment index will use for video cliped by storage system. Cause FAT32 system can only storage file less than 4GB, most 4K video will be separated by it.
int timeLapseIntervalThis indicates time lapse shoot interval unit of this file. Each unit represent 100ms.
FileExifInfo EXIFInfoThis indicates Exchangeable image file format(EXIF) information of this file. See FileExifInfo.
PhotoRatio photoRatioThis indicates photo ratio of this file.
struct MediaFileDownloadRequest
struct MediaFileDownloadRequest
Declaration:DJI.WindowsSDK
Description:

Request for download file data. It can be used in MediaTaskRequest

Struct Members:
int indexDownload index of file, it can be obtained from media file. See MediaFile
int countDownload count represent how many files should be download from index. Mostly it should be 1 indicate only download index file itself. See MediaFile
Int64 offSetDownload offset represent download index file begin with which byte. Mostly it should be 0 indicate download from file begin. See MediaFile
int dataSizeDownload data size represent how many bytes the index file should be download from offset. Mostly it should be -1 indicate download to file end. See MediaFile
MediaRequestType typeDownload type of file. See MediaRequestType
int subIndexDownload sub index of file, it can be obtained from media file. Mostly it should be 0 indicate this file not contains sub file. See MediaFile
int segSubIndexDownload sub segment index of file, it can be obtained from media file. Mostly it should be 0 indicate this video not contains segment file. See MediaFile
struct MediaFileListRequest
struct MediaFileListRequest
Declaration:DJI.WindowsSDK
Description:

Request for download file list. It can be used in MediaTaskRequest

Struct Members:
int indexThis indicates request files from which index. Only valid when bool isAllList set false.
int countThis indicates request files count. Only valid when bool isAllList set false.
MediaFileListLocation locationThis indicates request files from which stroage. See MediaFileListLocation.
MediaRequestType subTypeThis indicates request files from which stroage. See MediaFileListLocation.
bool isAllListThis indicates request all files. Set ture will ignore int index and int count.
struct MediaFileList
struct MediaFileList
Declaration:DJI.WindowsSDK
Description:

Response for download file list. See MediaFileListRequest.

Struct Members:
MediaFileListLocation locationThis indicates where the files storage in.
bool hasInvalidFileThis indicates whether the files missed when transfer from hardware to SDK.
struct MediaStarTagRequest
struct MediaStarTagRequest
Declaration:DJI.WindowsSDK
Description:

Request for taging file star/favorite/like in camera.

Struct Members:
MediaFileListLocation locationThis indcates where the files locate.
MediaFileStarTag starTagThis indcates whether the files tag on or off.
struct MediaDeletionRequest
struct MediaDeletionRequest
Declaration:DJI.WindowsSDK
Description:

Request for taging file star/favorite/like in camera.

Struct Members:
MediaFileListLocation locationThis indcates where the files locate.
bool isDeleteAllThis indcates delete all files on storage.
struct MediaBatchFileRequestResult
struct MediaBatchFileRequestResult
Declaration:DJI.WindowsSDK
Description:

Response for taging file star/favorite/like or delete. See MediaStarTagRequest or MediaDeletionRequest

Struct Members:
bool allSucceededThis indcates whether this action successed on every file.
struct MediaTaskRequest
struct MediaTaskRequest
Declaration:DJI.WindowsSDK
Description:

Request object of task. Use it to construct MediaTask

Struct Members:
MediaTaskType typeThe flag control how to transfer request. See MediaTaskType
MediaTaskDuplicate duplicateTypeThe flag control how to deal with requests with duplicate information. See MediaTaskDuplicate
MediaTaskDefer deferTypeThe flag control how to apply defer action on this task. See MediaTaskDefer
MediaTaskPriority priorityThe flag control execute sequence when add task in manager waiting queue. See MediaTaskPriority
struct MediaTaskResponse
struct MediaTaskResponse
Declaration:DJI.WindowsSDK
Description:

Response object of task execute event. All event decomposed from task response.

Struct Members:
MediaTaskType typeThe flag indicate which type of request invoke this response. See MediaTaskType
MediaFileListRequest listReqResponse is invoked by this request. Only valid when type is FILE_LIST See MediaFileListRequest.
MediaFileDownloadRequest dataReqResponse is invoked by this request. Only valid when type is FILE_DATA See MediaFileDownloadRequest.
bool requestClearHave all requests in this task already transfered.
int listLeftHow many MediaFileListRequest left in this task.
int dataLeftHow many MediaFileDownloadRequest left in this task.
MediaFileList fileListFile result from MediaFileListRequest. Only valid when type is FILE_LIST See MediaFileList.
Int64 bitSpeedSpeed result from MediaFileDownloadRequest. Only valid when type is FILE_DATA
struct FileExifInfo
struct FileExifInfo
Declaration:DJI.WindowsSDK
Description:

Exchangeable image file format(EXIF) information. Use in MediaFile.

Struct Members:
bool focalLength35mmFormatEnabledFlag indicates having valid int focalLength35mmFormat.
bool lightSourceEnabledFlag indicates having valid int lightSource.
bool meteringModeEnabledFlag indicates having valid int meteringMode.
bool exposureCompensationEnabledFlag indicates having valid String exposureCompensationText.
bool isoEnabledFlag indicates having valid int iso.
bool exposureProgramEnabledFlag indicates having valid int exposureProgram.
bool fNumberEnabledFlag indicates having valid String apertureText.
bool exposureTimeEnabledFlag indicates having valid String shutterSpeedText.
int exposureProgramInt value of exposure program.
int isoInt value of iso.
int meteringModeInt value of metering mode.
int lightSourceInt value of light source.
int focalLength35mmFormatInt value of focal length 35mm format.
String shutterSpeedTextExposure time text with format like +3.5.
String apertureTextF number text with format like +3.5.
String exposureCompensationTextExposure Compensation text with format like +3.5.

Construct

Methods
method
method MediaTaskManager
MediaTaskManager(uint productId, uint cameraIndex)
Declaration:DJI.WindowsSDK
Description:

Construct a task manager with MediaTaskRequest.

Input Parameters:
uint productIdWhich product that manager should access. Mostly should be use 0.
uint cameraIndexWhich camera that manager should access. If hardware only have one camera, here should be use 0.


Field

property
property Suspend
bool Suspend { get; set; }
Declaration:DJI.WindowsSDK
Description:

Flag to control the waiting task queue. After executing task complete, manager will check this flag to decide should begin next task. Attention set this flag will not effect current executing task. If you want pause task completely(both queue and data transfer), You should set this flag "True" first and call "DeferEexecuteTask". See DeferExecuteTask.

See Also:

Suspend

unknown
unknown
uint ProductId => productId
Declaration:DJI.WindowsSDK
Description:

ProductId passed by construct.

unknown
unknown
uint CameraIndex => cameraIndex
Declaration:DJI.WindowsSDK
Description:

CameraIndex passed by construct.


Action

Methods
method
method PushFront
void PushFront(MediaTask task)
Declaration:DJI.WindowsSDK
Description:

Push a task to the front of the wait queue. This action will check task request parameter "duplicateType" to decide how to deal with the same infomation task. See MediaTaskRequest.

Input Parameters:
MediaTask taskTask will action on. See MediaTask.
method
method PushBack
void PushBack(MediaTask task)
Declaration:DJI.WindowsSDK
Description:

Push a task to the back of the wait queue. This action will check task request parameter "duplicateType" to decide how to deal with the same infomation task. See MediaTaskRequest.

Input Parameters:
MediaTask taskTask will action on. See MediaTask
method DeferExecuteTask
void DeferExecuteTask()
Declaration:DJI.WindowsSDK
Description:

Discard or backward current executing task to wait queue. This action will check executing task request parameter "deferType" to decide how to deal with it.See MediaTaskRequest. If deferType is "BACK_TO_QUEUE" , this action will postpone executing task event invoke. Otherwise deferType is "ABORT", this action will complete current task with error code "kErrorMediaTaskAbort".

method
method TrySync
async Task<SDKError> TrySync(MediaTask task)
Declaration:DJI.WindowsSDK
Description:

Try to synchronize a task with duplicate request infomation. See MediaTaskRequest. If neither executing task nor waiting task have the duplicate request infomation, this action will return error code "kErrorMediaTaskSyncFailure". If this action successful attach to a eixst task, the parameter task's event will invoke simultaneously with eixst task.

Input Parameters:
MediaTask taskTask will compare to those tasks already pushed. See MediaTask.
Return:
async Task<SDKError>Action error code, 0 define as no error.
method TaskCancel
async Task<SDKError>Cancel(MediaTask task)
Declaration:DJI.WindowsSDK
Description:

Cancel task with duplicate request infomation, only effect executing and waiting tasks once in manager.

Input Parameters:
MediaTask taskTask will compare to those tasks already pushed. See MediaTask.
Return:
asyncAction error code, 0 define as no error.
method TaskCancelAllTask
async Task<SDKError>CancelAllTask()
Declaration:DJI.WindowsSDK
Description:

Cancel all task ever pushed in manager.

Return:
asyncAction error code, 0 define as no error.