DJI Mobile SDK Documentation

      class DJIFetchMediaTaskScheduler

      @interface DJIFetchMediaTaskScheduler : NSObject
      Header:DJIFetchMediaTaskScheduler.h
      Inherits From:NSObject
      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 fetchFileDataWithOffset:updateQueue:updateBlock can be used for this.

      Class Members:
      property suspendAfterSingleFetchTaskFailure
      @property (atomic, readwrite) BOOL suspendAfterSingleFetchTaskFailure
      Header:DJIFetchMediaTaskScheduler.h
      Description:

      Set YES to suspend the scheduler when an error occurs during the execution.

      property
      property state
      @property (atomic, readonly) DJIFetchMediaTaskSchedulerState state
      Header:DJIFetchMediaTaskScheduler.h
      Description:

      State of the scheduler.

      See Also:

      DJIFetchMediaTaskSchedulerState

      method pendingTasks
      -(NSArray<DJIFetchMediaTask *> *)pendingTasks
      Header:DJIFetchMediaTaskScheduler.h
      Description:

      Gets a copy of the pending tasks.

      Return:
      NSArray<DJIFetchMediaTask *> *An array of DJIFetchMediaTask objects.
      method moveTaskToEnd
      -(void)moveTaskToEnd:(DJIFetchMediaTask *)task
      Header:DJIFetchMediaTaskScheduler.h
      Description:

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

      Input Parameters:
      DJIFetchMediaTask * taskTask to schedule.
      method moveTaskToNext
      -(void)moveTaskToNext:(DJIFetchMediaTask *)task
      Header:DJIFetchMediaTaskScheduler.h
      Description:

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

      Input Parameters:
      DJIFetchMediaTask * taskTask to schedule.
      method removeTaskWithFile:andContent
      -(void)removeTaskWithFile:(DJIMediaFile *)file andContent:(DJIFetchMediaTaskContent)content
      Header:DJIFetchMediaTaskScheduler.h
      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:
      DJIMediaFile * fileAn object of DJIMediaFile.
      DJIFetchMediaTaskContent contentAn enum value of DJIFetchMediaTaskContent.
      method removeAllTasks
      -(void)removeAllTasks
      Header:DJIFetchMediaTaskScheduler.h
      Description:

      Removes all the pending tasks.

      method suspendWithCompletion
      -(void)suspendWithCompletion:(DJICompletionBlock)completion
      Header:DJIFetchMediaTaskScheduler.h
      Description:

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

      Input Parameters:
      DJICompletionBlock completionThe completion block with the returned execution result.
      method resumeWithCompletion
      -(void)resumeWithCompletion:(DJICompletionBlock)completion
      Header:DJIFetchMediaTaskScheduler.h
      Description:

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

      Input Parameters:
      DJICompletionBlock completionThe completion block with the returned execution result.
      enum DJIFetchMediaTaskSchedulerState
      typedef NS_ENUM(NSUInteger, DJIFetchMediaTaskSchedulerState)
      Header:DJIFetchMediaTaskScheduler.h
      Description:

      States of the fetch media file task scheduler DJIFetchMediaTaskScheduler.

      Enum Members:
      DJIFetchMediaTaskSchedulerStateIdleScheduler is waiting for tasks.
      DJIFetchMediaTaskSchedulerStateExecutingScheduler is executing tasks.
      DJIFetchMediaTaskSchedulerStateSuspendedScheduler is suspended. Use resumeWithCompletion to resume the scheduler.
      DJIFetchMediaTaskSchedulerStateUnknownUnknown.