Camera Function

2023-03-29
3.7 Ratings
10 customers rated

This is the header file for "psdk_payload_camera.c", defining the structure and (exported) function prototypes.

Definition, Enum and Struct

typedef enum E_DjiCameraMode

typedef enum {
    DJI_CAMERA_MODE_SHOOT_PHOTO = 0, /*!< Shoot photo work mode. */
    DJI_CAMERA_MODE_RECORD_VIDEO = 1, /*!< Record video work mode. */
    DJI_CAMERA_MODE_PLAYBACK = 2, /*!< Media playback work mode. */
} E_DjiCameraMode;

typedef enum E_DjiCameraShootPhotoMode

typedef enum {
    DJI_CAMERA_SHOOT_PHOTO_MODE_SINGLE = 1, /*!< Single photographing mode. */
    DJI_CAMERA_SHOOT_PHOTO_MODE_BURST = 4, /*!< Burst photographing mode. */
    DJI_CAMERA_SHOOT_PHOTO_MODE_INTERVAL = 6, /*!< Interval photographing mode. */
} E_DjiCameraShootPhotoMode;

typedef enum E_DjiCameraShootingState

typedef enum {
    DJI_CAMERA_SHOOTING_PHOTO_IDLE = 0, /*!< Photographing in idle state. */
    DJI_CAMERA_SHOOTING_SINGLE_PHOTO = 1, /*!< Photographing in single photograph state . */
    DJI_CAMERA_SHOOTING_BURST_PHOTO = 2, /*!< Photographing in burst photograph state. */
    DJI_CAMERA_SHOOTING_INTERVAL_PHOTO = 6, /*!< Photographing in interval photograph state. */
} E_DjiCameraShootingState;

typedef enum E_DjiCameraMeteringMode

typedef enum {
    DJI_CAMERA_METERING_MODE_CENTER = 0, /*!< Center metering mode. */
    DJI_CAMERA_METERING_MODE_AVERAGE = 1, /*!< Average metering mode. */
    DJI_CAMERA_METERING_MODE_SPOT = 2, /*!< Spot metering mode. */
} E_DjiCameraMeteringMode;

typedef enum E_DjiCameraFocusMode

typedef enum {
    DJI_CAMERA_FOCUS_MODE_MANUAL = 0, /*!< Manual focus mode. */
    DJI_CAMERA_FOCUS_MODE_AUTO = 1, /*!< Auto focus mode. */
} E_DjiCameraFocusMode;

typedef enum E_DjiCameraMediaFileType

typedef enum {
    DJI_CAMERA_FILE_TYPE_JPEG = 0, /*!< Media file JPEG type. */
    DJI_CAMERA_FILE_TYPE_DNG = 1, /*!< Media file DNG type. */
    DJI_CAMERA_FILE_TYPE_MOV = 2, /*!< Media file MOV type. */
    DJI_CAMERA_FILE_TYPE_MP4 = 3, /*!< Media file MP4 type. */
} E_DjiCameraMediaFileType;

typedef enum E_DjiCameraPlaybackMode

typedef enum {
    DJI_CAMERA_PLAYBACK_MODE_PLAY = 2, /*!< Play playbacking mode. */
    DJI_CAMERA_PLAYBACK_MODE_PAUSE = 3, /*!< Pause playbacking mode. */
    DJI_CAMERA_PLAYBACK_MODE_STOP = 7, /*!< Stop playbacking mode. */
} E_DjiCameraPlaybackMode;

typedef enum E_DjiCameraVideoFrameRate

typedef enum {
    DJI_CAMERA_VIDEO_FRAME_RATE_24_FPS = 13, /*!< The camera's video frame rate is 24fps (frames per second) */
    DJI_CAMERA_VIDEO_FRAME_RATE_25_FPS = 2, /*!< The camera's video frame rate is 25fps (frames per second) */
    DJI_CAMERA_VIDEO_FRAME_RATE_30_FPS = 14, /*!< The camera's video frame rate is 30fps (frames per second) */
    DJI_CAMERA_VIDEO_FRAME_RATE_UNKNOWN = 0, /*!< The camera's video frame rate is unknown (frames per second) */
} E_DjiCameraVideoFrameRate;

typedef enum E_DjiCameraVideoResolution

typedef enum {
    DJI_CAMERA_VIDEO_RESOLUTION_640x480 = 0, /*!< /The camera's video resolution is 640x480. */
    DJI_CAMERA_VIDEO_RESOLUTION_1280x720 = 4, /*!< /The camera's video resolution is 1280x720. */
    DJI_CAMERA_VIDEO_RESOLUTION_1920x1080 = 10, /*!< /The camera's video resolution is 1920x1080. */
    DJI_CAMERA_VIDEO_RESOLUTION_2048x1080 = 37, /*!< /The camera's video resolution is 2048x1080. */
    DJI_CAMERA_VIDEO_RESOLUTION_3840x2160 = 41, /*!< /The camera's video resolution is 3840x2160. */
    DJI_CAMERA_VIDEO_RESOLUTION_UNKNOWN = 255, /*!< /The camera's video resolution is unknown. */
} E_DjiCameraVideoResolution;

typedef enum E_DjiCameraTapZoomState

typedef enum {
    DJI_CAMERA_TAP_ZOOM_STATE_IDLE = 0, /*!< Camera is not in tap zoom process. */
    DJI_CAMERA_TAP_ZOOM_STATE_ZOOM_IN = 1, /*!< Camera is zooming in. */
    DJI_CAMERA_TAP_ZOOM_STATE_ZOOM_OUT = 2, /*!< Camera is zooming out. */
    DJI_CAMERA_TAP_ZOOM_STATE_ZOOM_LIMITED = 3, /*!< Camera has reached zoom limit. */
} E_DjiCameraTapZoomState;

typedef enum E_DjiCameraVideoStreamType

typedef enum {
    /*! Camera video stream by h264 custom format, which needs to comply with the user document Custom-H264 video stream format standard.
     * When using this format to send a video stream, the bit rate of the video stream needs must not exceed the real-time bandwidth
     * limit of the channel that feedback by interface #DjiPayloadCamera_GetVideoStreamState.*/
    DJI_CAMERA_VIDEO_STREAM_TYPE_H264_CUSTOM_FORMAT = 0,
    /*! Camera video stream by h264 DJI format, which needs to comply with the user document DJI-H264 video stream format standard.
     * When using this format to send a video stream, the video stream will be recoded by aircraft. No need to dynamically adjust
	 * the bit rate to ensure the quality of transmission. But the bit rate of video stream can not exceed 8Mbps. */
    DJI_CAMERA_VIDEO_STREAM_TYPE_H264_DJI_FORMAT = 1,
} E_DjiCameraVideoStreamType;

typedef struct T_DjiCameraSDCardState

typedef struct {
    bool isInserted; /*!< Specifies if the SD card is inserted in the camera. This parameter is boolean type. */
    bool isVerified; /*!< Specifies if the SD card is verified as genuine. This parameter is boolean type. */
    bool isInitializing; /*!< Specifies if the SD card is initializing. This parameter is boolean type. */
    bool isReadOnly; /*!< Specifies if the SD card is read only type. This parameter is boolean type. */
    bool isFormatting; /*!< Specifies if the SD card is in formatting process. This parameter is boolean type. */
    bool isFull; /*!< Specifies if the SD card's capacity is full. This parameter is boolean type. */
    bool isInvalidFormat;/*!< Specifies if the SD card is invalid formatted. This parameter is boolean type. */
    bool hasError; /*!< Specifies if the SD card has error. This parameter is boolean type. */
    uint32_t totalSpaceInMB; /*!< SD card total capacity, unit: MB. */
    uint32_t remainSpaceInMB; /*!< SD card remaining capacity, unit: MB. */
    uint32_t availableCaptureCount; /*!< Available capture photo count. */
    uint32_t availableRecordingTimeInSeconds; /*!< Available video recording second time, unit: s. */
} T_DjiCameraSDCardState;

typedef struct T_DjiCameraSpotMeteringTarget

typedef struct {
    uint8_t col; /*!< Specifies column coordinate. This parameter is between 0 and 11. */
    uint8_t row; /*!< Specifies row coordinate. This parameter is between 0 and 7. */
} T_DjiCameraSpotMeteringTarget;

typedef struct T_DjiCameraSystemState

typedef struct {
    E_DjiCameraMode cameraMode; /*!< Specifies the camera current work mode, #E_DjiCameraMode. */
    E_DjiCameraShootingState shootingState; /*!< Specifies the camera state of shooting, #E_DjiCameraShootingState. */
    bool isStoring;/*!< Specifies if the camera is in storing status. This parameter is boolean type. */
    bool isShootingIntervalStart; /*!< Specifies if the camera is in interval shooting start status. This parameter is boolean type. */
    uint16_t currentPhotoShootingIntervalTimeInSeconds; /*!< Specifies the current interval shoot countdown time, the value is decreasing,
                                                         * when the value equals to zero trigger the interval take photo, uint:s. */
    uint16_t currentPhotoShootingIntervalCount; /*!< Specifies the current interval photo count, the value is decreasing step by one from
                                                 * the setted count when interval taking photo */
    bool isRecording; /*!< Specifies if the camera is in recording status. This parameter is boolean type. */
    uint16_t currentVideoRecordingTimeInSeconds; /*!< Specifies the current recording process time, uint:s. */
    bool isOverheating; /*!< Specifies if the camera is in overheating status. This parameter is boolean type. */
    bool hasError; /*!< Specifies if the camera in error status. This parameter is boolean type. */
} T_DjiCameraSystemState;

typedef struct T_DjiCameraFocusAssistantSettings

typedef struct {
    bool isEnabledMF; /*!< Specifies if the lens focus assistant is enabled for manual focusing. This parameter is boolean type. */
    bool isEnabledAF; /*!< Specifies if the lens focus assistant is enabled for auto focusing. This parameter is boolean type. */
} T_DjiCameraFocusAssistantSettings;

typedef struct T_DjiCameraPlaybackStatus

typedef struct {
    E_DjiCameraPlaybackMode playbackMode; /*!< Specifies the duration of video media file, #E_DjiCameraPlaybackMode. */
    uint8_t videoPlayProcess; /*!< Specifies the current play process of video media file. This parameter is between 0 and 100. */
    uint32_t videoLengthMs; /*!< Specifies the total duration of video media file, uint:ms. */
    uint32_t playPosMs; /*!< Specifies the current play position of video media file, uint:ms. */
} T_DjiCameraPlaybackStatus;

typedef struct T_DjiCameraMediaFileAttr

typedef struct {
    uint16_t attrVideoDuration; /*!< Specifies the playback duration of video media file, uint:s. */
    uint16_t attrVideoFrameRate; /*!< Specifies the frame rate of video media file, uint:fps. */
    uint16_t attrVideoResolution; /*!< Specifies the resolution of video media file, uint:px. */
} T_DjiCameraMediaFileAttr;

typedef struct T_DjiCameraMediaFileInfo

typedef struct {
    E_DjiCameraMediaFileType type; /*!< Specifies the type of media file, #E_DjiCameraMediaFileType. */
    T_DjiCameraMediaFileAttr mediaFileAttr; /*!< Specifies the attributes of media file. */
    uint32_t fileSize; /*!< Specifies the size of media file, uint:byte. */
} T_DjiCameraMediaFileInfo;

typedef struct T_DjiCameraTapZoomState

typedef struct {
    E_DjiCameraTapZoomState zoomState; /*!< Camera zoom state. */
    bool isGimbalMoving; /*!< Flag that specifies whether gimbal is moving for tap zoom. */
} T_DjiCameraTapZoomState;

typedef struct T_DjiCameraCommonHandler

typedef struct {
    /**
     * @brief Prototype of callback function used to get camera system state.
     * @param systemState: pointer to memory space used to store camera system state.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetSystemState)(T_DjiCameraSystemState *systemState);

    /**
     * @brief Prototype of callback function used to set camera work mode.
     * @note Sets the camera's work mode to taking pictures, video, playback. Please note that you cannot change the mode
     * when a certain taskHandle is executing, such as taking photo(s), recording video, or downloading and saving files. Also
     * supported by thermal imaging camera.
     * @param mode: camera work mode.
     * @return Execution result.
     */
    T_DjiReturnCode (*SetMode)(E_DjiCameraMode mode);

    /**
     * @brief Prototype of callback function used to get camera current work mode.
     * @param mode: pointer to memory space used to store camera work mode.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetMode)(E_DjiCameraMode *mode);

    /**
     * @brief Prototype of callback function used to start record video.
     * @return Execution result.
     */
    T_DjiReturnCode (*StartRecordVideo)(void);

    /**
     * @brief Prototype of callback function used to stop record video.
     * @return Execution result.
     */
    T_DjiReturnCode (*StopRecordVideo)(void);

    /**
     * @brief Prototype of callback function used to start shoot photo.
     * @return Execution result.
     */
    T_DjiReturnCode (*StartShootPhoto)(void);

    /**
     * @brief Prototype of callback function used to stop shoot photo.
     * @return Execution result.
     */
    T_DjiReturnCode (*StopShootPhoto)(void);

    /**
     * @brief Prototype of callback function used to set camera shoot photo mode.
     * @param mode: camera shoot photo mode.
     * @return Execution result.
     */
    T_DjiReturnCode (*SetShootPhotoMode)(E_DjiCameraShootPhotoMode mode);

    /**
     * @brief Prototype of callback function used to get camera current shoot photo mode.
     * @param mode: pointer to memory space used to store camera shoot photo mode.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetShootPhotoMode)(E_DjiCameraShootPhotoMode *mode);

    /**
     * @brief Prototype of callback function used to set camera shoot burst count.
     * @param burstCount: camera shoot burst count.
     * @return Execution result.
     */
    T_DjiReturnCode (*SetPhotoBurstCount)(E_DjiCameraBurstCount burstCount);

    /**
     * @brief Prototype of callback function used to get camera current burst count.
     * @param burstCount: pointer to memory space used to store camera shoot burst count.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetPhotoBurstCount)(E_DjiCameraBurstCount *burstCount);

    /**
     * @brief Prototype of callback function used to set camera shoot time interval settings.
     * @note The value range of interval photograph count is [2, 255]. If 255 is selected, then the camera will continue
     * to take pictures until StopShootPhoto is called.
     * @param settings: camera shoot time interval settings.
     * @return Execution result.
     */
    T_DjiReturnCode (*SetPhotoTimeIntervalSettings)(T_DjiCameraPhotoTimeIntervalSettings settings);

    /**
     * @brief Prototype of callback function used to get camera shoot time interval settings.
     * @param settings: pointer to memory space used to store camera shoot time interval settings.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetPhotoTimeIntervalSettings)(T_DjiCameraPhotoTimeIntervalSettings *settings);

    /**
     * @brief Prototype of callback function used to get camera current SDCard state.
     * @param sdCardState: pointer to memory space used to store camera SDCard state.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetSDCardState)(T_DjiCameraSDCardState *sdCardState);

    /**
     * @brief Prototype of callback function used to format the SDCard inserted.
     * @return Execution result.
     */
    T_DjiReturnCode (*FormatSDCard)(void);
} T_DjiCameraCommonHandler;

typedef struct T_DjiCameraExposureMeteringHandler

typedef struct {
    /**
     * @brief Prototype of callback function used to set camera metering mode.
     * @param mode: camera metering mode.
     * @return Execution result.
     */
    T_DjiReturnCode (*SetMeteringMode)(E_DjiCameraMeteringMode mode);

    /**
     * @brief Prototype of callback function used to get camera current metering mode.
     * @param mode: pointer to memory space used to store camera metering mode.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetMeteringMode)(E_DjiCameraMeteringMode *mode);

    /**
     * @brief Prototype of callback function used to set camera spot metering target area.
     * @param target: camera spot metering target area.
     * @return Execution result.
     */
    T_DjiReturnCode (*SetSpotMeteringTarget)(T_DjiCameraSpotMeteringTarget target);

    /**
     * @brief Prototype of callback function used to get camera spot metering target area.
     * @param target: pointer to memory space used to store camera spot metering target area.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetSpotMeteringTarget)(T_DjiCameraSpotMeteringTarget *target);
} T_DjiCameraExposureMeteringHandler;

typedef struct T_DjiCameraFocusHandler

typedef struct {
    /**
     * @brief Prototype of callback function used to set camera focus mode.
     * @param mode: camera focus mode.
     * @return Execution result.
     */
    T_DjiReturnCode (*SetFocusMode)(E_DjiCameraFocusMode mode);

    /**
     * @brief Prototype of callback function used to get camera current focus mode.
     * @param mode: pointer to memory space used to store camera focus mode.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetFocusMode)(E_DjiCameraFocusMode *mode);

    /**
     * @brief Prototype of callback function used to set camera focus target area.
     * @param target: camera focus target area.
     * @return Execution result.
     */
    T_DjiReturnCode (*SetFocusTarget)(T_DjiCameraPointInScreen target);

    /**
     * @brief Prototype of callback function used to get camera focus target area.
     * @param target: pointer to memory space used to store camera focus target area.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetFocusTarget)(T_DjiCameraPointInScreen *target);

    /**
     * @brief Prototype of callback function used to set camera focus assistant settings.
     * @param settings: camera focus assistant settings.
     * @return Execution result.
     */
    T_DjiReturnCode (*SetFocusAssistantSettings)(T_DjiCameraFocusAssistantSettings settings);

    /**
     * @brief Prototype of callback function used to get camera focus assistant settings.
     * @param settings: pointer to memory space used to store camera focus assistant settings.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetFocusAssistantSettings)(T_DjiCameraFocusAssistantSettings *settings);

    /**
     * @brief Prototype of callback function used to set camera focus ring value.
     * @param value: camera focus ring value.
     * @return Execution result.
     */
    T_DjiReturnCode (*SetFocusRingValue)(uint32_t value);

    /**
     * @brief Prototype of callback function used to get camera focus ring value.
     * @param value: pointer to memory space used to store camera focus ring value.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetFocusRingValue)(uint32_t *value);

    /**
     * @brief Prototype of callback function used to get camera focus upper bound ring value.
     * @param value: pointer to memory space used to store camera focus upper bound value.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetFocusRingValueUpperBound)(uint32_t *value);
} T_DjiCameraFocusHandler;

typedef struct T_DjiCameraDigitalZoomHandler

typedef struct {
    /**
     * @brief Prototype of callback function used to set camera digital zoom factor.
     * @param factor: camera digital zoom factor.
     * @return Execution result.
     */
    T_DjiReturnCode (*SetDigitalZoomFactor)(dji_f32_t factor);

    /**
     * @brief Prototype of callback function used to get camera current digital zoom factor.
     * @param factor: pointer to memory space used to store camera current digital zoom factor.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetDigitalZoomFactor)(dji_f32_t *factor);
} T_DjiCameraDigitalZoomHandler;

typedef struct T_DjiCameraOpticalZoomHandler

typedef struct {
    /**
     * @brief Prototype of callback function used to set camera optical zoom focal length.
     * @param focalLength: camera optical zoom focal length.
     * @return Execution result.
     */
    T_DjiReturnCode (*SetOpticalZoomFocalLength)(uint32_t focalLength);

    /**
     * @brief Prototype of callback function used to get camera optical zoom focal length.
     * @param focalLength: pointer to memory space used to store camera optical zoom focal length.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetOpticalZoomFocalLength)(uint32_t *focalLength);

    /**
     * @brief Prototype of callback function used to get camera optical zoom factor.
     * @param factor: pointer to memory space used to store camera optical zoom factor.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetOpticalZoomFactor)(dji_f32_t *factor);

    /**
     * @brief Prototype of callback function used to get camera optical zoom specifies.
     * @param spec: pointer to memory space used to store camera optical zoom specifies.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetOpticalZoomSpec)(T_DjiCameraOpticalZoomSpec *spec);

    /**
     * @brief Prototype of callback function used to start continuous optical zoom.
     * @param direction: camera zoom direction.
     * @param speed: camera zoom speed.
     * @return Execution result.
     */
    T_DjiReturnCode (*StartContinuousOpticalZoom)(E_DjiCameraZoomDirection direction, E_DjiCameraZoomSpeed speed);

    /**
     * @brief Prototype of callback function used to stop continuous optical zoom.
     * @return Execution result.
     */
    T_DjiReturnCode (*StopContinuousOpticalZoom)(void);
} T_DjiCameraOpticalZoomHandler;

typedef struct T_DjiCameraMediaDownloadPlaybackHandler

typedef struct {
    /**
     * @brief Prototype of callback function used to get camera media file path.
     * @warning The maximum length of path that users can pass in is 256, including end character '\0'.
     * @param dirPath: pointer to memory space used to store camera media file path.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetMediaFileDir)(char *dirPath);

    /**
     * @brief Prototype of callback function used to get the file info of the selected origin media file.
     * @param dirPath: pointer to memory space used to store camera current media file path.
     * @param fileInfo: pointer to memory space used to store file info of the selected origin media file.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetMediaFileOriginInfo)(const char *filePath, T_DjiCameraMediaFileInfo *fileInfo);

    /**
     * @brief Prototype of callback function used to get the data of the selected origin media file.
     * @param dirPath: pointer to memory space used to store camera current media file path.
     * @param offset: the offset of origin file data that need get from the selected media file.
     * @param length: the length of origin file data that need get from the selected media file.
     * @param data: pointer to memory space used to store the selected origin media file.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetMediaFileOriginData)(const char *filePath, uint32_t offset, uint32_t length, uint8_t *data);

    /**
      * @brief Prototype of callback function used to create the thumb nail of selected media file.
      * @param dirPath: pointer to memory space used to store camera current media file path.
      * @return Execution result.
      */
    T_DjiReturnCode (*CreateMediaFileThumbNail)(const char *filePath);

    /**
     * @brief Prototype of callback function used to get the file info of the created thumbnail.
     * @param dirPath: pointer to memory space used to store camera current media file path.
     * @param fileInfo: pointer to memory space used to store file info of the created thumbnail.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetMediaFileThumbNailInfo)(const char *filePath, T_DjiCameraMediaFileInfo *fileInfo);

    /**
      * @brief Prototype of callback function used to get the data of the created thumbnail.
      * @param dirPath: pointer to memory space used to store camera current media file path.
      * @param offset: the offset of thumb nail data that need get from the selected media file.
      * @param length: the length of thumb nail data that need get from the selected media file.
      * @param data: pointer to memory space used to store the created thumbnail data.
      * @return Execution result.
      */
    T_DjiReturnCode (*GetMediaFileThumbNailData)(const char *filePath, uint32_t offset, uint32_t length,
                                                 uint8_t *data);

    /**
      * @brief Prototype of callback function used to destroy the created thumb nail of selected media file.
      * @param dirPath: pointer to memory space used to store camera current media file path.
      * @return Execution result.
      */
    T_DjiReturnCode (*DestroyMediaFileThumbNail)(const char *filePath);

    /**
      * @brief Prototype of callback function used to create the screen nail of selected media file.
      * @param dirPath: pointer to memory space used to store camera current media file path.
      * @return Execution result.
      */
    T_DjiReturnCode (*CreateMediaFileScreenNail)(const char *filePath);

    /**
      * @brief Prototype of callback function used to get the data of the created screen nail.
      * @param dirPath: pointer to memory space used to store camera current media file path.
      * @param offset: the offset of screen nail data that need get from selected media file.
      * @param length: the length of screen nail data that need get from selected media file.
      * @param data: pointer to memory space used to store the created screen nail data.
      * @return Execution result.
      */
    T_DjiReturnCode (*GetMediaFileScreenNailData)(const char *filePath, uint32_t offset, uint32_t length,
                                                  uint8_t *data);

    /**
     * @brief Prototype of callback function used to get the file info of the created screen nail.
     * @param dirPath: pointer to memory space used to store camera current media file path.
     * @param fileInfo: pointer to memory space used to store file info of the created screen nail.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetMediaFileScreenNailInfo)(const char *filePath, T_DjiCameraMediaFileInfo *fileInfo);

    /**
      * @brief Prototype of callback function used to destroy the created screen nail of selected media file.
      * @param dirPath: pointer to memory space used to store camera current media file path.
      * @return Execution result.
      */
    T_DjiReturnCode (*DestroyMediaFileScreenNail)(const char *filePath);

    /**
     * @brief Prototype of callback function used to notification when download starting.
     * @note You can adjust the bandwidth proportion of each high speed channel in the notification callback.
     * @return Execution result.
     */
    T_DjiReturnCode (*StartDownloadNotification)(void);

    /**
     * @brief Prototype of callback function used to notification when download stoping.
     * @note You can adjust the bandwidth proportion of each high speed channel in the notification callback.
     * @return Execution result.
     */
    T_DjiReturnCode (*StopDownloadNotification)(void);

    /**
      * @brief Prototype of callback function used to delete the user's media files.
      * @param filePath: pointer to memory space used to store camera current media file path.
      * @return Execution result.
      */
    T_DjiReturnCode (*DeleteMediaFile)(char *filePath);

    /**
      * @brief Prototype of callback function used to get camera media playback status.
      * @param status: pointer to memory space used to store camera media file path.
      * @return Execution result.
      */
    T_DjiReturnCode (*GetMediaPlaybackStatus)(T_DjiCameraPlaybackStatus *status);

    /**
      * @brief Prototype of callback function used to set the file path of media file that need playback.
      * @param filePath: pointer to memory space used to store the file path of media file that need playback.
      * @return Execution result.
      */
    T_DjiReturnCode (*SetMediaPlaybackFile)(const char *filePath);

    /**
      * @brief Prototype of callback function used to start media video playback when camera work in playback mode.
      * @return Execution result.
      */
    T_DjiReturnCode (*StartMediaPlayback)(void);

    /**
      * @brief Prototype of callback function used to stop media video playback when camera work in playback mode.
      * @return Execution result.
      */
    T_DjiReturnCode (*StopMediaPlayback)(void);

    /**
      * @brief Prototype of callback function used to pause media video playback when camera work in playback mode.
      * @return Execution result.
      */
    T_DjiReturnCode (*PauseMediaPlayback)(void);

    /**
      * @brief Prototype of callback function used to seek to the playback position of media video when camera work in playback mode.
      * @param playbackPosition: playback position of video media, unit: ms.
      * @return Execution result.
      */
    T_DjiReturnCode (*SeekMediaPlayback)(uint32_t playbackPosition);
} T_DjiCameraMediaDownloadPlaybackHandler;

typedef struct T_DjiCameraTapZoomHandler

typedef struct {
    /**
     * @brief Prototype of callback function used to get tap zoom state.
     * @param state: pointer to memory space used to store tap zoom state.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetTapZoomState)(T_DjiCameraTapZoomState *state);

    /**
     * @brief Prototype of callback function used to enable or disable tap zoom function.
     * @details dji application should response tap zoom command only if tap zoom function is enabled.
     * @param enabledFlag: enabled flag.
     * @return Execution result.
     */
    T_DjiReturnCode (*SetTapZoomEnabled)(bool enabledFlag);

    /**
     * @brief Prototype of callback function used to get the flag that specifies whether tap zoom function has been
     * enabled,
     * @param enabledFlag: pointer to memory space used to store enabled flag.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetTapZoomEnabled)(bool *enabledFlag);

    /**
     * @brief Prototype of callback function used to set multiplier of single tap zoom.
     * @param multiplier: multiplier of single tap zoom.
     * @return Execution result.
     */
    T_DjiReturnCode (*SetTapZoomMultiplier)(uint8_t multiplier);

    /**
     * @brief Prototype of callback function used to get multiplier of single tap zoom.
     * @param multiplier: pointer to memory space use to store multiplier of single tap zoom.
     * @return Execution result.
     */
    T_DjiReturnCode (*GetTapZoomMultiplier)(uint8_t *multiplier);

    /**
     * @brief Prototype of callback function used to trigger tap zoom.
     * @details Users trigger tap zoom in screen of mobile end, this callback function will be called. Then, dji
     * application should rotate gimbal to orientation of target point and zoom by specified multiplier.
     * @param target: position information of target point in screen.
     * @return Execution result.
     */
    T_DjiReturnCode (*TapZoomAtTarget)(T_DjiCameraPointInScreen target);
} T_DjiCameraTapZoomHandler;

Function

function DjiPayloadCamera_Init

Function:Initialize the payload camera module. product:all
T_DjiReturnCode DjiPayloadCamera_Init(void);


Return
The details for the return code please refer to: DjiErrorCode

function DjiPayloadCamera_RegCommonHandler

Function: Register the handler for payload camera common function interfaces. product:all
T_DjiReturnCode DjiPayloadCamera_RegCommonHandler(const T_DjiCameraCommonHandler *cameraCommonHandler);
Parameter
cameraCommonHandler:pointer to the handler for payload camera common functions.
Return
The details for the return code please refer to: DjiErrorCode

function DjiPayloadCamera_RegExposureMeteringHandler

Function:Register the handler for payload camera exposure and metering function interfaces.product:all
T_DjiReturnCode DjiPayloadCamera_RegExposureMeteringHandler(const T_DjiCameraExposureMeteringHandler
  *cameraExposureMeteringHandler);
Parameter
cameraExposureMeteringHandler:pointer to the handler for payload camera exposure and metering functions.
Return
The details for the return code please refer to: DjiErrorCode

function DjiPayloadCamera_RegFocusHandler

Function:Register the handler for payload camera focus function interfaces. product:all
T_DjiReturnCode DjiPayloadCamera_RegFocusHandler(const T_DjiCameraFocusHandler *cameraFocusHandler);
Parameter
cameraFocusHandler:pointer to the handler for payload camera focus functions.
Return
The details for the return code please refer to: DjiErrorCode

function DjiPayloadCamera_RegDigitalZoomHandler

Function: Register the handler for payload camera digital zoom function interfaces. product:all
T_DjiReturnCode DjiPayloadCamera_RegDigitalZoomHandler(const T_DjiCameraDigitalZoomHandler
 *cameraDigitalZoomHandler);
Parameter
cameraDigitalZoomHandler:pointer to the handler for payload camera digital zoom functions.
Return
The details for the return code please refer to: DjiErrorCode

function DjiPayloadCamera_RegOpticalZoomHandler

Function:Register the handler for payload camera optical zoom function interfaces. product:all
T_DjiReturnCode DjiPayloadCamera_RegOpticalZoomHandler(const T_DjiCameraOpticalZoomHandler
 *cameraOpticalZoomHandler);
Parameter
cameraOpticalZoomHandler:pointer to the handler for payload camera optical zoom functions.
Return
The details for the return code please refer to: DjiErrorCode

function DjiPayloadCamera_RegTapZoomHandler

Function:Register handler functions for tap zoom function.product:all
T_DjiReturnCode DjiPayloadCamera_RegTapZoomHandler(const T_DjiCameraTapZoomHandler *cameraTapZoomHandler);
Parameter
cameraTapZoomHandler:pointer to structure of handler functions for tap zoom function.
Return
The details for the return code please refer to: DjiErrorCode

function DjiPayloadCamera_SetVideoStreamType

Function:Set the type of camera video stream. product:all
T_DjiReturnCode DjiPayloadCamera_SetVideoStreamType(E_DjiCameraVideoStreamType videoStreamType);
Parameter
videoStreamType:camera video stream type.
Return
The details for the return code please refer to: DjiErrorCode

function DjiPayloadCamera_GetVideoStreamRemoteAddress

Function:Get the network remote address for sending camera video stream.product:all
  • @note The interface is used to get the network remote address for sending camera video stream. You can get this info for another heterogeneous system to do somethings. This interface should be used after calling djiCore_Init function.
  • @attention If you want use this interface, should call djiPlatform_RegHalNetworkHandler interface firstly, otherwise this interface will not work.
T_DjiReturnCode DjiPayloadCamera_GetVideoStreamRemoteAddress(char *ipAddr, uint16_t *port);
Parameter
ipAddr:the remote ip address for sending camera video stream.
port:the remote port for sending camera video stream.
Return
The details for the return code please refer to: DjiErrorCode

function DjiPayloadCamera_RegMediaDownloadPlaybackHandler

Function:Register the handler for payload camera media download and playback function interfaces. product:all
T_DjiReturnCode DjiPayloadCamera_RegMediaDownloadPlaybackHandler(const T_DjiCameraMediaDownloadPlaybackHandler
                                                                 *cameraMediaHandler);
Parameter
cameraMediaHandler:pointer to the handler for payload camera media download and playback functions.
Return
The details for the return code please refer to: DjiErrorCode

function DjiPayloadCamera_SendVideoStream

Function:Send the video to mobile end via video stream of the data channel. This function exists and can be used only in Linux. product:all
T_DjiReturnCode DjiPayloadCamera_SendVideoStream(const uint8_t *data, uint16_t len);
Parameter
data:pointer to data to be sent.
len:length of data to be sent via data stream, and it must be less than or equal to 65000, unit: byte.
Return
The details for the return code please refer to: DjiErrorCode

function DjiPayloadCamera_GetVideoStreamState

Function:Get data transmission state of "videoStream" channel. product:all
T_DjiReturnCode DjiPayloadCamera_GetVideoStreamState(T_DjiDataChannelState *state);
Parameter
state:pointer to "videoStream" channel state.
Return
The details for the return code please refer to: DjiErrorCode

function DjiPayloadCamera_PushAddedMediaFileInfo

Function:Push added media file information to aircraft system. product:all
T_DjiReturnCode
DjiPayloadCamera_PushAddedMediaFileInfo(const char *filePath, T_DjiCameraMediaFileInfo mediaFileInfo);
Parameter
filePath:pointer to path of added media file. Guaranteed to end with '\0'. Length of path have to be less than ::dji_FILE_PATH_SIZE_MAX bytes.
mediaFileInfo:information of added media file.
Return
The details for the return code please refer to: DjiErrorCode

function DjiPayloadCamera_GetCameraTypeOfPayload

Function:Get camera type of other payloads mounted on aircraft. product:all
T_DjiReturnCode DjiPayloadCamera_GetCameraTypeOfPayload(E_DjiMountPosition payloadPosition,
                                                        E_DjiCameraType *cameraType);
Parameter
payloadPosition:position where payload mounted on.
cameraType:Pointer to camera type of payload.
Return
The details for the return code please refer to: DjiErrorCode

function DjiPayloadCamera_GetCameraOpticalZoomSpecOfPayload

Function:Get optical zoom specification of other camera payloads mounted on aircraft.product:all
T_DjiReturnCode DjiPayloadCamera_GetCameraOpticalZoomSpecOfPayload(E_DjiMountPosition payloadPosition,
                                                                   T_DjiCameraOpticalZoomSpec *opticalZoomSpec);
Parameter
payloadPosition:position where payload mounted on.
opticalZoomSpec:pointer to optical zoom specification.
Return
The details for the return code please refer to: DjiErrorCode

function DjiPayloadCamera_GetCameraHybridZoomFocalLengthOfPayload

Function:Get hybrid zoom focal length of other camera payloads mounted on aircraft. product:all
T_DjiReturnCode DjiPayloadCamera_GetCameraHybridZoomFocalLengthOfPayload(E_DjiMountPosition payloadPosition,
                                                                         uint16_t *focalLength);
Parameter
payloadPosition:position where payload mounted on.
focalLength:Pointer to optical focal length, unit: 0.1mm.
Return
The details for the return code please refer to: DjiErrorCode
If you have any comments or confusion about our documentation, you can click here to give feedback and we will get back to you as soon as possible.