class FetchMediaTaskScheduler |
Package: | dji.sdk.media |
The camera stores the media it captures to SD or SSD storage on the product. When the mobile device wants to access the media, it needs to download it from the product over the wireless link between the product, remote controller and mobile device (depending on the product). Each media file captured by the camera can have several types of content associated with it including the full resolution media content, a lower resolution preview, a lower resolution again thumbnail, and custom data within the file's XML meta data. The full resolution content can take a long time to download over the wireless link, so it is often useful to download previews or thumbnails of many media files, and then only download the full resolution content of fewer select media files. This scheduler conveniently allows the small content types of media files (preview, thumbnail and custom data) to be downloaded to the mobile device. The scheduler can be used to queue and download content from a series of files, as well as used to re-prioritize files during the download process. The scheduler holds a list of pending tasks and it completes them one by one in first-in-first-out order. To prioritize a new task, moveTaskToNext
can be used. Each task relates to a media file and can download multiple content types sequentially. When the last content type of a task starts being downloaded, the task is removed from the list. Note, the scheduler cannot be used to queue the download of full resolution media content. Only fetchFileData
can be used for this.
FetchMediaTaskSchedulerState getState() |
Package: | dji.sdk.media |
State of the scheduler.
FetchMediaTaskSchedulerState | An enum value of FetchMediaTaskSchedulerState . |
List<FetchMediaTask> getPendingTasks() |
Package: | dji.sdk.media |
Gets a copy of the pending tasks.
List<FetchMediaTask> | A list of FetchMediaTask objects. |
void moveTaskToEnd(FetchMediaTask task) |
Package: | dji.sdk.media |
Pushes a task to the back of the queue. The task will be executed after all other tasks are complete.
FetchMediaTask task | Task to schedule. |
void moveTaskToNext(FetchMediaTask task) |
Package: | dji.sdk.media |
Pushes a task to the front of the queue. The task will be executed after the executing task is complete.
FetchMediaTask task | Task to schedule. |
void removeTask(MediaFile file, FetchMediaTaskContent content) |
Package: | dji.sdk.media |
Remove content from tasks, and tasks from the scheduler. If all content is removed from a task, then the task is removed from the scheduler.
MediaFile file | An object of MediaFile . |
FetchMediaTaskContent content | An enum value of FetchMediaTaskContent . |
void removeAllTasks() |
Package: | dji.sdk.media |
Removes all the pending tasks.
void suspend(CompletionCallback callback) |
Package: | dji.sdk.media |
Suspends the scheduler. The scheduler will not continue to execute tasks in the queue.
CompletionCallback callback | The completion callback with the returned execution result. |
void resume(CompletionCallback callback) |
Package: | dji.sdk.media |
Resumes the scheduler. The scheduler will execute tasks in the queue sequentially.
CompletionCallback callback | The completion callback with the returned execution result. |
boolean isSuspendAfterSingleFetchTaskFailure() |
Package: | dji.sdk.media |
Determines whether suspend the scheduler when an error occurs during the execution.
boolean | A boolean value. |
void setSuspendAfterSingleFetchTaskFailure(boolean suspendAfterSingleFetchTaskFailure) |
Package: | dji.sdk.media |
Sets if suspend the scheduler when an error occurs during the execution.
boolean suspendAfterSingleFetchTaskFailure | A boolean value. |
enum FetchMediaTaskSchedulerState |
Package: | dji.sdk.media |
States of the fetch media file task scheduler FetchMediaTaskScheduler
.
IDLE | Scheduler is waiting for tasks. |
EXECUTING | Scheduler is executing tasks. |
SUSPENDED | Scheduler is suspended. Use resume to resume the scheduler. |
UNKNOWN | Unknown. |
{{searchCount}} Results