QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
QGCVideoStreamInfo.cc
Go to the documentation of this file.
3
4QGC_LOGGING_CATEGORY(QGCVideoStreamInfoLog, "Camera.QGCVideoStreamInfo")
5
7 : QObject(parent)
8{
9 qCDebug(QGCVideoStreamInfoLog) << this;
10
11 (void) memcpy(&_streamInfo, &info, sizeof(mavlink_video_stream_information_t));
12}
13
15{
16 qreal ar = 1.0;
17 if (!resolution().isEmpty()) {
18 ar = static_cast<double>(_streamInfo.resolution_h) / static_cast<double>(_streamInfo.resolution_v);
19 }
20 return ar;
21}
22
24{
25 bool changed = false;
26 const auto assign = [&changed](auto& field, auto value) {
27 if (field != value) {
28 field = value;
29 changed = true;
30 }
31 };
32
33 assign(_streamInfo.hfov, status.hfov);
34 assign(_streamInfo.flags, status.flags);
35 assign(_streamInfo.bitrate, status.bitrate);
36 assign(_streamInfo.rotation, status.rotation);
37 assign(_streamInfo.framerate, status.framerate);
38 assign(_streamInfo.resolution_h, status.resolution_h);
39 assign(_streamInfo.resolution_v, status.resolution_v);
40
41 if (changed) {
42 emit infoChanged();
43 }
44
45 return changed;
46}
#define QGC_LOGGING_CATEGORY(name, categoryStr)
struct __mavlink_video_stream_information_t mavlink_video_stream_information_t
struct __mavlink_video_stream_status_t mavlink_video_stream_status_t
bool update(const mavlink_video_stream_status_t &info)
QGCVideoStreamInfo(const mavlink_video_stream_information_t &info, QObject *parent=nullptr)