Liveview
Catalog
Definition, Enum and Struct
CameraSource
CameraType
StreamQuality
OptionsFunction
H264Callback<ErrorCode
LiveviewStatus
LiveviewStatusCallback<void
Init
DeInit
SetCameraSource<void
SubscribeLiveviewStatus<ErrorCode
StartH264Stream
StopH264Stream<void
CreateLiveview<ErrorCode
Source of Payload Camera's Stream
enum CameraSource {
/*! Wide-angle lens */
kCameraSourceWide = 1,
/*! Zoom lens */
kCameraSourceZoom = 2,
/*! Infrared lens */
kCameraSourceIR = 3,
};
Type of Stream Camera
enum CameraType {
/*! FPV Camera */
kCameraTypeFpv = 0,
/*! Payload Camera */
kCameraTypePayload = 1,
};
Quality of the Stream
enum StreamQuality {
/*! Stream Quality 540p: 30fps, 960*540, bps 512*1024 */
kStreamQuality540p = 1,
/*! Stream Quality 720p: 30fps, 1280*720, bps 1024*1024 */
kStreamQuality720p = 2,
/*! Stream Quality 720pHigh: 30fps, 1280*720, bps 1024*1024 + 512*1024 */
kStreamQuality720pHigh = 3,
/*! Stream Quality 1080p: 30fps, 1920*1080, bps 3*1024*1024 */
kStreamQuality1080p = 4,
/*! Stream Quality 1080pHigh: 30fps, 1920*1080, bps 8*1024*1024 */
kStreamQuality1080pHigh = 5,
};
Initialization Parameters for Live Stream
struct Options {
/*! Type of camera for subscribing stream */
CameraType camera;
/*! Quality of subscribed stream. Note: The actual quality of the subscribed stream may vary; the dock will return the closest matching stream quality based on current conditions. */
StreamQuality quality;
/*! Processing function for received stream */
H264Callback callback;
};
Function
Function: Callback for the liveview camera's h264 stream | product:all |
using H264Callback = std::function<ErrorCode(const uint8_t* buf, uint32_t len)>;
len:Length of the received h264 stream data
buf:Received h264 stream data
Live stream status. Each bit represents the validity of different stream qualities: bit0 represents the validity of the adaptive stream; bit1 represents the 540p stream's validity; bit2 represents the 720p stream's validity; bit3 represents the 720pHigh stream's validity; bit4 represents the 1080p stream's validity;bit5 represents the 1080pHigh stream's validity. | product:all |
using LiveviewStatus = uint32_t;
Function: Prototype for stream status processing | product:all |
using LiveviewStatusCallback = std::function<void(const LiveviewStatus& status)>;
status:Stream's status
Function: Initialize live stream subscription. Note: For a specific camera, you can initialize only once | product:all |
virtual ErrorCode Init(const Options& option) = 0;
option:Stream initialization configuration
Return
Execution result
Function: Deinitialize stream subscription | product:all |
virtual ErrorCode DeInit() = 0;
Execution result
Function: Set camera stream source | product:all |
virtual ErrorCode SetCameraSource(CameraSource source) = 0;
Execution result
Function: Subscribe to live stream status | product:all |
virtual ErrorCode SubscribeLiveviewStatus(
const LiveviewStatusCallback& callback) = 0;
callback:Stream processing callback
Return
Execution result
Function: Start live H264 stream | product:all |
virtual ErrorCode StartH264Stream() = 0;
Execution result
Function: Stop live H264 stream | product:all |
virtual ErrorCode StopH264Stream() = 0;
Execution result
Function: Get liveview module instance | product:all |
std::shared_ptr<Liveview> CreateLiveview();
Execution result