uav_liveview.h
2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UAV_LIVEVIEW_H
#define UAV_LIVEVIEW_H
/* Includes ------------------------------------------------------------------*/
#include "uav_typedef.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Exported constants --------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
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;
/**
* @brief Liveview camera h264 stream callback.
*/
typedef void (*UAVLiveView_H264Callback)(int32_t payload_id, const uint8_t *buf, uint32_t len);
/* Exported functions --------------------------------------------------------*/
/**
* @brief Initialize the liveview module.
*/
T_UAVReturnCode UAV_LiveView_Init(void);
/**
* @brief Deinitialize the liveview module.
*/
T_UAVReturnCode UAV_LiveView_Deinit(void);
/**
* @brief Start the FPV or camera H264 stream from the specified position.
* @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, UAVLiveView_H264Callback callback);
/**
* @brief Stop the FPV or Camera H264 Stream from the specified position.
* @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);
/**
* @brief Request the intraframe Frame of camera H264 stream from the specified position.
* @param position: Camera position for the H264 stream output.
* @param source: sub-camera source for the H264 stream output.
*/
T_UAVReturnCode UAV_LiveView_RequestIntraFrameData(int32_t payload_id, E_UAVLiveViewCameraSource source);
#ifdef __cplusplus
}
#endif
#endif // UAV_LIVEVIEW_H