QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
QGCVideoStreamInfo.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QLoggingCategory>
4#include <QtCore/QObject>
5#include <QtCore/QSize>
6#include <QtQmlIntegration/QtQmlIntegration>
7
8#include "MAVLinkLib.h"
9
10Q_DECLARE_LOGGING_CATEGORY(QGCVideoStreamInfoLog)
11
12
13class QGCVideoStreamInfo : public QObject
14{
15 Q_OBJECT
16 QML_ELEMENT
17 QML_UNCREATABLE("")
18 Q_PROPERTY(QString uri READ uri NOTIFY infoChanged)
19 Q_PROPERTY(QString name READ name NOTIFY infoChanged)
20 Q_PROPERTY(quint8 streamID READ streamID NOTIFY infoChanged)
21 Q_PROPERTY(quint8 type READ type NOTIFY infoChanged)
22 Q_PROPERTY(qreal aspectRatio READ aspectRatio NOTIFY infoChanged)
23 Q_PROPERTY(quint16 hfov READ hfov NOTIFY infoChanged)
24 Q_PROPERTY(bool isThermal READ isThermal NOTIFY infoChanged)
25 Q_PROPERTY(bool isActive READ isActive NOTIFY infoChanged)
26 Q_PROPERTY(QSize resolution READ resolution NOTIFY infoChanged)
27 Q_PROPERTY(quint8 encoding READ encoding NOTIFY infoChanged)
28 Q_PROPERTY(quint16 rotation READ rotation NOTIFY infoChanged)
29 Q_PROPERTY(quint32 bitrate READ bitrate NOTIFY infoChanged)
30 Q_PROPERTY(qreal framerate READ framerate NOTIFY infoChanged)
31 Q_ENUM(VIDEO_STREAM_TYPE)
32 Q_ENUM(VIDEO_STREAM_ENCODING)
33 Q_FLAGS(QVIDEO_STREAM_STATUS_FLAGS)
34
35public:
36 explicit QGCVideoStreamInfo(const mavlink_video_stream_information_t &info, QObject *parent = nullptr);
38
39 Q_DECLARE_FLAGS(QVIDEO_STREAM_STATUS_FLAGS, VIDEO_STREAM_STATUS_FLAGS)
40
41 QString uri() const { return QString(_streamInfo.uri); }
42 QString name() const { return QString(_streamInfo.name); }
43 qreal aspectRatio() const;
44 quint16 hfov() const { return _streamInfo.hfov; }
45 quint8 type() const { return _streamInfo.type; }
46 quint8 streamID() const { return _streamInfo.stream_id; }
47 quint8 encoding() const { return _streamInfo.encoding; }
48 bool isThermal() const { return (_streamInfo.flags & VIDEO_STREAM_STATUS_FLAGS_THERMAL); }
49 QSize resolution() const { return QSize(_streamInfo.resolution_h, _streamInfo.resolution_v); }
50 quint16 rotation() const { return _streamInfo.rotation; }
51 bool isActive() const { return (_streamInfo.flags & VIDEO_STREAM_STATUS_FLAGS_RUNNING); }
52 uint32_t bitrate() const { return _streamInfo.bitrate; }
53 qreal framerate() const { return _streamInfo.framerate; }
54
55 bool update(const mavlink_video_stream_status_t &info);
56
57signals:
59
60private:
61 mavlink_video_stream_information_t _streamInfo{};
62};
63Q_DECLARE_METATYPE(VIDEO_STREAM_TYPE)
64Q_DECLARE_METATYPE(VIDEO_STREAM_ENCODING)
65Q_DECLARE_METATYPE(QGCVideoStreamInfo::QVIDEO_STREAM_STATUS_FLAGS)
Q_DECLARE_LOGGING_CATEGORY(AndroidSerialLog)
Encapsulates the contents of a VIDEO_STREAM_INFORMATION message.
Q_DECLARE_METATYPE(satellite_info_s)