dji_liveview.hpp
Go to the documentation of this file.
1 
29 #ifndef ONBOARDSDK_DJI_LIVEVIEW_H
30 #define ONBOARDSDK_DJI_LIVEVIEW_H
31 
32 #include <cstring>
33 #include "dji_camera_image.hpp"
34 
35 namespace DJI {
36 namespace OSDK {
37 
38 // Forward Declaration
39 class LiveViewImpl;
40 
41 class LiveView {
42  public:
43  typedef enum {
44  OSDK_CAMERA_POSITION_NO_1 = 0,
45  OSDK_CAMERA_POSITION_NO_2 = 1,
46  OSDK_CAMERA_POSITION_NO_3 = 2,
47  OSDK_CAMERA_POSITION_FPV = 7
48  } LiveViewCameraPosition;
49 
50  typedef enum {
51  OSDK_CAMERA_SOURCE_DEF = 0,
52  OSDK_CAMERA_SOURCE_H20_WIDE = 1,
53  OSDK_CAMERA_SOURCE_H20T_WIDE = 1,
54  OSDK_CAMERA_SOURCE_H20_ZOOM = 2,
55  OSDK_CAMERA_SOURCE_H20T_ZOOM = 2,
56  OSDK_CAMERA_SOURCE_H20T_IR = 3
57  } LiveViewCameraSource;
58 
59  typedef enum {
60  OSDK_LIVEVIEW_PASS = 0,
61  OSDK_LIVEVIEW_TIMEOUT = 1,
62  OSDK_LIVEVIEW_SUBSCRIBE_FAIL = 2,
63  OSDK_LIVEVIEW_INDEX_ILLEGAL = 3,
64  OSDK_LIVEVIEW_HEART_BEAT_START_FAIL = 4,
65  OSDK_LIVEVIEW_CAM_NOT_MOUNTED = 5,
66  OSDK_LIVEVIEW_UNSUPPORT_AIRCRAFT = 6,
67  OSDK_LIVEVIEW_UNSUPPORT_CAMERA = 7,
68  OSDK_LIVEVIEW_UNKNOWN = 0xFF,
69  } LiveViewErrCode;
70 
71  public:
72  LiveView(Vehicle *vehiclePtr);
73 
74  ~LiveView();
86  LiveViewErrCode startH264Stream(LiveViewCameraPosition pos, H264Callback cb, void *userData);
87 
96  LiveViewErrCode stopH264Stream(LiveViewCameraPosition pos);
97 
108  LiveViewErrCode changeH264Source(LiveViewCameraPosition pos, LiveViewCameraSource source);
109 
110  private:
111  Vehicle *vehicle;
112  LiveViewImpl *impl;
113 
114 };
115 } // OSDK
116 } // DJI
117 
118 #endif //ONBOARDSDK_DJI_LIVEVIEW_H
Definition: dji_ack.cpp:38