DJI Mobile SDK Documentation

      class DJIVideoFeed

      @interface DJIVideoFeed : NSObject
      Header:DJIVideoFeeder.h
      Inherits From:NSObject
      Description:

      Video feed. Use it to receive video data from a physical source.

      Class Members:
      Physical Source
      property
      property physicalSource
      @property (nonatomic, assign, readonly) DJIVideoFeedPhysicalSource physicalSource
      Header:DJIVideoFeeder.h
      Description:

      The physical source of the video feed.

      See Also:

      DJIVideoFeedPhysicalSource

      Active
      property
      property active
      @property (nonatomic, assign, readonly) BOOL active
      Header:DJIVideoFeeder.h
      Description:

      Determins if the video feed is active. Only supported by Matrice 300 RTK.

      Set Priority
      method
      method setPriority:withCompletion
      - (void)setPriority:(DJIVideoFeedPriority)priority withCompletion:(DJICompletionBlock)completion
      Header:DJIVideoFeeder.h
      Description:

      Set the channel priority of the video feed. Priority will affect the bandwidth allocation if it is not DJIVideoFeedPriorityUnknown, which is the default value. For example, if the data comes from the payload device mounted on left gimbal is prefer, please set the priority to DJIVideoFeedPriorityHigh, and physicalSource is DJIVideoFeedPhysicalSourceLeftCamera. The others should be set to DJIVideoFeedPriorityMedium or DJIVideoFeedPriorityLow. Only supported by Matrice 300 RTK.

      Input Parameters:
      DJIVideoFeedPriority priorityPriority for the primary video feed.
      DJICompletionBlock completionCompletion block.
      Get Priority
      method
      method getPriorityWithCompletion
      - (void)getPriorityWithCompletion:(void (^_Nonnull)(DJIVideoFeedPriority priority, NSError *_Nullable error))completion
      Header:DJIVideoFeeder.h
      Description:

      Get the channel priority of the video feed. Only supported by Matrice 300 RTK.

      Input Parameters:
      DJIVideoFeedPriority priorityPriority for the primary video feed.
      NSError *_Nullable errorError encountered during the request. If the request is successful, it will be nil.
      void (^_Nonnull)(DJIVideoFeedPriority priority, NSError *_Nullable error) completionCompletion block.
      Add Listener
      method
      method addListener:withQueue
      - (void)addListener:(id <DJIVideoFeedListener>)videoFeedListener withQueue:(nullable dispatch_queue_t)queue
      Header:DJIVideoFeeder.h
      Description:

      Add listener to receive new video data.

      Input Parameters:
      id <DJIVideoFeedListener> videoFeedListenerListener to receive video data.
      nullable dispatch_queue_t queueThe queue that videoFeed:didUpdateVideoData is called in.
      Remove Listener
      method
      method removeListener
      - (void)removeListener:(id <DJIVideoFeedListener>)videoFeedListener
      Header:DJIVideoFeeder.h
      Description:

      Remove listener to stop receiving new video data.

      Input Parameters:
      id <DJIVideoFeedListener> videoFeedListenerListener to remove.
      method removeAllListeners
      - (void)removeAllListeners
      Header:DJIVideoFeeder.h
      Description:

      Remove all Listeners for video feed.

      method parseDecodingAssistInfoWithBuffer:length:assistInfo
      - (BOOL)parseDecodingAssistInfoWithBuffer:(uint8_t *)buffer length:(int)length assistInfo:(void *)assistInfo
      Header:DJIVideoFeeder.h
      Description:

      Parses decoding assistant information for H.264 stream data. The information will be useful for the H.264 decoder. This method has been moved from DJIVideoFeeder to DJIVideoFeed since 4.12 to support multiple channel decoding.

      Input Parameters:
      uint8_t * bufferH.264 stream data to parse.
      int lengthThe data's length.
      void * assistInfoAn allocated memory with at least 8 bytes to receive the assistant information.
      Return:
      BOOLYES if information is parsed successfully from the stream.
      Sync Decoder Status
      method
      method syncDecoderStatus
      - (void)syncDecoderStatus:(BOOL)isNormal
      Header:DJIVideoFeeder.h
      Description:

      Synchronizes the decoder status (if it is in normal status) to the video feed. The decoder status is useful for the assistant information parser. This method has been moved from DJIVideoFeeder to DJIVideoFeed since 4.12 to support multiple channel decoding.

      Input Parameters:
      BOOL isNormalYES if the decoder is in normal status.
      method decodingDidSucceedWithTimestamp
      - (void)decodingDidSucceedWithTimestamp:(NSUInteger)timestamp
      Header:DJIVideoFeeder.h
      Description:

      Tells the parser that the decoder has decoded a frame successfully. This method has been moved from DJIVideoFeeder to DJIVideoFeed since 4.12 to support multiple channel decoding.

      Input Parameters:
      NSUInteger timestampThe timestamp of the decoded frame.
      method decodingDidFail
      - (void)decodingDidFail
      Header:DJIVideoFeeder.h
      Description:

      Tells the parser that the decoder has failed to decode frames from the video feed. This method has been moved from DJIVideoFeeder to DJIVideoFeed since 4.12 to support multiple channel decoding.

      protocol DJIVideoFeedSourceListener
      @protocol DJIVideoFeedSourceListener <NSObject>
      Header:DJIVideoFeeder.h
      Inherits From:NSObject
      Description:

      Listener that receives notifications when a new video physical source becomes available.

      Protocol Methods:

      Protocol Method

      method videoFeed:didChangePhysicalSource
      required
      - (void)videoFeed:(nonnull DJIVideoFeed *)videoFeed didChangePhysicalSource:(DJIVideoFeedPhysicalSource)physicalSource
      Header:DJIVideoFeeder.h
      Description:

      Called when a video feed is made available from a new physical source.

      Input Parameters:
      nonnull DJIVideoFeed * videoFeedA DJIVideoFeed object.
      DJIVideoFeedPhysicalSource physicalSourceAn enum value of DJIVideoFeedPhysicalSource.
      method videoFeed:didChangeActiveStatus
      @optional
      - (void)videoFeed:(nonnull DJIVideoFeed *)videoFeed didChangeActiveStatus:(BOOL)active
      Header:DJIVideoFeeder.h
      Description:

      Called when a video feed's active status changes.

      Input Parameters:
      nonnull DJIVideoFeed * videoFeedA DJIVideoFeed object.
      BOOL activeBOOL value indicates if the feed is active.
      protocol DJIVideoFeedListener
      @protocol DJIVideoFeedListener <NSObject>
      Header:DJIVideoFeeder.h
      Inherits From:NSObject
      Description:

      Represents a single video feed from a single channel or port.

      Protocol Methods:

      Protocol Method

      method videoFeed:didUpdateVideoData
      required
      - (void)videoFeed:(nonnull DJIVideoFeed *)videoFeed didUpdateVideoData:(nonnull NSData *)videoData
      Header:DJIVideoFeeder.h
      Description:

      Called when the video feed receives new video data.

      Input Parameters:
      nonnull DJIVideoFeed * videoFeedA DJIVideoFeed object.
      nonnull NSData * videoDataNew video data.
      enum DJIVideoFeedPhysicalSource
      typedef NS_ENUM(NSInteger, DJIVideoFeedPhysicalSource)
      Header:DJIVideoFeedBaseTypes.h
      Description:

      The physical source of a video feed.

      Enum Members:
      DJIVideoFeedPhysicalSourceMainCameraThe video feed is from the main camera. It is the physical source used by most of DJI products. DJIVideoFeedPhysicalSourceLeftCamera and DJIVideoFeedPhysicalSourceRightCamera are used instead in M210 series and M210 V2 series.
      DJIVideoFeedPhysicalSourceFPVCameraThe video feed is from the FPV camera on Inspire 2, M200 series and M200 series v2 and Matrice 300 RTK.
      DJIVideoFeedPhysicalSourceEXTThe video feed is from EXT port while EXT port is enabled. It is only used for Lightbridge 2 or aircrafts with Lightbridge 2 (e.g. M600).
      DJIVideoFeedPhysicalSourceLBThe video feed is from one of the LB ports (AV or HDMI) while EXT Port is enabled. It is only used for stand-alone Lightbridge 2 or aircraft with stand-alone Lightbridge 2 modules (e.g. M600).
      DJIVideoFeedPhysicalSourceHDMIThe video feed is from the HDMI port while EXT port is disabled. It is only used for stand-alone Lightbridge 2 or aircraft with stand-alone Lightbridge 2 modules.
      DJIVideoFeedPhysicalSourceAVThe video feed is from AV port while EXT port is disabled. It is only used for stand-alone Lightbridge 2 or aircraft with stand-alone Lightbridge 2 modules.
      DJIVideoFeedPhysicalSourceLeftCameraThe video feed is from the port (left) main camera. It is only used for M210 series and M210 V2 series and Matrice 300 RTK.
      DJIVideoFeedPhysicalSourceRightCameraThe video feed is from the starboard (right) main camera. It is only used for M210 series and M210 V2 series and Matrice 300 RTK.
      DJIVideoFeedPhysicalSourceTopCameraThe video feed is from the camera above the aircraft. It is only used for Matrice 300 RTK.
      DJIVideoFeedPhysicalSourceUnknownUnknown video physical source.
      enum DJIVideoFeedPriority
      typedef NS_ENUM (NSUInteger, DJIVideoFeedPriority)
      Header:DJIVideoFeedBaseTypes.h
      Description:

      The enum is used to represent priority of a stream channel. It is supported only by Matrice 300 RTK.

      Enum Members:
      DJIVideoFeedPriorityHighThe stream channel's priority is high.
      DJIVideoFeedPriorityMediumThe stream channel's priority is medium.
      DJIVideoFeedPriorityLowThe stream channel's priority is low.
      DJIVideoFeedPriorityUnknownThe stream channel's priority is unknown.