Obtain Camera Stream
The header file related to liveview functionality is uav_liveview.h. This document describes the key information and usage methods for the structures and function prototypes in the uav_liveview.h file.
Table of Contents
- Macro Definitions, Enumerations, and Structures
 
typedef enum {
    UAV_LIVEVIEW_CAMERA_SOURCE_DEFAULT = 0,
    UAV_LIVEVIEW_CAMERA_SOURCE_4T_IR = 1,
    UAV_LIVEVIEW_CAMERA_SOURCE_4T_VIS = 2,
    UAV_LIVEVIEW_CAMERA_SOURCE_4TPRO_IR = 3,
    UAV_LIVEVIEW_CAMERA_SOURCE_4TPRO_VIS = 4,
    UAV_LIVEVIEW_CAMERA_SOURCE_4N_IR = 5,
    UAV_LIVEVIEW_CAMERA_SOURCE_4N_WIDE = 6,
    UAV_LIVEVIEW_CAMERA_SOURCE_4N_NIGHT = 7,
    UAV_LIVEVIEW_CAMERA_SOURCE_L35T_IR = 8,
    UAV_LIVEVIEW_CAMERA_SOURCE_L35T_WIDE = 9,
    UAV_LIVEVIEW_CAMERA_SOURCE_L35T_ZOOM = 10,
    UAV_LIVEVIEW_CAMERA_SOURCE_4TH_IR = 11,
    UAV_LIVEVIEW_CAMERA_SOURCE_4TH_WIDE = 12,
    UAV_LIVEVIEW_CAMERA_SOURCE_4TH_ZOOM = 13,
}E_UAVLiveViewCameraSource;
Function Prototypes
function UAV_LiveView_H264Callback
- Function: H.264 stream callback processing function.
 
typedef void (*UAVLiveView_H264Callback)(int32_t payload_id, const uint8_t *buf, uint32_t len);
function UAV_LiveView_Init
- Function: Stream module initialization.
 
T_UAVReturnCode UAV_LiveView_Init(void);
function UAV_Waypoint_UploadKmz
- Function: Stream module de-initialization.
 
T_UAVReturnCode UAV_LiveView_Deinit(void);
function UAV_LiveView_StartH264Stream
- Function: Start obtaining the H.264 stream.
 
/**
 * @param position: Camera position for the H264 stream output.
 * @param source: sub-camera source for the H264 stream output.
 * @param callback: Callback function in a callback thread when a new h264 frame is received
 */
T_UAVReturnCode UAV_LiveView_StartH264Stream(int32_t payload_id, E_UAVLiveViewCameraSource source, UAV_LiveView_H264Callback callback);
function UAV_LiveView_StopH264Stream
- Function: Stop obtaining the H.264 stream.
 
/**
 * @param position: Camera position for the H264 stream output.
 * @param source: sub-camera source for the H264 stream output.
 */
T_UAVReturnCode UAV_LiveView_StopH264Stream(int32_t payload_id, E_UAVLiveViewCameraSource source);