DJI Mobile SDK Documentation

      class VideoFeeder

      class VideoFeeder
      Package:dji.sdk.camera
      Description:

      Class that manages live video feed from DJI products to the mobile device.

      Class Members:
      Get Instance
      method
      method getInstance
      static VideoFeeder getInstance()
      Package:dji.sdk.camera
      Description:

      The instance of VideoFeeder.

      Return:
      static VideoFeederAn object of VideoFeeder.
      Add Listener
      method
      method addPhysicalSourceListener
      void addPhysicalSourceListener(PhysicalSourceListener listener)
      Package:dji.sdk.camera
      Description:

      Add physical source listener.

      Input Parameters:
      PhysicalSourceListener listenerAn interface of PhysicalSourceListener.
      Remove Listener
      method
      method removePhysicalSourceListener
      void removePhysicalSourceListener(PhysicalSourceListener listener)
      Package:dji.sdk.camera
      Description:

      Remove physical source listener.

      Input Parameters:
      PhysicalSourceListener listenerAn interface of PhysicalSourceListener.
      Primary Video Feed
      method
      method getPrimaryVideoFeed
      @NonNull
      VideoFeed getPrimaryVideoFeed()
      Package:dji.sdk.camera
      Description:

      The primary video feed.
      The possible physical sources for the primary video feed include:
      - MAIN_CAM
      - LB
      - HDMI
      - LEFT_CAM
      - RIGHT_CAM
      For M210 and M210 RTK, the physical sources are controlled by the bandwidth allocation between the port (left) and starboard (right) main cameras (setBandwidthAllocationForLeftCamera):
      - When bandwidth is 100% on the left camera, the primary source is LEFT_CAM and the secondary source is FPV_CAM.
      - When bandwidth is 0% on the left camera, the primary source is RIGHT_CAM and the secondary source is FPV_CAM.
      - When bandwidth is neither 0% nor 100% on the left camera, the primary source is LEFT_CAM and the secondary source is RIGHT_CAM.
      For Matrice 300 RTK, the physical source can be:
      LEFT_CAM,
      RIGHT_CAM,
      TOP_CAM and
      FPV_CAM.
      Please note that video playback stream will be received as primary or secondary video feed, if video playback starts on Zenmuse H20 Series. Video feed channel could be assigned by assignSourceToPrimaryChannel in OcuSyncLink.

      Return:
      VideoFeedA VideoFeed object.
      Secondary Video Feed
      method
      method getSecondaryVideoFeed
      @NonNull
      VideoFeed getSecondaryVideoFeed()
      Package:dji.sdk.camera
      Description:

      The secondary video feed.
      The possible physical sources for the secondary video feed include:
      - FPV_CAM
      - EXT
      - AV
      - RIGHT_CAM. For M210 and M210 RTK, the physical sources are controlled by the bandwidth allocation between the port (left) and starboard (right) main cameras (setBandwidthAllocationForLeftCamera):
      - When bandwidth is 100% on the left camera, the primary source is LEFT_CAM and the secondary source is FPV_CAM.
      - When bandwidth is 0% on the left camera, the primary source is RIGHT_CAM and the secondary source is FPV_CAM.
      - When bandwidth is neither 0% nor 100% on the left camera, the primary source is LEFT_CAM and the secondary source is RIGHT_CAM.
      For Matrice 300 RTK, the physical source can be: LEFT_CAM, RIGHT_CAM, TOP_CAM and FPV_CAM. Please note that video playback stream will be received as primary or secondary video feed, if video playback starts on Zenmuse H20 Series. Video feed channel could be assigned by assignSourceToPrimaryChannel in OcuSyncLink.

      Return:
      VideoFeedA VideoFeed object.
      method provideTranscodedVideoFeed
      VideoFeed provideTranscodedVideoFeed()
      Package:dji.sdk.camera
      Description:

      Returns a new VideoFeed instance to receive the transcoded video feed from the main camera. The original video feed from the main camera is transcoded (using MediaCodec) to generate H.264 video feed for more general usages. The encoder will use the calibrated decoded feed when lens distortion calibration is needed. Setting the callback of VideoFeed to null can stop the transcoding.

      Return:
      VideoFeedA VideoFeed object.
      method setTranscodingDataRate
      void setTranscodingDataRate(float rate)
      Package:dji.sdk.camera
      Description:

      Sets the destination data rate for the transcoded video feed. The valid range is [0.3, 20] in Mbps. CAUTION: Changing the data rate during transcoding may re-start the internal encoder. The transcoded video feed will get interrupted for a few seconds.

      Input Parameters:
      float rateThe destination data rate for the transcoded video feed.
      method getTranscodingDataRate
      float getTranscodingDataRate()
      Package:dji.sdk.camera
      Description:

      Gets the data rate of all transcoded video feeder, in Mbps.

      Return:
      floatA float value of the data rate of all transcoded video feeder.
      method isLensDistortionCalibrationNeeded
      boolean isLensDistortionCalibrationNeeded()
      Package:dji.sdk.camera
      Description:

      Determines if the original video feed requires lens distortion calibration. When calibration is needed, it is not recommended to use the original video feed with the decoding sample (https://github.com/DJI-Mobile-SDK-Tutorials/Android-VideoStreamDecodingSample). Use the transcoded video feed instead and also the module: 'library-anti-distortion' should be included.

      Return:
      booleantrue if the video need anti-distortion feature.
      method isFetchKeyFrameNeeded
      boolean isFetchKeyFrameNeeded()
      Package:dji.sdk.camera
      Description:

      Determines if the original video feed requires SDK to fetch key frame. When fetch key frame is needed, it is not recommended to use the original video feed with the decoding sample (https://github.com/DJI-Mobile-SDK-Tutorials/Android-VideoStreamDecodingSample). Use the transcoded video feed instead.

      Return:
      booleantrue if the video need anti-distortion feature.
      State Updates
      class