DJI Mobile SDK Documentation

      class FetchMediaTaskScheduler

      class FetchMediaTaskScheduler
      Package:dji.sdk.media
      Description:

      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.

      Class Members:
      method
      method getState
      FetchMediaTaskSchedulerState getState()
      Package:dji.sdk.media
      Description:

      State of the scheduler.

      Return:
      FetchMediaTaskSchedulerStateAn enum value of FetchMediaTaskSchedulerState.
      method getPendingTasks
      List<FetchMediaTask> getPendingTasks()
      Package:dji.sdk.media
      Description:

      Gets a copy of the pending tasks.

      Return:
      List<FetchMediaTask>A list of FetchMediaTask objects.
      method moveTaskToEnd
      void moveTaskToEnd(FetchMediaTask task)
      Package:dji.sdk.media
      Description:

      Pushes a task to the back of the queue. The task will be executed after all other tasks are complete.

      Input Parameters:
      FetchMediaTask taskTask to schedule.
      method moveTaskToNext
      void moveTaskToNext(FetchMediaTask task)
      Package:dji.sdk.media
      Description:

      Pushes a task to the front of the queue. The task will be executed after the executing task is complete.

      Input Parameters:
      FetchMediaTask taskTask to schedule.
      method removeTask
      void removeTask(MediaFile file, FetchMediaTaskContent content)
      Package:dji.sdk.media
      Description:

      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.

      Input Parameters:
      MediaFile fileAn object of MediaFile.
      FetchMediaTaskContent contentAn enum value of FetchMediaTaskContent.
      method removeAllTasks
      void removeAllTasks()
      Package:dji.sdk.media
      Description:

      Removes all the pending tasks.

      method
      method suspend
      void suspend(CompletionCallback callback)
      Package:dji.sdk.media
      Description:

      Suspends the scheduler. The scheduler will not continue to execute tasks in the queue.

      Input Parameters:
      CompletionCallback callbackThe completion callback with the returned execution result.
      method
      method resume
      void resume(CompletionCallback callback)
      Package:dji.sdk.media
      Description:

      Resumes the scheduler. The scheduler will execute tasks in the queue sequentially.

      Input Parameters:
      CompletionCallback callbackThe completion callback with the returned execution result.
      method isSuspendAfterSingleFetchTaskFailure
      boolean isSuspendAfterSingleFetchTaskFailure()
      Package:dji.sdk.media
      Description:

      Determines whether suspend the scheduler when an error occurs during the execution.

      Return:
      booleanA boolean value.
      method setSuspendAfterSingleFetchTaskFailure
      void setSuspendAfterSingleFetchTaskFailure(boolean suspendAfterSingleFetchTaskFailure)
      Package:dji.sdk.media
      Description:

      Sets if suspend the scheduler when an error occurs during the execution.

      Input Parameters:
      boolean suspendAfterSingleFetchTaskFailureA boolean value.
      enum FetchMediaTaskSchedulerState
      enum FetchMediaTaskSchedulerState
      Package:dji.sdk.media
      Description:

      States of the fetch media file task scheduler FetchMediaTaskScheduler.

      Enum Members:
      IDLEScheduler is waiting for tasks.
      EXECUTINGScheduler is executing tasks.
      SUSPENDEDScheduler is suspended. Use resume to resume the scheduler.
      UNKNOWNUnknown.
      Class Members: